org.apache.axis2.context
Class MessageContext

java.lang.Object
  extended byorg.apache.axis2.context.AbstractContext
      extended byorg.apache.axis2.context.MessageContext
All Implemented Interfaces:
java.io.Serializable

public class MessageContext
extends AbstractContext

The palce where all the service specific states are kept. All the Global states kept in the EngineRegistry and all the Service states kept in the MessageContext. Other runtime artifacts does not keep states foward from the execution.

See Also:
Serialized Form

Field Summary
static java.lang.String CHARACTER_SET_ENCODING
          Field CHARACTER_SET_ENCODING
static java.lang.String DEFAULT_CHAR_SET_ENCODING
          Field DEFAULT_CHAR_SET_ENCODING This is the default value for CHARACTER_SET_ENCODING property
 boolean outPutWritten
           
static java.lang.String TRANSPORT_HEADERS
           
static java.lang.String TRANSPORT_IN
          Field TRANSPORT_READER
static java.lang.String TRANSPORT_OUT
          Field TRANSPORT_WRITER
static java.lang.String TRANSPORT_SUCCEED
          Field TRANSPORT_SUCCEED
static java.lang.String UTF_16
          Field UTF_8 This is the 'utf-8' value for CHARACTER_SET_ENCODING property
static java.lang.String UTF_8
          Field UTF_8 This is the 'utf-8' value for CHARACTER_SET_ENCODING property
 
Fields inherited from class org.apache.axis2.context.AbstractContext
nonPersistentMap, parent, persistentMap
 
Constructor Summary
MessageContext(ConfigurationContext engineContext)
          Conveniance Method, but before call engine.send() or engine.receive() one must send transport in/out
MessageContext(ConfigurationContext engineContext, SessionContext sessionContext, TransportInDescription transportIn, TransportOutDescription transportOut)
           
MessageContext(ConfigurationContext engineContext, TransportInDescription transportIn, TransportOutDescription transportOut)
           
 
Method Summary
 SOAPEnvelope getEnvelope()
           
 EndpointReference getFaultTo()
           
 EndpointReference getFrom()
           
 java.lang.String getMessageID()
           
 MessageInformationHeaders getMessageInformationHeaders()
           
 Parameter getModuleParameter(java.lang.String key, java.lang.String moduleName, HandlerDescription handler)
          This method is to retrive both module configuration parameters and othere paramerts The searching procedure is as follows; 1.
 OperationContext getOperationContext()
           
 OperationDescription getOperationDescription()
           
 Parameter getParameter(java.lang.String key)
          To retrive configuration descriptor parameters , it is posible to get paramater specify at any levle via this method , and the preferance is as follows, 1.
 javax.xml.namespace.QName getPausedHandlerName()
           
 java.lang.String getPausedPhaseName()
           
 java.lang.Object getProperty(java.lang.String key, boolean persistent)
          To acess any property set at the run time , a handler can add property to wherever he wants to MesageContext , to OperationContext , to ServiceContext and to ConfigurationContext.
 RelatesTo getRelatesTo()
           
 EndpointReference getReplyTo()
           
 ServiceContext getServiceContext()
           
 java.lang.String getServiceContextID()
           
 ServiceDescription getServiceDescription()
           
 ServiceGroupContext getServiceGroupContext()
           
 java.lang.String getServiceGroupContextId()
           
 ServiceGroupDescription getServiceGroupDescription()
           
 SessionContext getSessionContext()
           
 java.lang.String getSoapAction()
           
 ConfigurationContext getSystemContext()
           
 EndpointReference getTo()
           
 TransportInDescription getTransportIn()
           
 TransportOutDescription getTransportOut()
           
 java.lang.String getWSAAction()
           
 java.lang.String getWSAMessageId()
           
 void init(AxisConfiguration axisConfiguration)
          The method is used to do the intialization of the EngineContext
 boolean isDoingMTOM()
           
 boolean isDoingREST()
           
 boolean isInFaultFlow()
           
 boolean isNewThreadRequired()
           
 boolean isOutPutWritten()
           
 boolean isPaused()
           
 boolean isProcessingFault()
           
 boolean isResponseWritten()
           
 boolean isRestThroughPOST()
           
 boolean isServerSide()
           
 boolean isSOAP11()
           
 void setConfigurationContext(ConfigurationContext context)
           
 void setDoingMTOM(boolean b)
           
 void setDoingREST(boolean b)
           
 void setEnvelope(SOAPEnvelope envelope)
           
 void setFaultTo(EndpointReference reference)
           
 void setFrom(EndpointReference reference)
           
 void setInFaultFlow(boolean b)
           
 void setMessageID(java.lang.String string)
           
 void setMessageInformationHeaders(MessageInformationHeaders collection)
           
 void setNewThreadRequired(boolean b)
           
 void setOperationContext(OperationContext context)
           
 void setOperationDescription(OperationDescription operationDescription)
           
 void setOutPutWritten(boolean b)
           
 void setPausedFalse()
           
 void setPausedPhaseName(java.lang.String name)
           
 void setPausedTrue(javax.xml.namespace.QName handlerName)
           
 void setProcessingFault(boolean b)
           
 void setRelatesTo(RelatesTo reference)
           
 void setReplyTo(EndpointReference referance)
           
 void setResponseWritten(boolean b)
           
 void setRestThroughPOST(boolean b)
           
 void setServerSide(boolean b)
           
 void setServiceContext(ServiceContext context)
           
 void setServiceContextID(java.lang.String serviceContextID)
           
 void setServiceDescription(ServiceDescription serviceDescription)
           
 void setServiceGroupContext(ServiceGroupContext serviceGroupContext)
           
 void setServiceGroupContextId(java.lang.String serviceGroupContextId)
           
 void setServiceGroupDescription(ServiceGroupDescription serviceGroupDescription)
           
 void setSoapAction(java.lang.String string)
           
 void setTo(EndpointReference referance)
           
 void setTransportIn(TransportInDescription in)
           
 void setTransportOut(TransportOutDescription out)
           
 void setWSAAction(java.lang.String actionURI)
          Method getExecutionChain
 void setWSAMessageId(java.lang.String messageID)
           
 
Methods inherited from class org.apache.axis2.context.AbstractContext
getNonPersistentMap, getParent, getPersistentMap, getProperty, setParent, setProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSPORT_HEADERS

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

TRANSPORT_OUT

public static final java.lang.String TRANSPORT_OUT
Field TRANSPORT_WRITER

See Also:
Constant Field Values

TRANSPORT_IN

public static final java.lang.String TRANSPORT_IN
Field TRANSPORT_READER

See Also:
Constant Field Values

CHARACTER_SET_ENCODING

public static final java.lang.String CHARACTER_SET_ENCODING
Field CHARACTER_SET_ENCODING

See Also:
Constant Field Values

UTF_8

public static final java.lang.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 java.lang.String UTF_16
Field UTF_8 This is the 'utf-8' value for CHARACTER_SET_ENCODING property

See Also:
Constant Field Values

DEFAULT_CHAR_SET_ENCODING

public static final java.lang.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

TRANSPORT_SUCCEED

public static final java.lang.String TRANSPORT_SUCCEED
Field TRANSPORT_SUCCEED

See Also:
Constant Field Values

outPutWritten

public boolean outPutWritten
Constructor Detail

MessageContext

public MessageContext(ConfigurationContext engineContext)
               throws AxisFault
Conveniance Method, but before call engine.send() or engine.receive() one must send transport in/out

Parameters:
engineContext -
Throws:
AxisFault

MessageContext

public MessageContext(ConfigurationContext engineContext,
                      TransportInDescription transportIn,
                      TransportOutDescription transportOut)
               throws AxisFault

MessageContext

public MessageContext(ConfigurationContext engineContext,
                      SessionContext sessionContext,
                      TransportInDescription transportIn,
                      TransportOutDescription transportOut)
               throws AxisFault
Parameters:
sessionContext -
transportIn -
transportOut -
Throws:
AxisFault
Method Detail

init

public void init(AxisConfiguration axisConfiguration)
          throws AxisFault
The method is used to do the intialization of the EngineContext

Specified by:
init in class AbstractContext
Throws:
AxisFault

getFaultTo

public EndpointReference getFaultTo()
Returns:

getFrom

public EndpointReference getFrom()
Returns:

isInFaultFlow

public boolean isInFaultFlow()
Returns:

getEnvelope

public SOAPEnvelope getEnvelope()
Returns:

getMessageID

public java.lang.String getMessageID()
Returns:

isProcessingFault

public boolean isProcessingFault()
Returns:

getRelatesTo

public RelatesTo getRelatesTo()
Returns:

getReplyTo

public EndpointReference getReplyTo()
Returns:

isResponseWritten

public boolean isResponseWritten()
Returns:

isServerSide

public boolean isServerSide()
Returns:

getSessionContext

public SessionContext getSessionContext()
Returns:

getTo

public EndpointReference getTo()
Returns:

setFaultTo

public void setFaultTo(EndpointReference reference)
Parameters:
reference -

setFrom

public void setFrom(EndpointReference reference)
Parameters:
reference -

setInFaultFlow

public void setInFaultFlow(boolean b)
Parameters:
b -

setEnvelope

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

setMessageID

public void setMessageID(java.lang.String string)
Parameters:
string -

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 -

setTo

public void setTo(EndpointReference referance)
Parameters:
referance -

isNewThreadRequired

public boolean isNewThreadRequired()
Returns:

setNewThreadRequired

public void setNewThreadRequired(boolean b)
Parameters:
b -

setWSAAction

public void setWSAAction(java.lang.String actionURI)
Method getExecutionChain


getWSAAction

public java.lang.String getWSAAction()

setWSAMessageId

public void setWSAMessageId(java.lang.String messageID)

getWSAMessageId

public java.lang.String getWSAMessageId()

getMessageInformationHeaders

public MessageInformationHeaders getMessageInformationHeaders()

isPaused

public boolean isPaused()
Returns:

setPausedTrue

public void setPausedTrue(javax.xml.namespace.QName handlerName)

setPausedFalse

public void setPausedFalse()

getTransportIn

public TransportInDescription getTransportIn()
Returns:

getTransportOut

public TransportOutDescription getTransportOut()
Returns:

setTransportIn

public void setTransportIn(TransportInDescription in)
Parameters:
in -

setTransportOut

public void setTransportOut(TransportOutDescription out)
Parameters:
out -

getOperationContext

public OperationContext getOperationContext()
Returns:

setOperationContext

public void setOperationContext(OperationContext context)
Parameters:
context -

isOutPutWritten

public boolean isOutPutWritten()
Returns:

setOutPutWritten

public void setOutPutWritten(boolean b)
Parameters:
b -

getServiceContextID

public java.lang.String getServiceContextID()
Returns:
Returns the serviceContextID.

setServiceContextID

public void setServiceContextID(java.lang.String serviceContextID)
Parameters:
serviceContextID - The serviceContextID to set.

getSystemContext

public ConfigurationContext getSystemContext()

getServiceContext

public ServiceContext getServiceContext()
Returns:

setConfigurationContext

public void setConfigurationContext(ConfigurationContext context)
Parameters:
context -

setServiceContext

public void setServiceContext(ServiceContext context)
Parameters:
context -

setMessageInformationHeaders

public void setMessageInformationHeaders(MessageInformationHeaders collection)
Parameters:
collection -

getParameter

public Parameter getParameter(java.lang.String key)
To retrive configuration descriptor parameters , it is posible to get paramater specify at any levle via this method , and the preferance is as follows, 1. Search in operation description if its there 2. if the paramter not found or operationContext is null will search in ServiceDescription 3. If the serviceDescription is null or , the paramter does not found will serach in AxisConfiguration

Parameters:
key -
Returns:
Paramter Paramter

getModuleParameter

public Parameter getModuleParameter(java.lang.String key,
                                    java.lang.String moduleName,
                                    HandlerDescription handler)
This method is to retrive both module configuration parameters and othere paramerts The searching procedure is as follows; 1. Search in module configurations inside corresponding operation descripton if its three 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 sercah in module configurations inside axisConfiguration 6. Search in AxisConfiguration for paramters 7. Next get the corresponding module and search for the paramters 8. Search in HandlerDescription for the paramter

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

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

getProperty

public java.lang.Object getProperty(java.lang.String key,
                                    boolean persistent)
To acess any property set at the run time , a handler can add property to wherever he wants to MesageContext , to OperationContext , to ServiceContext and to ConfigurationContext. This method is to retrive those properties NOT paramters

Overrides:
getProperty in class AbstractContext
Parameters:
key - : property Name
persistent - : need to be persistent even when server re-start
Returns:
Object

getPausedHandlerName

public javax.xml.namespace.QName getPausedHandlerName()
Returns:

getPausedPhaseName

public java.lang.String getPausedPhaseName()
Returns:

setPausedPhaseName

public void setPausedPhaseName(java.lang.String name)
Parameters:
name -

getSoapAction

public java.lang.String getSoapAction()
Returns:

setSoapAction

public void setSoapAction(java.lang.String string)
Parameters:
string -

isDoingMTOM

public boolean isDoingMTOM()
Returns:

setDoingMTOM

public void setDoingMTOM(boolean b)
Parameters:
b -

isDoingREST

public boolean isDoingREST()
Returns:

setDoingREST

public void setDoingREST(boolean b)
Parameters:
b -

setRestThroughPOST

public void setRestThroughPOST(boolean b)

isRestThroughPOST

public boolean isRestThroughPOST()

isSOAP11

public boolean isSOAP11()

getServiceGroupContext

public ServiceGroupContext getServiceGroupContext()

setServiceGroupContext

public void setServiceGroupContext(ServiceGroupContext serviceGroupContext)

getOperationDescription

public OperationDescription getOperationDescription()

setOperationDescription

public void setOperationDescription(OperationDescription operationDescription)

getServiceDescription

public ServiceDescription getServiceDescription()

setServiceDescription

public void setServiceDescription(ServiceDescription serviceDescription)

getServiceGroupDescription

public ServiceGroupDescription getServiceGroupDescription()

setServiceGroupDescription

public void setServiceGroupDescription(ServiceGroupDescription serviceGroupDescription)

getServiceGroupContextId

public java.lang.String getServiceGroupContextId()

setServiceGroupContextId

public void setServiceGroupContextId(java.lang.String serviceGroupContextId)