Class 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 the ContinuationState 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.

    • Constructor Detail

      • CallMediator

        public CallMediator()
    • 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
        Specified by:
        mediate in interface Mediator
        Parameters:
        synInCtx - the current message to be sent
        Returns:
        false for in-out invocations as flow should put on to hold after the Call mediator, true for out only invocations
      • 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 interface ManagedLifecycle
        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 interface ManagedLifecycle
      • 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 interface Mediator
        Overrides:
        isContentAware in class AbstractMediator
      • 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)
      • 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)