org.apache.axis2.receivers
Class AbstractMessageReceiver

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

public abstract class AbstractMessageReceiver
extends java.lang.Object
implements MessageReceiver


Nested Class Summary
 class AbstractMessageReceiver.AsyncMessageReceiverWorker
           
static class AbstractMessageReceiver.ThreadContextDescriptor
           
 
Field Summary
static java.lang.String DO_ASYNC
           
protected static org.apache.commons.logging.Log log
           
static java.lang.String SAVED_MC
           
static java.lang.String SAVED_TCCL
           
static java.lang.String SCOPE
           
protected  java.lang.String serviceTCCL
           
 
Constructor Summary
AbstractMessageReceiver()
           
 
Method Summary
 org.apache.axiom.soap.SOAPFactory getSOAPFactory(MessageContext msgContext)
           
protected  java.lang.Object getTheImplementationObject(MessageContext msgContext)
          Retrieve the implementation object.
protected abstract  void invokeBusinessLogic(MessageContext messageCtx)
          Do the actual work of the MessageReceiver.
protected  java.lang.Object makeNewServiceObject(MessageContext msgContext)
          Create a new service object.
 void receive(MessageContext messageCtx)
           
protected  void replicateState(MessageContext messageContext)
           
protected  void restoreThreadContext(AbstractMessageReceiver.ThreadContextDescriptor tc)
           
protected  AbstractMessageReceiver.ThreadContextDescriptor setThreadContext(MessageContext msgContext)
          Several pieces of information need to be available to the service implementation class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

SCOPE

public static final java.lang.String SCOPE
See Also:
Constant Field Values

serviceTCCL

protected java.lang.String serviceTCCL

SAVED_TCCL

public static final java.lang.String SAVED_TCCL
See Also:
Constant Field Values

SAVED_MC

public static final java.lang.String SAVED_MC
See Also:
Constant Field Values

DO_ASYNC

public static final java.lang.String DO_ASYNC
See Also:
Constant Field Values
Constructor Detail

AbstractMessageReceiver

public AbstractMessageReceiver()
Method Detail

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 java.lang.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 java.lang.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


Copyright © 2007 Apache Web Services Project. All Rights Reserved.