Class AlgorithmContext
- java.lang.Object
-
- org.apache.synapse.endpoints.algorithms.AlgorithmContext
-
public class AlgorithmContext extends Object
Keeps the runtime state of the algorithm
-
-
Constructor Summary
Constructors Constructor Description AlgorithmContext(boolean clusteringEnabled, org.apache.axis2.context.ConfigurationContext cfgCtx, String endpointName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.axis2.context.ConfigurationContext
getConfigurationContext()
Get the configuration context instance .int
getCurrentEndpointIndex()
To get the position of the current EPR for use.Object
getProperty(String key)
Get the property value corresponding to a specified keyvoid
setCurrentEndpointIndex(int currentEPR)
The position of the current EPRvoid
setProperty(String key, Object value)
Store a property in the algorithm context.
-
-
-
Constructor Detail
-
AlgorithmContext
public AlgorithmContext(boolean clusteringEnabled, org.apache.axis2.context.ConfigurationContext cfgCtx, String endpointName)
-
-
Method Detail
-
getCurrentEndpointIndex
public int getCurrentEndpointIndex()
To get the position of the current EPR for use. Default to 0 - i.e. first endpoint- Returns:
- The position of the current EPR
-
setCurrentEndpointIndex
public void setCurrentEndpointIndex(int currentEPR)
The position of the current EPR- Parameters:
currentEPR
- The current position
-
getConfigurationContext
public org.apache.axis2.context.ConfigurationContext getConfigurationContext()
Get the configuration context instance . This is only available for cluster env.- Returns:
- Returns the ConfigurationContext instance
-
getProperty
public Object getProperty(String key)
Get the property value corresponding to a specified key- Parameters:
key
- The key of the property- Returns:
- The value of the property or null if the key does not exist
-
setProperty
public void setProperty(String key, Object value)
Store a property in the algorithm context. In a clustered environment properties will be saved in the configuration context and replicated. In non-clustered environments properties will be stored in a local property map.- Parameters:
key
- The key of the propertyvalue
- The value of the property
-
-