Class CallMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.builtin.CallMediator
-
- All Implemented Interfaces:
AspectConfigurable,ManagedLifecycle,Mediator,SynapseArtifact
public class CallMediator extends AbstractMediator implements ManagedLifecycle
Call Mediator sends a message using specified semantics. If it contains an endpoint it will send the message to that endpoint. Once a message is sent to the endpoint further sending behaviors are completely governed by that endpoint. If there is no endpoint available, CallMediator will send the message to the implicitly stated destination. Even though Call mediator leverages the non-blocking transports which is same as Send mediator, response will be mediated from the next mediator placed after the Call mediator. Behaviour is very much same as the Callout Mediator. So Call mediator can be considered as a non-blocking Callout mediator. To implement this behaviour, important states in the mediation flow is stored in the message context. An important state in the mediation flow is represented by theContinuationStatewhich are stored in the ContinuationStateStack which resides in the MessageContext. These ContinuationStates are used to mediate the response message and continue the message flow.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_AXIS2_XMLstatic StringDEFAULT_CLIENT_REPOstatic StringINTERMEDIATE_ORIGINAL_BODYstatic StringIS_SOURCE_AVAILABLEstatic StringIS_TARGET_AVAILABLEstatic StringJSON_TYPEstatic StringORIGINAL_CONTENT_TYPEstatic StringORIGINAL_MESSAGE_TYPEstatic StringORIGINAL_TRANSPORT_HEADERSstatic StringSOURCE_MESSAGE_TYPEstatic StringTARGET_FOR_INBOUND_PAYLOAD-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description CallMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()This method should implement the destroying of the implemented parts of the configuration.StringgetAxis2xml()StringgetClientRepository()EndpointgetEndpoint()booleangetInitClientOptions()SourcegetSourceForOutboundPayload()StringgetSourceMessageType()TargetgetTargetForInboundPayload()voidinit(SynapseEnvironment synapseEnvironment)This method should implement the initialization of the implemented parts of the configuration.booleanisBlocking()booleanisContentAware()Setting return blocking makes CallMediator access the message’s content in blocking mode when mediating messages Fixes product-ei #1805, #3015booleanisSourceAvailable()booleanisTargetAvailable()booleanmediate(MessageContext synInCtx)This will call the send method on the messages with implicit message parameters or else if there is an endpoint, with that endpoint parametersvoidpostMediate(MessageContext response, String originalMessageType, String originalContentType, Map originalTransportHeaders)voidsetAxis2xml(String axis2xml)voidsetBlocking(boolean blocking)voidsetClientRepository(String clientRepository)voidsetComponentStatisticsId(ArtifactHolder holder)voidsetEndpoint(Endpoint endpoint)voidsetInitClientOptions(boolean initClientOptions)voidsetSourceAvailable(boolean sourceAvailable)voidsetSourceForOutboundPayload(Source sourceForOutboundPayload)voidsetSourceMessageType(String sourceMessageType)voidsetTargetAvailable(boolean targetAvailable)voidsetTargetForInboundPayload(Target targetForInboundPayload)-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Field Detail
-
DEFAULT_CLIENT_REPO
public static final String DEFAULT_CLIENT_REPO
- See Also:
- Constant Field Values
-
DEFAULT_AXIS2_XML
public static final String DEFAULT_AXIS2_XML
-
INTERMEDIATE_ORIGINAL_BODY
public static final String INTERMEDIATE_ORIGINAL_BODY
- See Also:
- Constant Field Values
-
TARGET_FOR_INBOUND_PAYLOAD
public static final String TARGET_FOR_INBOUND_PAYLOAD
- See Also:
- Constant Field Values
-
ORIGINAL_MESSAGE_TYPE
public static final String ORIGINAL_MESSAGE_TYPE
- See Also:
- Constant Field Values
-
SOURCE_MESSAGE_TYPE
public static final String SOURCE_MESSAGE_TYPE
- See Also:
- Constant Field Values
-
IS_SOURCE_AVAILABLE
public static final String IS_SOURCE_AVAILABLE
- See Also:
- Constant Field Values
-
IS_TARGET_AVAILABLE
public static final String IS_TARGET_AVAILABLE
- See Also:
- Constant Field Values
-
ORIGINAL_TRANSPORT_HEADERS
public static final String ORIGINAL_TRANSPORT_HEADERS
- See Also:
- Constant Field Values
-
ORIGINAL_CONTENT_TYPE
public static final String ORIGINAL_CONTENT_TYPE
- See Also:
- Constant Field Values
-
JSON_TYPE
public static final String JSON_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
mediate
public boolean mediate(MessageContext synInCtx)
This will call the send method on the messages with implicit message parameters or else if there is an endpoint, with that endpoint parameters
-
postMediate
public void postMediate(MessageContext response, String originalMessageType, String originalContentType, Map originalTransportHeaders)
-
getEndpoint
public Endpoint getEndpoint()
-
setEndpoint
public void setEndpoint(Endpoint endpoint)
-
init
public void init(SynapseEnvironment synapseEnvironment)
Description copied from interface:ManagedLifecycleThis method should implement the initialization of the implemented parts of the configuration.- Specified by:
initin interfaceManagedLifecycle- Parameters:
synapseEnvironment- SynapseEnvironment to be used for initialization
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycleThis method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroyin interfaceManagedLifecycle
-
isContentAware
public boolean isContentAware()
Setting return blocking makes CallMediator access the message’s content in blocking mode when mediating messages Fixes product-ei #1805, #3015- Specified by:
isContentAwarein interfaceMediator- Overrides:
isContentAwarein classAbstractMediator
-
isBlocking
public boolean isBlocking()
-
setBlocking
public void setBlocking(boolean blocking)
-
getInitClientOptions
public boolean getInitClientOptions()
-
setInitClientOptions
public void setInitClientOptions(boolean initClientOptions)
-
getClientRepository
public String getClientRepository()
-
setClientRepository
public void setClientRepository(String clientRepository)
-
getAxis2xml
public String getAxis2xml()
-
setAxis2xml
public void setAxis2xml(String axis2xml)
-
setComponentStatisticsId
public void setComponentStatisticsId(ArtifactHolder holder)
- Specified by:
setComponentStatisticsIdin interfaceMediator- Overrides:
setComponentStatisticsIdin classAbstractMediator
-
isSourceAvailable
public boolean isSourceAvailable()
-
setSourceAvailable
public void setSourceAvailable(boolean sourceAvailable)
-
isTargetAvailable
public boolean isTargetAvailable()
-
setTargetAvailable
public void setTargetAvailable(boolean targetAvailable)
-
getSourceForOutboundPayload
public Source getSourceForOutboundPayload()
-
setSourceForOutboundPayload
public void setSourceForOutboundPayload(Source sourceForOutboundPayload)
-
getTargetForInboundPayload
public Target getTargetForInboundPayload()
-
setTargetForInboundPayload
public void setTargetForInboundPayload(Target targetForInboundPayload)
-
getSourceMessageType
public String getSourceMessageType()
-
setSourceMessageType
public void setSourceMessageType(String sourceMessageType)
-
-