org.apache.axis2.context
Class MessageContext

java.lang.Object
  extended byorg.apache.axis2.context.AbstractContext
      extended byorg.apache.axis2.context.MessageContext

public class MessageContext
extends AbstractContext

MessageContext holds service specific state information.


Field Summary
static String CHARACTER_SET_ENCODING
          Field CHARACTER_SET_ENCODING
static String DEFAULT_CHAR_SET_ENCODING
          Field DEFAULT_CHAR_SET_ENCODING.
 int FLOW
           
static int IN_FLOW
           
protected  Options options
           
static int OUT_FLOW
           
 boolean outputWritten
           
static String TRANSPORT_HEADERS
           
static String TRANSPORT_IN
          Field TRANSPORT_IN
static String TRANSPORT_OUT
          Field TRANSPORT_OUT
static String TRANSPORT_SUCCEED
          Field TRANSPORT_SUCCEED
static String UTF_16
          Field UTF_16.
static String UTF_8
          Field UTF_8.
 
Fields inherited from class org.apache.axis2.context.AbstractContext
lastTouchedTime, parent, properties
 
Constructor Summary
MessageContext()
           
 
Method Summary
 AxisOperation getAxisOperation()
           
 AxisService getAxisService()
           
 AxisServiceGroup getAxisServiceGroup()
           
 ConfigurationContext getConfigurationContext()
           
 int getCurrentHandlerIndex()
           
 int getCurrentPhaseIndex()
           
 SOAPEnvelope getEnvelope()
           
 ArrayList getExecutionChain()
           
 EndpointReference getFaultTo()
           
 int getFLOW()
           
 EndpointReference getFrom()
           
 String getMessageID()
           
 Parameter getModuleParameter(String key, String moduleName, HandlerDescription handler)
          Retrieves both module specific configuration parameters as well as other parameters.
 OperationContext getOperationContext()
           
 Options getOptions()
           
 Parameter getParameter(String key)
          Retrieves configuration descriptor parameters at any level.
 Object getProperty(String name)
          Retrieves a property value.
 RelatesTo getRelatesTo()
           
 EndpointReference getReplyTo()
           
 ServiceContext getServiceContext()
           
 String getServiceContextID()
           
 ServiceGroupContext getServiceGroupContext()
           
 String getServiceGroupContextId()
           
 SessionContext getSessionContext()
           
 String getSoapAction()
           
 EndpointReference getTo()
           
 TransportInDescription getTransportIn()
           
 TransportOutDescription getTransportOut()
           
 String getWSAAction()
           
 boolean isDoingMTOM()
           
 boolean isDoingREST()
           
 boolean isNewThreadRequired()
           
 boolean isOutputWritten()
           
 boolean isPaused()
           
 boolean isProcessingFault()
           
 boolean isResponseWritten()
           
 boolean isServerSide()
           
 boolean isSOAP11()
           
 void pause()
          Pause the execution of the current handler chain
 void setAxisOperation(AxisOperation axisOperation)
           
 void setAxisService(AxisService axisService)
           
 void setAxisServiceGroup(AxisServiceGroup axisServiceGroup)
           
 void setConfigurationContext(ConfigurationContext context)
           
 void setCurrentHandlerIndex(int currentHandlerIndex)
           
 void setCurrentPhaseIndex(int currentPhaseIndex)
           
 void setDoingMTOM(boolean b)
           
 void setDoingREST(boolean b)
           
 void setEnvelope(SOAPEnvelope envelope)
           
 void setExecutionChain(ArrayList executionChain)
          Set the execution chain of Handler in this MessageContext.
 void setFaultTo(EndpointReference reference)
           
 void setFLOW(int FLOW)
           
 void setFrom(EndpointReference reference)
           
 void setMessageID(String messageId)
           
 void setNewThreadRequired(boolean b)
           
 void setOperationContext(OperationContext context)
           
 void setOptions(Options options)
          Set the options for myself.
 void setOutputWritten(boolean b)
           
 void setPaused(boolean paused)
           
 void setProcessingFault(boolean b)
           
 void setProperty(String name, Object value)
          Set a property for this message context.
 void setRelatesTo(RelatesTo reference)
           
 void setReplyTo(EndpointReference referance)
           
 void setResponseWritten(boolean b)
           
 void setServerSide(boolean b)
           
 void setServiceContext(ServiceContext context)
           
 void setServiceContextID(String serviceContextID)
          Sets the service context id.
 void setServiceGroupContext(ServiceGroupContext serviceGroupContext)
           
 void setServiceGroupContextId(String serviceGroupContextId)
           
 void setSessionContext(SessionContext sessionContext)
           
 void setSoapAction(String soapAction)
           
 void setTo(EndpointReference referance)
           
 void setTransportIn(TransportInDescription in)
           
 void setTransportOut(TransportOutDescription out)
           
 void setWSAAction(String actionURI)
          Method getExecutionChain
 void setWSAMessageId(String messageID)
           
 
Methods inherited from class org.apache.axis2.context.AbstractContext
getLastTouchedTime, getParent, getProperties, setParent, setProperties, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

protected Options options

IN_FLOW

public static final int IN_FLOW
See Also:
Constant Field Values

OUT_FLOW

public static final int OUT_FLOW
See Also:
Constant Field Values

TRANSPORT_HEADERS

public static final String TRANSPORT_HEADERS
See Also:
Constant Field Values

TRANSPORT_OUT

public static final String TRANSPORT_OUT
Field TRANSPORT_OUT

See Also:
Constant Field Values

TRANSPORT_IN

public static final String TRANSPORT_IN
Field TRANSPORT_IN

See Also:
Constant Field Values

CHARACTER_SET_ENCODING

public static final String CHARACTER_SET_ENCODING
Field CHARACTER_SET_ENCODING

See Also:
Constant Field Values

UTF_8

public static final String UTF_8
Field UTF_8. This is the 'utf-8' value for CHARACTER_SET_ENCODING property.

See Also:
Constant Field Values

UTF_16

public static final String UTF_16
Field UTF_16. This is the 'utf-16' value for CHARACTER_SET_ENCODING property.

See Also:
Constant Field Values

TRANSPORT_SUCCEED

public static final String TRANSPORT_SUCCEED
Field TRANSPORT_SUCCEED

See Also:
Constant Field Values

DEFAULT_CHAR_SET_ENCODING

public static final String DEFAULT_CHAR_SET_ENCODING
Field DEFAULT_CHAR_SET_ENCODING. This is the default value for CHARACTER_SET_ENCODING property.

See Also:
Constant Field Values

FLOW

public int FLOW

outputWritten

public boolean outputWritten
Constructor Detail

MessageContext

public MessageContext()
Method Detail

pause

public void pause()
Pause the execution of the current handler chain


getAxisOperation

public AxisOperation getAxisOperation()

getAxisService

public AxisService getAxisService()

getAxisServiceGroup

public AxisServiceGroup getAxisServiceGroup()

getConfigurationContext

public ConfigurationContext getConfigurationContext()

getCurrentHandlerIndex

public int getCurrentHandlerIndex()

getCurrentPhaseIndex

public int getCurrentPhaseIndex()

getEnvelope

public SOAPEnvelope getEnvelope()
Returns:
Returns SOAPEnvelope.

getExecutionChain

public ArrayList getExecutionChain()

getFaultTo

public EndpointReference getFaultTo()
Returns:
Returns EndpointReference.

getFrom

public EndpointReference getFrom()
Returns:
Returns EndpointReference.

getMessageID

public String getMessageID()
Returns:
Returns message id.

getModuleParameter

public Parameter getModuleParameter(String key,
                                    String moduleName,
                                    HandlerDescription handler)
Retrieves both module specific configuration parameters as well as other parameters. The order of search is as follows:
  1. Search in module configurations inside corresponding operation descripton if its there
  2. Search in corresponding operation if its there
  3. Search in module configurations inside corresponding service description if its there
  4. Next search in Corresponding Service description if its there
  5. Next search in module configurations inside axisConfiguration
  6. Search in AxisConfiguration for parameters
  7. Next get the corresponding module and search for the parameters
  8. Search in HandlerDescription for the parameter

and the way of specifing module configuration is as follows N/A

Parameters:
key - : Parameter Name
moduleName - : Name of the module
handler - HandlerDescription
Returns:
Parameter Parameter

getOperationContext

public OperationContext getOperationContext()

getParameter

public Parameter getParameter(String key)
Retrieves configuration descriptor parameters at any level. The order of search is as follows:
  1. Search in operation description if it exists
  2. If parameter is not found or if operationContext is null, search in AxisService
  3. If parameter is not found or if axisService is null, search in AxisConfiguration

Parameters:
key -
Returns:
Parameter Parameter

setProperty

public void setProperty(String name,
                        Object value)
Set a property for this message context.

Overrides:
setProperty in class AbstractContext
Parameters:
name - name of the property
value - the value to set

getProperty

public Object getProperty(String name)
Retrieves a property value. The order of search is as follows: search in my own options and then look in my context hierarchy. Since its possible that the entire hierarchy is not present, I will start at whatever level has been set and start there.

Overrides:
getProperty in class AbstractContext
Parameters:
name - name of the property to search for
Returns:
the value of the property, or null if the property is not found

getRelatesTo

public RelatesTo getRelatesTo()
Returns:
Returns RelatesTo.

getReplyTo

public EndpointReference getReplyTo()
Returns:
Returns EndpointReference.

getServiceContext

public ServiceContext getServiceContext()
Returns:
Returns ServiceContext.

getServiceContextID

public String getServiceContextID()
Returns:
Returns the serviceContextID.

getServiceGroupContext

public ServiceGroupContext getServiceGroupContext()

getServiceGroupContextId

public String getServiceGroupContextId()

getSessionContext

public SessionContext getSessionContext()
Returns:
Returns SessionContext.

setSessionContext

public void setSessionContext(SessionContext sessionContext)

getSoapAction

public String getSoapAction()
Returns:
Returns soap action.

getTo

public EndpointReference getTo()
Returns:
Returns EndpointReference.

getTransportIn

public TransportInDescription getTransportIn()
Returns:
Returns TransportInDescription.

getTransportOut

public TransportOutDescription getTransportOut()
Returns:
Returns TransportOutDescription.

getWSAAction

public String getWSAAction()

isDoingMTOM

public boolean isDoingMTOM()
Returns:
Returns boolean.

isDoingREST

public boolean isDoingREST()
Returns:
Returns boolean.

isNewThreadRequired

public boolean isNewThreadRequired()
Returns:
Returns boolean.

isOutputWritten

public boolean isOutputWritten()
Returns:
Returns boolean.

isPaused

public boolean isPaused()
Returns:
Returns boolean.

setPaused

public void setPaused(boolean paused)

isProcessingFault

public boolean isProcessingFault()
Returns:
Returns boolean.

isResponseWritten

public boolean isResponseWritten()
Returns:
Returns boolean.

isSOAP11

public boolean isSOAP11()

isServerSide

public boolean isServerSide()
Returns:
Returns boolean.

setAxisOperation

public void setAxisOperation(AxisOperation axisOperation)

setAxisService

public void setAxisService(AxisService axisService)

setAxisServiceGroup

public void setAxisServiceGroup(AxisServiceGroup axisServiceGroup)

setConfigurationContext

public void setConfigurationContext(ConfigurationContext context)
Parameters:
context -

setCurrentHandlerIndex

public void setCurrentHandlerIndex(int currentHandlerIndex)

setCurrentPhaseIndex

public void setCurrentPhaseIndex(int currentPhaseIndex)

setDoingMTOM

public void setDoingMTOM(boolean b)
Parameters:
b -

setDoingREST

public void setDoingREST(boolean b)
Parameters:
b -

setEnvelope

public void setEnvelope(SOAPEnvelope envelope)
                 throws AxisFault
Parameters:
envelope -
Throws:
AxisFault

setExecutionChain

public void setExecutionChain(ArrayList executionChain)
Set the execution chain of Handler in this MessageContext. Doing this causes the current handler/phase indexes to reset to 0, since we have new Handlers to execute (this usually only happens at initialization and when a fault occurs).

Parameters:
executionChain -

setFaultTo

public void setFaultTo(EndpointReference reference)
Parameters:
reference -

setFrom

public void setFrom(EndpointReference reference)
Parameters:
reference -

setMessageID

public void setMessageID(String messageId)
Parameters:
messageId -

setNewThreadRequired

public void setNewThreadRequired(boolean b)
Parameters:
b -

setOperationContext

public void setOperationContext(OperationContext context)
Parameters:
context -

setOutputWritten

public void setOutputWritten(boolean b)
Parameters:
b -

setProcessingFault

public void setProcessingFault(boolean b)
Parameters:
b -

setRelatesTo

public void setRelatesTo(RelatesTo reference)
Parameters:
reference -

setReplyTo

public void setReplyTo(EndpointReference referance)
Parameters:
referance -

setResponseWritten

public void setResponseWritten(boolean b)
Parameters:
b -

setServerSide

public void setServerSide(boolean b)
Parameters:
b -

setServiceContext

public void setServiceContext(ServiceContext context)
Parameters:
context -

setServiceContextID

public void setServiceContextID(String serviceContextID)
Sets the service context id.

Parameters:
serviceContextID -

setServiceGroupContext

public void setServiceGroupContext(ServiceGroupContext serviceGroupContext)

setServiceGroupContextId

public void setServiceGroupContextId(String serviceGroupContextId)

setSoapAction

public void setSoapAction(String soapAction)
Parameters:
soapAction -

setTo

public void setTo(EndpointReference referance)
Parameters:
referance -

setTransportIn

public void setTransportIn(TransportInDescription in)
Parameters:
in -

setTransportOut

public void setTransportOut(TransportOutDescription out)
Parameters:
out -

setWSAAction

public void setWSAAction(String actionURI)
Method getExecutionChain


setWSAMessageId

public void setWSAMessageId(String messageID)

getFLOW

public int getFLOW()

setFLOW

public void setFLOW(int FLOW)

getOptions

public Options getOptions()

setOptions

public void setOptions(Options options)
Set the options for myself. I make the given options my own options' parent so that that becomes the default. That allows the user to override specific options on a given message context and not affect the overall options.

Parameters:
options - the options to set