Package org.apache.synapse.core.axis2
Class SynapseCallbackReceiver
- java.lang.Object
-
- org.apache.axis2.util.CallbackReceiver
-
- org.apache.synapse.core.axis2.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 Summary
Constructors Constructor Description SynapseCallbackReceiver(SynapseConfiguration synCfg, ServerContextInformation contextInformation)
Create the *single* instance of this class that would be used by all anonymous services used for outgoing messaging.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCallback(String MsgID, org.apache.axis2.client.async.AxisCallback callback)
int
getCallbackCount()
void
receive(org.apache.axis2.context.MessageContext messageCtx)
Everytime a response message is received this method gets invoked.
-
-
-
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 configurationcontextInformation
- 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 classorg.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 interfaceorg.apache.axis2.engine.MessageReceiver
- Overrides:
receive
in classorg.apache.axis2.util.CallbackReceiver
- Parameters:
messageCtx
- the Axis2 message context of the reply received- Throws:
org.apache.axis2.AxisFault
-
-