|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.synapse.FaultHandler
org.apache.synapse.endpoints.AbstractEndpoint
public abstract class AbstractEndpoint
An abstract base class for all Endpoint implementations
| Field Summary | |
|---|---|
protected boolean |
anonymous
|
protected String |
errorHandler
The Sequence name associated with the endpoint |
protected String |
fileName
The name of the file where this endpoint is defined |
protected boolean |
initialized
Has this endpoint been initialized ? |
protected Boolean |
isClusteringEnabled
Is clustering enabled |
protected org.apache.commons.logging.Log |
log
|
protected static org.apache.commons.logging.Log |
trace
|
| Constructor Summary | |
|---|---|
protected |
AbstractEndpoint()
|
| Method Summary | |
|---|---|
void |
addProperties(Collection<MediatorProperty> mediatorProperties)
Add all the properties to the endpoint |
void |
addProperty(MediatorProperty property)
Add a property to the endpoint. |
void |
destroy()
This method should implement the destroying of the implemented parts of the configuration. |
protected void |
evaluateProperties(MessageContext synCtx)
Evaluates the endpoint properties based on the current message context and set the properties to the message context appropriately |
List<Endpoint> |
getChildren()
Get the children of this endpoint |
EndpointContext |
getContext()
Get the EndpointContext that has the run-time state of this endpoint |
EndpointDefinition |
getDefinition()
|
String |
getDescription()
Retrieves the description of the artifact |
String |
getErrorHandler()
Get the MessageStore name associated with the Endpoint |
String |
getFileName()
Get the filename from which this endpoint is loaded, null if it is an anonymous endpoint |
EndpointView |
getMetricsMBean()
Get a reference to the metrics MBean for this endpoint |
String |
getName()
Get the name of an abstraction |
Endpoint |
getParentEndpoint()
|
Collection<MediatorProperty> |
getProperties()
Return the Collection of properties specified |
MediatorProperty |
getProperty(String name)
Get a property with the given name |
protected void |
handleException(String msg)
Helper methods to handle errors. |
protected void |
handleException(String msg,
Exception e)
Helper methods to handle errors. |
protected void |
informFailure(MessageContext synCtx,
int errorCode,
String errorMsg)
|
void |
init(SynapseEnvironment synapseEnvironment)
This method should implement the initialization of the implemented parts of the configuration. |
boolean |
isAnonymous()
|
boolean |
isInitialized()
Has this Endpoint initialized? |
boolean |
isLeafEndpoint()
Is this a leaf level endpoint? or parent endpoint that has children? |
protected boolean |
isRetryDisabled(MessageContext synCtx)
|
protected boolean |
isSuspendFault(MessageContext synCtx)
Is this a fault that should put the endpoint on SUSPEND? or is this a fault to ignore? |
protected boolean |
isTimeout(MessageContext synCtx)
Is this [fault] message a timeout? |
protected boolean |
isTraceOn(MessageContext msgCtx)
Should this mediator perform tracing? True if its explicitly asked to trace, or its parent has been asked to trace and it does not reject it |
protected boolean |
isTraceOrDebugOn(boolean isTraceOn)
Is tracing or debug logging on? |
protected void |
logOnChildEndpointFail(Endpoint endpoint,
MessageContext synMessageContext)
|
void |
onChildEndpointFail(Endpoint endpoint,
MessageContext synMessageContext)
Endpoints that contain other endpoints should implement this method. |
void |
onFault(MessageContext synCtx)
On a fault, propagate to parent if any, or call into the fault handler |
void |
onSuccess()
The SynapseCallback Receiver notifies an endpoint, if a message was successfully processed to give it a chance to clear up or reset its state to active |
protected void |
prepareForEndpointStatistics(MessageContext synCtx)
Process statistics for this message |
boolean |
readyToSend()
Returns true to indicate that the endpoint is ready to service requests |
MediatorProperty |
removeProperty(String name)
Remove a property with the given name |
void |
send(MessageContext synCtx)
Sends the message context according to an endpoint specific behavior. |
void |
setAnonymous(boolean anonymous)
|
void |
setChildren(List<Endpoint> children)
|
void |
setDefinition(EndpointDefinition definition)
|
void |
setDescription(String description)
Set the description of the artifact |
void |
setEnableMBeanStats(boolean flag)
set whether this endpoint needs to be registered for JMX Mbeans. |
void |
setErrorHandler(String errorHandler)
Set the Message Store name associated with the Endpoint |
protected void |
setErrorOnMessage(MessageContext synCtx,
String errorCode,
String errorMsg)
|
void |
setFileName(String fileName)
Set the filename from which the endpoint is loaded |
void |
setName(String endpointName)
Set the name of an abstraction |
void |
setParentEndpoint(Endpoint parentEndpoint)
Sets the parent endpoint for the current endpoint. |
String |
toString()
|
protected void |
traceOrDebug(boolean traceOn,
String msg)
Perform Trace and Debug logging of a message @INFO (trace) and DEBUG (log) |
| 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 |
|---|
protected org.apache.commons.logging.Log log
protected static final org.apache.commons.logging.Log trace
protected boolean initialized
protected Boolean isClusteringEnabled
protected String fileName
protected boolean anonymous
protected String errorHandler
| Constructor Detail |
|---|
protected AbstractEndpoint()
| Method Detail |
|---|
public EndpointView getMetricsMBean()
Endpoint
getMetricsMBean in interface Endpointpublic EndpointContext getContext()
Endpoint
getContext in interface Endpointpublic String getName()
Nameable
getName in interface Nameablepublic boolean isInitialized()
Endpoint
isInitialized in interface Endpointpublic EndpointDefinition getDefinition()
public void setDefinition(EndpointDefinition definition)
public Endpoint getParentEndpoint()
public void setParentEndpoint(Endpoint parentEndpoint)
Endpoint
setParentEndpoint in interface EndpointparentEndpoint - parent endpoint containing this endpoint. It should handle the onChildEndpointFail(...)
callback.public List<Endpoint> getChildren()
Endpoint
getChildren in interface Endpointpublic void setChildren(List<Endpoint> children)
public String getFileName()
Endpointnull if it is an anonymous endpoint
getFileName in interface Endpointpublic void setFileName(String fileName)
Endpoint
setFileName in interface EndpointfileName - from which the endpoint is loadedpublic boolean isAnonymous()
public void setAnonymous(boolean anonymous)
public void setDescription(String description)
SynapseArtifact
setDescription in interface SynapseArtifactdescription - tobe set to the artifactpublic String getDescription()
SynapseArtifact
getDescription in interface SynapseArtifactpublic String toString()
toString in class Objectpublic void setName(String endpointName)
Nameable
setName in interface NameableendpointName - String Representation of namepublic void setEnableMBeanStats(boolean flag)
flag - set true/falsepublic void init(SynapseEnvironment synapseEnvironment)
ManagedLifecycle
init in interface ManagedLifecyclesynapseEnvironment - SynapseEnvironment to be used for initializationpublic boolean readyToSend()
Endpoint
readyToSend in interface Endpointpublic void send(MessageContext synCtx)
Endpoint
send in interface EndpointsynCtx - MessageContext to be sent.public boolean isLeafEndpoint()
public void onChildEndpointFail(Endpoint endpoint,
MessageContext synMessageContext)
Endpoint
onChildEndpointFail in interface Endpointendpoint - The child endpoint which caused the exception.synMessageContext - MessageContext that was used in the failed attempt.protected boolean isTimeout(MessageContext synCtx)
synCtx - the current fault message
protected boolean isRetryDisabled(MessageContext synCtx)
protected boolean isSuspendFault(MessageContext synCtx)
synCtx - the current fault message
public void onFault(MessageContext synCtx)
onFault in class FaultHandlersynCtx - the message at handpublic void onSuccess()
onSuccess in interface Endpointprotected boolean isTraceOn(MessageContext msgCtx)
msgCtx - the current message
protected boolean isTraceOrDebugOn(boolean isTraceOn)
isTraceOn - is tracing known to be on?
protected void traceOrDebug(boolean traceOn,
String msg)
traceOn - is runtime trace on for this message?msg - the message to log/traceprotected void prepareForEndpointStatistics(MessageContext synCtx)
synCtx - the current messageprotected void handleException(String msg)
msg - The error message
protected void handleException(String msg,
Exception e)
msg - The error messagee - The exception
protected void logOnChildEndpointFail(Endpoint endpoint,
MessageContext synMessageContext)
protected void informFailure(MessageContext synCtx,
int errorCode,
String errorMsg)
protected void setErrorOnMessage(MessageContext synCtx,
String errorCode,
String errorMsg)
public void destroy()
ManagedLifecycle
destroy in interface ManagedLifecyclepublic void addProperty(MediatorProperty property)
addProperty in interface PropertyIncludeproperty - property to be addedpublic MediatorProperty getProperty(String name)
getProperty in interface PropertyIncludename - name of the property
public Collection<MediatorProperty> getProperties()
Collection of properties specified
getProperties in interface PropertyIncludeCollection of propertiespublic MediatorProperty removeProperty(String name)
removeProperty in interface PropertyIncludename - name of the property to be removed
null if a property doesn't existspublic void addProperties(Collection<MediatorProperty> mediatorProperties)
addProperties in interface PropertyIncludemediatorProperties - Collection of properties to be addedpublic String getErrorHandler()
Endpoint
getErrorHandler in interface Endpointpublic void setErrorHandler(String errorHandler)
Endpoint
setErrorHandler in interface Endpointprotected void evaluateProperties(MessageContext synCtx)
synCtx - the current message context
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||