Package org.apache.synapse.endpoints
Interface Endpoint
-
- All Superinterfaces:
ManagedLifecycle,Nameable,SynapseArtifact
- All Known Implementing Classes:
AbstractEndpoint,AddressEndpoint,BasicAuthConfiguredHTTPEndpoint,ClassEndpoint,DefaultEndpoint,DynamicLoadbalanceEndpoint,FailoverEndpoint,HTTPEndpoint,IndirectEndpoint,LoadbalanceEndpoint,OAuthConfiguredHTTPEndpoint,RecipientListEndpoint,ResolvingEndpoint,SALoadbalanceEndpoint,ServiceDynamicLoadbalanceEndpoint,TemplateEndpoint,WSDLEndpoint
public interface Endpoint extends ManagedLifecycle, SynapseArtifact, Nameable
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetArtifactContainerName()Get the Car File Name which this endpoint deployed fromList<Endpoint>getChildren()Get the children of this endpointEndpointContextgetContext()Get the EndpointContext that has the run-time state of this endpointStringgetErrorHandler()Get the MessageStore name associated with the EndpointStringgetFileName()Get the filename from which this endpoint is loaded,nullif it is an anonymous endpointbooleangetIsEdited()Get the edit state of the endpointorg.json.JSONObjectgetJsonRepresentation()Get the json representation of the endpoint.EndpointViewgetMetricsMBean()Get a reference to the metrics MBean for this endpointbooleanisInitialized()Has this Endpoint initialized?voidonChildEndpointFail(Endpoint endpoint, MessageContext synMessageContext)Endpoints that contain other endpoints should implement this method.voidonSuccess()An event notification whenever endpoint invocation is successful Can be used to clear a timeout status etcbooleanreadyToSend()Returns true to indicate that the endpoint is ready to service requestsvoidsend(MessageContext synMessageContext)Sends the message context according to an endpoint specific behavior.voidsetArtifactContainerName(String name)Set the name of the car file which this endpoint deployed fromvoidsetComponentStatisticsId(ArtifactHolder holder)voidsetErrorHandler(String onFaultMessageStore)Set the Message Store name associated with the EndpointvoidsetFileName(String fileName)Set the filename from which the endpoint is loadedvoidsetIsEdited(boolean isEdited)Set the edit state of the endpointvoidsetParentEndpoint(Endpoint parentEndpoint)Sets the parent endpoint for the current endpoint.-
Methods inherited from interface org.apache.synapse.ManagedLifecycle
destroy, init
-
Methods inherited from interface org.apache.synapse.SynapseArtifact
getDescription, setDescription
-
-
-
-
Method Detail
-
send
void send(MessageContext synMessageContext)
Sends the message context according to an endpoint specific behavior.- Parameters:
synMessageContext- MessageContext to be sent.
-
onChildEndpointFail
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.- Parameters:
endpoint- The child endpoint which caused the exception.synMessageContext- MessageContext that was used in the failed attempt.
-
setParentEndpoint
void setParentEndpoint(Endpoint parentEndpoint)
Sets the parent endpoint for the current endpoint.- Parameters:
parentEndpoint- parent endpoint containing this endpoint. It should handle the onChildEndpointFail(...) callback.
-
onSuccess
void onSuccess()
An event notification whenever endpoint invocation is successful Can be used to clear a timeout status etc
-
readyToSend
boolean readyToSend()
Returns true to indicate that the endpoint is ready to service requests- Returns:
- true if endpoint is ready to service requests
-
isInitialized
boolean isInitialized()
Has this Endpoint initialized?- Returns:
- true if the endpoint is initialized
-
getContext
EndpointContext getContext()
Get the EndpointContext that has the run-time state of this endpoint- Returns:
- the runtime context
-
getChildren
List<Endpoint> getChildren()
Get the children of this endpoint- Returns:
- the child endpoints
-
getMetricsMBean
EndpointView getMetricsMBean()
Get a reference to the metrics MBean for this endpoint- Returns:
- EndpointView instance
-
getFileName
String getFileName()
Get the filename from which this endpoint is loaded,nullif it is an anonymous endpoint- Returns:
- String file name
-
setFileName
void setFileName(String fileName)
Set the filename from which the endpoint is loaded- Parameters:
fileName- from which the endpoint is loaded
-
getErrorHandler
String getErrorHandler()
Get the MessageStore name associated with the Endpoint- Returns:
- String message store name
-
setErrorHandler
void setErrorHandler(String onFaultMessageStore)
Set the Message Store name associated with the Endpoint- Parameters:
onFaultMessageStore- , name of the message store
-
setArtifactContainerName
void setArtifactContainerName(String name)
Set the name of the car file which this endpoint deployed from
-
getArtifactContainerName
String getArtifactContainerName()
Get the Car File Name which this endpoint deployed from
-
getIsEdited
boolean getIsEdited()
Get the edit state of the endpoint- Returns:
-
setIsEdited
void setIsEdited(boolean isEdited)
Set the edit state of the endpoint- Parameters:
isEdited-
-
setComponentStatisticsId
void setComponentStatisticsId(ArtifactHolder holder)
-
getJsonRepresentation
org.json.JSONObject getJsonRepresentation()
Get the json representation of the endpoint.- Returns:
- JSONObject
-
-