Home » synapse-1.2-src » org.apache.synapse.endpoints.dispatch » [javadoc | source]
org.apache.synapse.endpoints.dispatch
public class: DispatcherContext [javadoc | source]
java.lang.Object
   org.apache.synapse.endpoints.dispatch.DispatcherContext
Keeps the states of the dispatcher . This hides where those states are kept . For a cluster environment , all states are kept in the axis2 configuration context in order to replicate those states so that other synapse instance in the same cluster can see those changes . This class can be evolved to keep any run time states related to the endpoint . For a non-clustered environment , all data are kept locally.

This class provide the abstraction need to separate the dynamic data from the static data and improve the high cohesion and provides capability to replicate only required state at a given time. This improves the performance when replicate data.
Method from org.apache.synapse.endpoints.dispatch.DispatcherContext Summary:
getConfigurationContext,   getEndpoint,   handleException,   handleException,   isClusteringEnable,   removeSession,   setConfigurationContext,   setContextID,   setEndpoint,   setEndpoints
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.synapse.endpoints.dispatch.DispatcherContext Detail:
 public ConfigurationContext getConfigurationContext() 
    Get the configuration context instance . This is only available for cluster env.
 public Endpoint getEndpoint(String sessionID) 
    return the endpoint for the given session. Null will be returned , if there is no endpoint for given session.
 protected  void handleException(String msg) 
    Helper methods for handle errors.
 protected  void handleException(String msg,
    Exception e) 
    Helper methods for handle errors.
 public boolean isClusteringEnable() 
    Returns whether clustering is enable or not
 public  void removeSession(String id) 
    Removes the endpoint for the given session.
 public  void setConfigurationContext(ConfigurationContext configCtx) 
    Sets the ConfigurationContext instance . This is only used for cluster env. By setting this , indicates that this is a cluster env.
 public  void setContextID(String contextID) 
    Sets the identifier for this dispatcher context , so that , this can be identified uniquely across the cluster. The id will be the name of the endpoint
 public  void setEndpoint(String sessionID,
    Endpoint endpoint) 
    Sets the given endpoint mapping with given the session id.
 public  void setEndpoints(List<Endpoint> endpoints) 
    Sets the defined child endpoints