Class SynapseCallbackReceiver

  • All Implemented Interfaces:
    org.apache.axis2.engine.MessageReceiver

    public class SynapseCallbackReceiver
    extends org.apache.axis2.util.CallbackReceiver
    This is the message receiver that receives the responses for outgoing messages sent out by Synapse. It holds a callbackStore that maps the [unique] messageID of each message to a callback object that gets executed on timeout or when a response is received (before timeout) The AnonymousServiceFactory uses this MessageReceiver for all Anonymous services created by it. This however - effectively - is a singleton class
    • Constructor Detail

      • SynapseCallbackReceiver

        public SynapseCallbackReceiver​(SynapseConfiguration synCfg,
                                       ServerContextInformation contextInformation)
        Create the *single* instance of this class that would be used by all anonymous services used for outgoing messaging.
        Parameters:
        synCfg - the Synapse configuration
        contextInformation - server runtime information
    • Method Detail

      • getCallbackCount

        public int getCallbackCount()
      • addCallback

        public void addCallback​(String MsgID,
                                org.apache.axis2.client.async.AxisCallback callback)
        Overrides:
        addCallback in class org.apache.axis2.util.CallbackReceiver
      • receive

        public void receive​(org.apache.axis2.context.MessageContext messageCtx)
                     throws org.apache.axis2.AxisFault
        Everytime a response message is received this method gets invoked. It will then select the outgoing *Synapse* message context for the reply we received, and determine what action to take at the Synapse level
        Specified by:
        receive in interface org.apache.axis2.engine.MessageReceiver
        Overrides:
        receive in class org.apache.axis2.util.CallbackReceiver
        Parameters:
        messageCtx - the Axis2 message context of the reply received
        Throws:
        org.apache.axis2.AxisFault