org.apache.synapse.endpoints
Class EndpointContext

java.lang.Object
  extended by org.apache.synapse.endpoints.EndpointContext

public class EndpointContext
extends Object

This class is one of the key classes of the Endpoint management in Synapse. It maintains the runtime state of an endpoint for local and clustered endpoint configurations.


Field Summary
static int ST_ACTIVE
          And active endpoint known to be functioning properly
static int ST_OFF
          An endpoint manually switched off into maintenance - it will never change state automatically
static int ST_SUSPENDED
          An endpoint put into the suspended state by the system.
static int ST_TIMEOUT
          An endpoint which timed out - but now maybe ready to retry depending on the current time
 
Constructor Summary
EndpointContext(String endpointName, EndpointDefinition endpointDefinition, boolean clustered, ConfigurationContext cfgCtx, EndpointView metricsBean)
          Create an EndpointContext to hold runtime state of an Endpoint
 
Method Summary
 boolean isState(int s)
           
 void onFault()
          Endpoint failed processing a message
 void onSuccess()
          Endpoint has processed a message successfully
 void onTimeout()
          Endpoint timeout processing a message
 boolean readyToSend()
          Checks if the endpoint is in the state ST_ACTIVE.
 void switchOff()
          Manually turn off this endpoint (e.g.
 void switchOn()
          Activate this endpoint manually (i.e.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ST_ACTIVE

public static final int ST_ACTIVE
And active endpoint known to be functioning properly

See Also:
Constant Field Values

ST_TIMEOUT

public static final int ST_TIMEOUT
An endpoint which timed out - but now maybe ready to retry depending on the current time

See Also:
Constant Field Values

ST_SUSPENDED

public static final int ST_SUSPENDED
An endpoint put into the suspended state by the system. Will retry after an applicable delay

See Also:
Constant Field Values

ST_OFF

public static final int ST_OFF
An endpoint manually switched off into maintenance - it will never change state automatically

See Also:
Constant Field Values
Constructor Detail

EndpointContext

public EndpointContext(String endpointName,
                       EndpointDefinition endpointDefinition,
                       boolean clustered,
                       ConfigurationContext cfgCtx,
                       EndpointView metricsBean)
Create an EndpointContext to hold runtime state of an Endpoint

Parameters:
endpointName - the name of the endpoint (mainly for logging)
endpointDefinition - the definition of the endpoint (e.g. retry time, suspend duration..)
clustered - is the environment clustered?
cfgCtx - the Axis2 configurationContext for clustering
Method Detail

onSuccess

public void onSuccess()
Endpoint has processed a message successfully


onFault

public void onFault()
Endpoint failed processing a message


onTimeout

public void onTimeout()
Endpoint timeout processing a message


readyToSend

public boolean readyToSend()
Checks if the endpoint is in the state ST_ACTIVE. In a clustered environment, the non availability of a clustered STATE_KEY implies that this endpoint is active

Returns:
Returns true if the endpoint should be considered as active

switchOff

public void switchOff()
Manually turn off this endpoint (e.g. for maintenence)


switchOn

public void switchOn()
Activate this endpoint manually (i.e. from an automatic suspend or manual switch off)


isState

public boolean isState(int s)

toString

public String toString()
Overrides:
toString in class Object


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