Home » synapse-1.2-src » org.apache.synapse.endpoints » [javadoc | source]
org.apache.synapse.endpoints
public interface: Endpoint [javadoc | source]

All Known Implementing Classes:
    AddressEndpoint, WSDLEndpoint, FailoverEndpoint, SALoadbalanceEndpoint, IndirectEndpoint, LoadbalanceEndpoint, DefaultEndpoint

Endpoint defines the behavior common to all Synapse endpoints. Synapse endpoints should be able to send the given Synapse message context, rather than just providing the information for sending the message. The task a particular endpoint does in its send(...) method is specific to the endpoint. For example a loadbalance endpoint may choose another endpoint using its load balance policy and call its send(...) method while an address endpoint (leaf level) may send the message to an actual endpoint url. Endpoints may contain zero or more endpoints in them and build up a hierarchical structure of endpoints.
Method from org.apache.synapse.endpoints.Endpoint Summary:
getName,   isActive,   onChildEndpointFail,   send,   setActive,   setName,   setParentEndpoint
Method from org.apache.synapse.endpoints.Endpoint Detail:
 public String getName()
    Returns the name of the endpoint.
 public boolean isActive(MessageContext synMessageContext)
    Returns if the endpoint is currently active or not. Messages should not be sent to inactive endpoints.
 public  void onChildEndpointFail(Endpoint endpoint,
    MessageContext synMessageContext)
    Endpoints that contain other endpoints should implement this method. It will be called if a child endpoint causes an exception. Action to be taken on such failure is up to the implementation. But it is good practice to first try addressing the issue. If it can't be addressed propagate the exception to parent endpoint by calling parent endpoint's onChildEndpointFail(...) method.
 public  void send(MessageContext synMessageContext)
    Sends the message context according to an endpoint specific behavior.
 public  void setActive(boolean active,
    MessageContext synMessageContext)
    Sets the endpoint as active or inactive. If an endpoint is detected as failed, it should be set as inactive. But endpoints may be eventually set as active by the endpoint refresher to avoid ignoring endpoints forever.
 public  void setName(String name)
    Sets the name of the endpoint. Local registry use this name as the key for storing the endpoint.
 public  void setParentEndpoint(Endpoint parentEndpoint)
    Sets the parent endpoint for the current endpoint.