org.apache.synapse.endpoints
Class AddressEndpoint

java.lang.Object
  extended by org.apache.synapse.FaultHandler
      extended by org.apache.synapse.endpoints.DefaultEndpoint
          extended by org.apache.synapse.endpoints.AddressEndpoint
All Implemented Interfaces:
Endpoint

public class AddressEndpoint
extends DefaultEndpoint

This class represents an actual endpoint to send the message. It is responsible for sending the message, performing retries if a failure occurred and informing the parent endpoint if a failure couldn't be recovered.


Field Summary
 
Fields inherited from class org.apache.synapse.endpoints.DefaultEndpoint
log, trace
 
Constructor Summary
AddressEndpoint()
           
 
Method Summary
 boolean isActive(MessageContext synMessageContext)
          Checks if the endpoint is active (failed or not).
 void onFault(MessageContext synCtx)
          This will be executed to handle any Exceptions occurred within the Synapse environment.
 void send(MessageContext synCtx)
          Sends the message through this endpoint.
 void setActive(boolean active, MessageContext synMessageContext)
          Sets if endpoint active or not.
 
Methods inherited from class org.apache.synapse.endpoints.DefaultEndpoint
getEndpoint, getName, isTraceOn, isTraceOrDebugOn, onChildEndpointFail, setEndpoint, setName, setParentEndpoint, 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, toString, wait, wait, wait
 

Constructor Detail

AddressEndpoint

public AddressEndpoint()
Method Detail

isActive

public boolean isActive(MessageContext synMessageContext)
Checks if the endpoint is active (failed or not). If endpoint is in failed state and suspendOnFailDuration has elapsed, it will be set to active.

Specified by:
isActive in interface Endpoint
Overrides:
isActive in class DefaultEndpoint
Parameters:
synMessageContext - MessageContext of the current message. This is not used here.
Returns:
true if endpoint is active. false otherwise.

setActive

public void setActive(boolean active,
                      MessageContext synMessageContext)
Sets if endpoint active or not. if endpoint is set as failed (active = false), the recover on time is calculated so that it will be activated after the recover on time.

Specified by:
setActive in interface Endpoint
Overrides:
setActive in class DefaultEndpoint
Parameters:
active - true if active. false otherwise.
synMessageContext - MessageContext of the current message. This is not used here.

send

public void send(MessageContext synCtx)
Sends the message through this endpoint. This method just handles statistics related functions and gives the message to the Synapse environment to send. It does not add any endpoint specific details to the message context. These details are added only to the cloned message context by the Axis2FlexibleMepClient. So that we can reuse the original message context for resending through different endpoints.

Specified by:
send in interface Endpoint
Overrides:
send in class DefaultEndpoint
Parameters:
synCtx - MessageContext sent by client to Synapse

onFault

public void onFault(MessageContext synCtx)
Description copied from class: FaultHandler
This will be executed to handle any Exceptions occurred within the Synapse environment.

Overrides:
onFault in class DefaultEndpoint
Parameters:
synCtx - SynapseMessageContext of which the fault occured message comprises


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