org.apache.synapse.endpoints.algorithms
Class AlgorithmContext

java.lang.Object
  extended by org.apache.synapse.endpoints.algorithms.AlgorithmContext

public class AlgorithmContext
extends Object

Keeps the runtime state of the algorithm


Constructor Summary
AlgorithmContext(boolean clusteringEnabled, ConfigurationContext cfgCtx, String endpointName)
           
 
Method Summary
 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 key
 void setCurrentEndpointIndex(int currentEPR)
          The position of the current EPR
 void setProperty(String key, Object value)
          Store a property in the algorithm context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmContext

public AlgorithmContext(boolean clusteringEnabled,
                        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 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 property
value - The value of the property


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.