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 theContinuationState
which 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 String
DEFAULT_AXIS2_XML
static String
DEFAULT_CLIENT_REPO
static String
INTERMEDIATE_ORIGINAL_BODY
static String
IS_SOURCE_AVAILABLE
static String
IS_TARGET_AVAILABLE
static String
JSON_TYPE
static String
ORIGINAL_CONTENT_TYPE
static String
ORIGINAL_MESSAGE_TYPE
static String
ORIGINAL_TRANSPORT_HEADERS
static String
SOURCE_MESSAGE_TYPE
static String
TARGET_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 void
destroy()
This method should implement the destroying of the implemented parts of the configuration.String
getAxis2xml()
String
getClientRepository()
Endpoint
getEndpoint()
boolean
getInitClientOptions()
Source
getSourceForOutboundPayload()
String
getSourceMessageType()
Target
getTargetForInboundPayload()
void
init(SynapseEnvironment synapseEnvironment)
This method should implement the initialization of the implemented parts of the configuration.boolean
isBlocking()
boolean
isContentAware()
Setting return blocking makes CallMediator access the message’s content in blocking mode when mediating messages Fixes product-ei #1805, #3015boolean
isSourceAvailable()
boolean
isTargetAvailable()
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 parametersvoid
postMediate(MessageContext response, String originalMessageType, String originalContentType, Map originalTransportHeaders)
void
setAxis2xml(String axis2xml)
void
setBlocking(boolean blocking)
void
setClientRepository(String clientRepository)
void
setComponentStatisticsId(ArtifactHolder holder)
void
setEndpoint(Endpoint endpoint)
void
setInitClientOptions(boolean initClientOptions)
void
setSourceAvailable(boolean sourceAvailable)
void
setSourceForOutboundPayload(Source sourceForOutboundPayload)
void
setSourceMessageType(String sourceMessageType)
void
setTargetAvailable(boolean targetAvailable)
void
setTargetForInboundPayload(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:ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.- Specified by:
init
in interfaceManagedLifecycle
- Parameters:
synapseEnvironment
- SynapseEnvironment to be used for initialization
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in 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:
isContentAware
in interfaceMediator
- Overrides:
isContentAware
in 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:
setComponentStatisticsId
in interfaceMediator
- Overrides:
setComponentStatisticsId
in 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)
-
-