public abstract class AbstractEndpoint extends FaultHandler implements Endpoint, PropertyInclude
Modifier and Type | Field and Description |
---|---|
protected boolean |
anonymous |
protected java.lang.String |
artifactContainerName |
static java.lang.String |
CHILDREN_JSON_ATT |
protected java.lang.String |
errorHandler
The Sequence name associated with the endpoint
|
protected java.lang.String |
fileName
The name of the file where this endpoint is defined
|
protected boolean |
initialized
Has this endpoint been initialized ?
|
protected java.lang.Boolean |
isClusteringEnabled
Is clustering enabled
|
protected org.apache.commons.logging.Log |
log |
static java.lang.String |
NAME_JSON_ATT
Attributes for json representation
|
protected static org.apache.commons.logging.Log |
trace |
static java.lang.String |
TYPE_JSON_ATT |
Modifier | Constructor and Description |
---|---|
protected |
AbstractEndpoint() |
Modifier and Type | Method and Description |
---|---|
void |
addProperties(java.util.Collection<MediatorProperty> mediatorProperties)
Add all the properties to the endpoint
|
void |
addProperty(MediatorProperty property)
Add a property to the endpoint.
|
protected abstract void |
createJsonRepresentation() |
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
|
void |
executeEpTypeSpecificFunctions(MessageContext synCtx) |
java.lang.String |
getArtifactContainerName()
Get the car File name which this endpoint deployed from
|
java.util.List<Endpoint> |
getChildren()
Get the children of this endpoint
|
java.util.List<java.lang.String> |
getCommentsList() |
EndpointContext |
getContext()
Get the EndpointContext that has the run-time state of this endpoint
|
EndpointDefinition |
getDefinition() |
java.lang.String |
getDescription()
Retrieves the description of the artifact
|
protected org.json.JSONArray |
getEndpointChildrenAsJson(java.util.List<Endpoint> children) |
java.lang.String |
getErrorHandler()
Get the MessageStore name associated with the Endpoint
|
java.lang.String |
getFileName()
Get the filename from which this endpoint is loaded,
null if it is an anonymous endpoint |
boolean |
getIsEdited()
Get the edit state of the endpoint
|
org.json.JSONObject |
getJsonRepresentation()
Get the json representation of the endpoint.
|
EndpointView |
getMetricsMBean()
Get a reference to the metrics MBean for this endpoint
|
java.lang.String |
getName()
Get the name of an abstraction
|
Endpoint |
getParentEndpoint() |
java.util.Collection<MediatorProperty> |
getProperties()
Return the
Collection of properties specified |
MediatorProperty |
getProperty(java.lang.String name)
Get a property with the given name
|
java.lang.String |
getReportingName() |
protected void |
handleException(java.lang.String msg)
Helper methods to handle errors.
|
protected void |
handleException(java.lang.String msg,
java.lang.Exception e)
Helper methods to handle errors.
|
protected void |
handleException(java.lang.String msg,
java.lang.Exception e,
MessageContext msgCtx)
Helper methods to handle errors.
|
protected void |
informFailure(MessageContext synCtx,
int errorCode,
java.lang.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 |
isRetry(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 |
logSetter() |
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(java.lang.String name)
Remove a property with the given name
|
void |
send(MessageContext synCtx)
Sends the message context according to an endpoint specific behavior.
|
protected void |
setAdvancedProperties()
Set advanced properties of the endpoint to json object.
|
void |
setAnonymous(boolean anonymous) |
void |
setArtifactContainerName(java.lang.String name)
Set the car File name which this endpoint deployed from
|
void |
setChildren(java.util.List<Endpoint> children) |
void |
setCommentsList(java.util.List<java.lang.String> commentsList) |
void |
setComponentStatisticsId(ArtifactHolder holder) |
void |
setContentAware(boolean contentAware) |
void |
setDefinition(EndpointDefinition definition) |
void |
setDescription(java.lang.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(java.lang.String errorHandler)
Set the Message Store name associated with the Endpoint
|
protected void |
setErrorOnMessage(MessageContext synCtx,
java.lang.Integer errorCode,
java.lang.String errorMsg) |
void |
setFileName(java.lang.String fileName)
Set the filename from which the endpoint is loaded
|
void |
setForceBuildMC(boolean forceBuildMC) |
void |
setIsEdited(boolean isEdited)
Set the edit state of the endpoint
|
void |
setName(java.lang.String endpointName)
Set the name of an abstraction
|
void |
setParentEndpoint(Endpoint parentEndpoint)
Sets the parent endpoint for the current endpoint.
|
java.lang.String |
toString() |
protected void |
traceOrDebug(boolean traceOn,
java.lang.String msg)
Perform Trace and Debug logging of a message @INFO (trace) and DEBUG (log)
|
executeExtendedSynapseHandlerOnFault, getStackTrace, handleFault, handleFault
protected org.apache.commons.logging.Log log
protected static final org.apache.commons.logging.Log trace
protected volatile boolean initialized
protected java.lang.Boolean isClusteringEnabled
protected java.lang.String fileName
protected boolean anonymous
protected java.lang.String errorHandler
protected java.lang.String artifactContainerName
public static final java.lang.String NAME_JSON_ATT
public static final java.lang.String TYPE_JSON_ATT
public static final java.lang.String CHILDREN_JSON_ATT
public EndpointView getMetricsMBean()
Endpoint
getMetricsMBean
in interface Endpoint
public EndpointContext getContext()
Endpoint
getContext
in interface Endpoint
public java.lang.String getName()
Nameable
public boolean isInitialized()
Endpoint
isInitialized
in interface Endpoint
public EndpointDefinition getDefinition()
public void setDefinition(EndpointDefinition definition)
public Endpoint getParentEndpoint()
public void setParentEndpoint(Endpoint parentEndpoint)
Endpoint
setParentEndpoint
in interface Endpoint
parentEndpoint
- parent endpoint containing this endpoint. It should handle the onChildEndpointFail(...)
callback.public java.util.List<Endpoint> getChildren()
Endpoint
getChildren
in interface Endpoint
public void setChildren(java.util.List<Endpoint> children)
public java.lang.String getFileName()
Endpoint
null
if it is an anonymous endpointgetFileName
in interface Endpoint
public void setFileName(java.lang.String fileName)
Endpoint
setFileName
in interface Endpoint
fileName
- from which the endpoint is loadedpublic boolean isAnonymous()
public void setAnonymous(boolean anonymous)
public void setDescription(java.lang.String description)
SynapseArtifact
setDescription
in interface SynapseArtifact
description
- tobe set to the artifactpublic java.lang.String getDescription()
SynapseArtifact
getDescription
in interface SynapseArtifact
public java.lang.String toString()
toString
in class java.lang.Object
public void setName(java.lang.String endpointName)
Nameable
public void setArtifactContainerName(java.lang.String name)
setArtifactContainerName
in interface Endpoint
name
- public java.lang.String getArtifactContainerName()
getArtifactContainerName
in interface Endpoint
public boolean getIsEdited()
getIsEdited
in interface Endpoint
public void setIsEdited(boolean isEdited)
setIsEdited
in interface Endpoint
isEdited
- public void setEnableMBeanStats(boolean flag)
flag
- set true/falsepublic void init(SynapseEnvironment synapseEnvironment)
ManagedLifecycle
init
in interface ManagedLifecycle
synapseEnvironment
- SynapseEnvironment to be used for initializationpublic java.util.List<java.lang.String> getCommentsList()
public void setCommentsList(java.util.List<java.lang.String> commentsList)
public boolean readyToSend()
Endpoint
readyToSend
in interface Endpoint
public void send(MessageContext synCtx)
Endpoint
public boolean isLeafEndpoint()
public void onChildEndpointFail(Endpoint endpoint, MessageContext synMessageContext)
Endpoint
onChildEndpointFail
in interface Endpoint
endpoint
- The child endpoint which caused the exception.synMessageContext
- MessageContext that was used in the failed attempt.public void executeEpTypeSpecificFunctions(MessageContext synCtx)
protected boolean isTimeout(MessageContext synCtx)
synCtx
- the current fault messageprotected boolean isRetry(MessageContext synCtx)
protected boolean isSuspendFault(MessageContext synCtx)
synCtx
- the current fault messagepublic void onFault(MessageContext synCtx)
onFault
in class FaultHandler
synCtx
- the message at handpublic void onSuccess()
protected boolean isTraceOn(MessageContext msgCtx)
msgCtx
- the current messageprotected boolean isTraceOrDebugOn(boolean isTraceOn)
isTraceOn
- is tracing known to be on?protected void traceOrDebug(boolean traceOn, java.lang.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(java.lang.String msg)
msg
- The error messageprotected void handleException(java.lang.String msg, java.lang.Exception e)
msg
- The error messagee
- The exceptionprotected void handleException(java.lang.String msg, java.lang.Exception e, MessageContext msgCtx)
msg
- The error messagee
- The exceptionmsgCtx
- The message contextprotected void logOnChildEndpointFail(Endpoint endpoint, MessageContext synMessageContext)
protected void informFailure(MessageContext synCtx, int errorCode, java.lang.String errorMsg)
protected void setErrorOnMessage(MessageContext synCtx, java.lang.Integer errorCode, java.lang.String errorMsg)
public void destroy()
ManagedLifecycle
destroy
in interface ManagedLifecycle
public void addProperty(MediatorProperty property)
addProperty
in interface PropertyInclude
property
- property to be addedpublic MediatorProperty getProperty(java.lang.String name)
getProperty
in interface PropertyInclude
name
- name of the propertypublic java.util.Collection<MediatorProperty> getProperties()
Collection
of properties specifiedgetProperties
in interface PropertyInclude
Collection
of propertiespublic MediatorProperty removeProperty(java.lang.String name)
removeProperty
in interface PropertyInclude
name
- name of the property to be removednull
if a property doesn't existspublic void addProperties(java.util.Collection<MediatorProperty> mediatorProperties)
addProperties
in interface PropertyInclude
mediatorProperties
- Collection
of properties to be addedpublic java.lang.String getErrorHandler()
Endpoint
getErrorHandler
in interface Endpoint
public void setErrorHandler(java.lang.String errorHandler)
Endpoint
setErrorHandler
in interface Endpoint
public void setContentAware(boolean contentAware)
public void setForceBuildMC(boolean forceBuildMC)
protected void evaluateProperties(MessageContext synCtx)
synCtx
- the current message contextpublic void logSetter()
public java.lang.String getReportingName()
public void setComponentStatisticsId(ArtifactHolder holder)
setComponentStatisticsId
in interface Endpoint
protected void setAdvancedProperties()
protected org.json.JSONArray getEndpointChildrenAsJson(java.util.List<Endpoint> children)
public org.json.JSONObject getJsonRepresentation()
Endpoint
getJsonRepresentation
in interface Endpoint
protected abstract void createJsonRepresentation()
Copyright © 2005-2020 Apache Software Foundation. All Rights Reserved.