Class AbstractMessageReceiver

java.lang.Object
org.apache.axis2.receivers.AbstractMessageReceiver
All Implemented Interfaces:
MessageReceiver
Direct Known Subclasses:
AbstractInMessageReceiver, AbstractInOutMessageReceiver, AbstractInOutSyncMessageReceiver, AbstractRobustInMessageReceiver

public abstract class AbstractMessageReceiver extends Object implements MessageReceiver
  • Field Details

  • Constructor Details

    • AbstractMessageReceiver

      public AbstractMessageReceiver()
  • Method Details

    • replicateState

      protected void replicateState(MessageContext messageContext) throws ClusteringFault
      Throws:
      ClusteringFault
    • invokeBusinessLogic

      protected abstract void invokeBusinessLogic(MessageContext messageCtx) throws AxisFault
      Do the actual work of the MessageReceiver. Must be overridden by concrete subclasses.
      Parameters:
      messageCtx - active MessageContext
      Throws:
      AxisFault - if a problem occurred
    • receive

      public void receive(MessageContext messageCtx) throws AxisFault
      Specified by:
      receive in interface MessageReceiver
      Parameters:
      messageCtx - active MessageContext
      Throws:
      AxisFault - if a problem occurred
    • setThreadContext

      protected AbstractMessageReceiver.ThreadContextDescriptor setThreadContext(MessageContext msgContext)
      Several pieces of information need to be available to the service implementation class. For one, the ThreadContextClassLoader needs to be correct, and for another we need to give the service code access to the MessageContext (getCurrentContext()). So we toss these things in TLS.
      Parameters:
      msgContext - the current MessageContext
      Returns:
      a ThreadContextDescriptor containing the old values
    • restoreThreadContext

      protected void restoreThreadContext(AbstractMessageReceiver.ThreadContextDescriptor tc)
    • makeNewServiceObject

      protected Object makeNewServiceObject(MessageContext msgContext) throws AxisFault
      Create a new service object. Override if you want to customize how this happens in your own MessageReceiver.
      Parameters:
      msgContext -
      Returns:
      Returns Object.
      Throws:
      AxisFault
    • getSOAPFactory

      public org.apache.axiom.soap.SOAPFactory getSOAPFactory(MessageContext msgContext) throws AxisFault
      Throws:
      AxisFault
    • getTheImplementationObject

      protected Object getTheImplementationObject(MessageContext msgContext) throws AxisFault
      Retrieve the implementation object. This will either return a cached object if present in the ServiceContext, or create a new one via makeNewServiceObject() (and then cache that).
      Parameters:
      msgContext - the active MessageContext
      Returns:
      the appropriate back-end service object.
      Throws:
      AxisFault - if there's a problem