org.apache.synapse.endpoints
Class DynamicLoadbalanceEndpoint

java.lang.Object
  extended by org.apache.synapse.FaultHandler
      extended by org.apache.synapse.endpoints.AbstractEndpoint
          extended by org.apache.synapse.endpoints.LoadbalanceEndpoint
              extended by org.apache.synapse.endpoints.DynamicLoadbalanceEndpoint
All Implemented Interfaces:
Endpoint, ManagedLifecycle, Nameable, PropertyInclude, SynapseArtifact

public class DynamicLoadbalanceEndpoint
extends LoadbalanceEndpoint

Represents a dynamic load balance endpoint. The application membership is not static, but discovered through some mechanism such as using a GCF


Field Summary
protected  Dispatcher dispatcher
          Dispatcher used for session affinity.
protected  boolean sessionAffinity
          Flag to enable session affinity based load balancing.
protected  long sessionTimeout
           
 
Fields inherited from class org.apache.synapse.endpoints.AbstractEndpoint
anonymous, errorHandler, fileName, initialized, isClusteringEnabled, trace
 
Constructor Summary
DynamicLoadbalanceEndpoint()
           
 
Method Summary
protected  String extractSessionID(MessageContext synCtx, String key)
           
 Dispatcher getDispatcher()
           
 LoadBalanceMembershipHandler getLbMembershipHandler()
           
 long getSessionTimeout()
           
 void init(SynapseEnvironment synapseEnvironment)
          This method should implement the initialization of the implemented parts of the configuration.
 boolean isSessionAffinityBasedLB()
           
 void send(MessageContext synCtx)
          Sends the message context according to an endpoint specific behavior.
protected  void sendToApplicationMember(MessageContext synCtx, Member currentMember, DynamicLoadbalanceFaultHandler faultHandler, boolean newSession)
           
protected  void setCookieHeader(MessageContext synCtx)
           
 void setDispatcher(Dispatcher dispatcher)
           
 void setLoadBalanceMembershipHandler(LoadBalanceMembershipHandler lbMembershipHandler)
           
 void setName(String name)
          Set the name of an abstraction
 void setSessionAffinity(boolean sessionAffinity)
           
 void setSessionTimeout(long sessionTimeout)
           
 
Methods inherited from class org.apache.synapse.endpoints.LoadbalanceEndpoint
destroy, getAlgorithm, getMembers, getNextChild, isFailover, onChildEndpointFail, readyToSend, setAlgorithm, setFailover, setMembers, startApplicationMembershipTimer
 
Methods inherited from class org.apache.synapse.endpoints.AbstractEndpoint
addProperties, addProperty, evaluateProperties, getChildren, getContext, getDefinition, getDescription, getErrorHandler, getFileName, getMetricsMBean, getName, getParentEndpoint, getProperties, getProperty, handleException, handleException, informFailure, isAnonymous, isInitialized, isLeafEndpoint, isRetryDisabled, isSuspendFault, isTimeout, isTraceOn, isTraceOrDebugOn, logOnChildEndpointFail, onFault, onSuccess, prepareForEndpointStatistics, removeProperty, setAnonymous, setChildren, setDefinition, setDescription, setEnableMBeanStats, setErrorHandler, setErrorOnMessage, setFileName, setParentEndpoint, toString, traceOrDebug
 
Methods inherited from class org.apache.synapse.FaultHandler
getStackTrace, handleFault, handleFault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sessionAffinity

protected boolean sessionAffinity
Flag to enable session affinity based load balancing.


dispatcher

protected Dispatcher dispatcher
Dispatcher used for session affinity.


sessionTimeout

protected long sessionTimeout
Constructor Detail

DynamicLoadbalanceEndpoint

public DynamicLoadbalanceEndpoint()
Method Detail

init

public void init(SynapseEnvironment synapseEnvironment)
Description copied from interface: ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.

Specified by:
init in interface ManagedLifecycle
Overrides:
init in class LoadbalanceEndpoint
Parameters:
synapseEnvironment - SynapseEnvironment to be used for initialization

setLoadBalanceMembershipHandler

public void setLoadBalanceMembershipHandler(LoadBalanceMembershipHandler lbMembershipHandler)

getLbMembershipHandler

public LoadBalanceMembershipHandler getLbMembershipHandler()

send

public void send(MessageContext synCtx)
Description copied from interface: Endpoint
Sends the message context according to an endpoint specific behavior.

Specified by:
send in interface Endpoint
Overrides:
send in class LoadbalanceEndpoint
Parameters:
synCtx - MessageContext to be sent.

setCookieHeader

protected void setCookieHeader(MessageContext synCtx)

extractSessionID

protected String extractSessionID(MessageContext synCtx,
                                  String key)

setName

public void setName(String name)
Description copied from interface: Nameable
Set the name of an abstraction

Specified by:
setName in interface Nameable
Overrides:
setName in class AbstractEndpoint
Parameters:
name - String Representation of name

getDispatcher

public Dispatcher getDispatcher()

setDispatcher

public void setDispatcher(Dispatcher dispatcher)

getSessionTimeout

public long getSessionTimeout()

setSessionTimeout

public void setSessionTimeout(long sessionTimeout)

setSessionAffinity

public void setSessionAffinity(boolean sessionAffinity)

isSessionAffinityBasedLB

public boolean isSessionAffinityBasedLB()

sendToApplicationMember

protected void sendToApplicationMember(MessageContext synCtx,
                                       Member currentMember,
                                       DynamicLoadbalanceFaultHandler faultHandler,
                                       boolean newSession)


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