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.Externalizable, java.io.Serializable

public class MessageContext
extends AbstractContext
implements java.io.Externalizable

MessageContext holds service specific state information.

See Also:
Serialized Form

Field Summary
 org.apache.axiom.attachments.Attachments attachments
          message attachments NOTE: Serialization of message attachments is handled as part of the overall message serialization.
static java.lang.String CHARACTER_SET_ENCODING
          Field CHARACTER_SET_ENCODING
static java.lang.ThreadLocal currentMessageContext
          A place to store the current MessageContext
static java.lang.String DEFAULT_CHAR_SET_ENCODING
          Field DEFAULT_CHAR_SET_ENCODING.
static java.lang.String DISABLE_ASYNC_CALLBACK_ON_TRANSPORT_ERROR
          This property allows someone (e.g.
 int FLOW
           
static int IN_FAULT_FLOW
           
static int IN_FLOW
           
protected  Options options
           
static int OUT_FAULT_FLOW
           
static int OUT_FLOW
           
 boolean outputWritten
           
static java.lang.String REMOTE_ADDR
           
static java.lang.String TRANSPORT_ADDR
           
static java.lang.String TRANSPORT_HEADERS
           
static java.lang.String TRANSPORT_IN
          Field TRANSPORT_IN
static java.lang.String TRANSPORT_NON_BLOCKING
          To invoke fireAndforget method we have to hand over transport sending logic to a thread other wise user has to wait till it get transport response (in the case of HTTP its HTTP 202)
static java.lang.String TRANSPORT_OUT
          Field TRANSPORT_OUT
static java.lang.String TRANSPORT_SUCCEED
          Field TRANSPORT_SUCCEED
static java.lang.String UTF_16
          Field UTF_16.
static java.lang.String UTF_8
          Field UTF_8.
 
Fields inherited from class org.apache.axis2.context.AbstractContext
COPY_PROPERTIES, lastTouchedTime, parent, properties
 
Constructor Summary
MessageContext()
          Constructor
 
Method Summary
 void activate(ConfigurationContext cc)
          This method checks to see if additional work needs to be done in order to complete the object reconstitution.
 void activateWithOperationContext(OperationContext operationCtx)
          This method checks to see if additional work needs to be done in order to complete the object reconstitution.
 java.lang.String addAttachment(javax.activation.DataHandler dataHandler)
          Adds an attachment to the attachment Map of this message context.
 void addAttachment(java.lang.String contentID, javax.activation.DataHandler dataHandler)
          Adds an attachment to the attachment Map of this message context.
 void addInboundExecutedPhase(Handler phase)
          Add a Phase to the collection of executed phases for the inbound path.
 void addOutboundExecutedPhase(Handler phase)
          Add a Phase to the collection of executed phases for the outbound path.
 void addRelatesTo(RelatesTo reference)
           
 boolean containsSelfManagedDataKey(java.lang.Class clazz, java.lang.Object key)
          Check to see if the key for the self managed data is available
 MessageContext extractCopyMessageContext()
          Return a Read-Only copy of this message context that has been extracted from the object hierachy.
 javax.activation.DataHandler getAttachment(java.lang.String contentID)
          Access the DataHandler of the attachment contained in the map corresponding to the given content ID.
 org.apache.axiom.attachments.Attachments getAttachmentMap()
          You can directly access the attachment map of the message context from here.
 AxisMessage getAxisMessage()
           
 AxisOperation getAxisOperation()
           
 AxisService getAxisService()
           
 AxisServiceGroup getAxisServiceGroup()
           
 ConfigurationContext getConfigurationContext()
           
 int getCurrentHandlerIndex()
           
static MessageContext getCurrentMessageContext()
           
 int getCurrentPhaseIndex()
           
 org.apache.neethi.Policy getEffectivePolicy()
           
 org.apache.axiom.soap.SOAPEnvelope getEnvelope()
           
 java.util.ArrayList getExecutionChain()
           
 EndpointReference getFaultTo()
           
 int getFLOW()
           
 EndpointReference getFrom()
           
 java.util.Iterator getInboundExecutedPhases()
          Get an iterator over the inbound executed phase list.
 java.lang.String getIncomingTransportName()
           
 java.lang.String getLogCorrelationID()
          Get a "raw" version of the logCorrelationID.
 java.lang.String getLogIDString()
          Get a formatted version of the logCorrelationID.
 java.lang.String getMessageID()
           
 Parameter getModuleParameter(java.lang.String key, java.lang.String moduleName, HandlerDescription handler)
          Retrieves both module specific configuration parameters as well as other parameters.
 OperationContext getOperationContext()
           
 Options getOptions()
           
 java.util.Iterator getOutboundExecutedPhases()
          Get an iterator over the outbound executed phase list.
 Parameter getParameter(java.lang.String key)
          Retrieves configuration descriptor parameters at any level.
 java.util.Map getProperties()
          Retrieves all property values.
 java.lang.Object getProperty(java.lang.String name)
          Retrieves a property value.
 RelatesTo getRelatesTo()
           
 RelatesTo getRelatesTo(java.lang.String type)
           
 RelatesTo[] getRelationships()
           
 EndpointReference getReplyTo()
           
 ConfigurationContext getRootContext()
           
 java.lang.Object getSelfManagedData(java.lang.Class clazz, java.lang.Object key)
          Retrieve a value of self managed data previously saved with the specified key.
 ServiceContext getServiceContext()
           
 java.lang.String getServiceContextID()
           
 ServiceGroupContext getServiceGroupContext()
           
 java.lang.String getServiceGroupContextId()
           
 SessionContext getSessionContext()
           
 java.lang.String getSoapAction()
           
 EndpointReference getTo()
           
 TransportInDescription getTransportIn()
           
 TransportOutDescription getTransportOut()
           
 java.lang.String getWSAAction()
           
 boolean isDoingMTOM()
           
 boolean isDoingREST()
           
 boolean isDoingSwA()
           
 boolean isEngaged(java.lang.String moduleName)
           
 boolean isHeaderPresent()
          Deprecated. The bonus you used to get from this is now built in to SOAPEnvelope.getHeader()
 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 readExternal(java.io.ObjectInput in)
          Restore the contents of the MessageContext that was previously saved.
 void removeAttachment(java.lang.String contentID)
          Removes the attachment with the given content ID from the Attachments Map Do nothing if a attachment cannot be found by the given content ID.
 void removeFirstInboundExecutedPhase()
          Remove the first Phase in the collection of executed phases for the inbound path.
 void removeFirstOutboundExecutedPhase()
          Remove the first Phase in the collection of executed phases for the outbound path.
 void removeSelfManagedData(java.lang.Class clazz, java.lang.Object key)
          Removes the mapping of the specified key if the specified key has been set for self managed data
 void resetInboundExecutedPhases()
          Reset the list of executed inbound phases.
 void resetOutboundExecutedPhases()
          Reset the list of executed outbound phases.
 void setAttachmentMap(org.apache.axiom.attachments.Attachments attachments)
          Setting of the attachments map should be performed at the receipt of a message only.
 void setAxisMessage(AxisMessage axisMessage)
           
 void setAxisOperation(AxisOperation axisOperation)
           
 void setAxisService(AxisService axisService)
           
 void setAxisServiceGroup(AxisServiceGroup axisServiceGroup)
           
 void setConfigurationContext(ConfigurationContext context)
           
 void setCurrentHandlerIndex(int currentHandlerIndex)
           
static void setCurrentMessageContext(MessageContext ctx)
           
 void setCurrentPhaseIndex(int currentPhaseIndex)
           
 void setDoingMTOM(boolean b)
           
 void setDoingREST(boolean b)
           
 void setDoingSwA(boolean b)
           
 void setEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope)
           
 void setExecutionChain(java.util.ArrayList executionChain)
          Set the execution chain of Handler in this MessageContext.
 void setFaultTo(EndpointReference reference)
           
 void setFLOW(int FLOW)
           
 void setFrom(EndpointReference reference)
           
 void setInboundExecutedPhasesExplicit(java.util.LinkedList inb)
           
 void setIncomingTransportName(java.lang.String incomingTransportName)
           
 void setIsSOAP11Explicit(boolean t)
           
 void setMessageID(java.lang.String messageId)
           
 void setNewThreadRequired(boolean b)
           
 void setOperationContext(OperationContext context)
           
 void setOptions(Options options)
          Set the options for myself.
 void setOptionsExplicit(Options op)
           
 void setOutboundExecutedPhasesExplicit(java.util.LinkedList outb)
           
 void setOutputWritten(boolean b)
           
 void setPaused(boolean paused)
           
 void setProcessingFault(boolean b)
           
 void setProperty(java.lang.String name, java.lang.Object value)
          Set a property for this message context.
 void setRelationships(RelatesTo[] list)
           
 void setReplyTo(EndpointReference referance)
           
 void setResponseWritten(boolean b)
           
 void setSelfManagedData(java.lang.Class clazz, java.lang.Object key, java.lang.Object value)
          Add a key-value pair of self managed data to the set associated with this message context.
 void setSelfManagedDataMapExplicit(java.util.LinkedHashMap map)
           
 void setServerSide(boolean b)
           
 void setServiceContext(ServiceContext context)
           
 void setServiceContextID(java.lang.String serviceContextID)
          Sets the service context id.
 void setServiceGroupContext(ServiceGroupContext serviceGroupContext)
           
 void setServiceGroupContextId(java.lang.String serviceGroupContextId)
           
 void setSessionContext(SessionContext sessionContext)
           
 void setSoapAction(java.lang.String soapAction)
           
 void setTo(EndpointReference to)
           
 void setTransportIn(TransportInDescription in)
           
 void setTransportOut(TransportOutDescription out)
           
 void setWSAAction(java.lang.String actionURI)
          setWSAAction
 void setWSAMessageId(java.lang.String messageID)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
          Save the contents of this MessageContext instance.
 
Methods inherited from class org.apache.axis2.context.AbstractContext
flush, getLastTouchedTime, getParent, mergeProperties, setLastTouchedTime, setParent, setProperties, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentMessageContext

public static java.lang.ThreadLocal currentMessageContext
A place to store the current MessageContext


options

protected Options options

IN_FLOW

public static final int IN_FLOW
See Also:
Constant Field Values

IN_FAULT_FLOW

public static final int IN_FAULT_FLOW
See Also:
Constant Field Values

OUT_FLOW

public static final int OUT_FLOW
See Also:
Constant Field Values

OUT_FAULT_FLOW

public static final int OUT_FAULT_FLOW
See Also:
Constant Field Values

REMOTE_ADDR

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

TRANSPORT_ADDR

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

TRANSPORT_HEADERS

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

attachments

public transient org.apache.axiom.attachments.Attachments attachments
message attachments NOTE: Serialization of message attachments is handled as part of the overall message serialization. If this needs to change, then investigate having the Attachment class implement the java.io.Externalizable interface.


TRANSPORT_OUT

public static final java.lang.String TRANSPORT_OUT
Field TRANSPORT_OUT

See Also:
Constant Field Values

TRANSPORT_IN

public static final java.lang.String TRANSPORT_IN
Field TRANSPORT_IN

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_16. This is the 'utf-16' 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

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

FLOW

public int FLOW

TRANSPORT_NON_BLOCKING

public static final java.lang.String TRANSPORT_NON_BLOCKING
To invoke fireAndforget method we have to hand over transport sending logic to a thread other wise user has to wait till it get transport response (in the case of HTTP its HTTP 202)

See Also:
Constant Field Values

DISABLE_ASYNC_CALLBACK_ON_TRANSPORT_ERROR

public static final java.lang.String DISABLE_ASYNC_CALLBACK_ON_TRANSPORT_ERROR
This property allows someone (e.g. RM) to disable an async callback from being invoked if a fault occurs during message transmission. If this is not set, it can be assumed that the fault will be delivered via Callback.onError(...).

See Also:
Constant Field Values

outputWritten

public boolean outputWritten
Constructor Detail

MessageContext

public MessageContext()
Constructor

Method Detail

getCurrentMessageContext

public static MessageContext getCurrentMessageContext()

setCurrentMessageContext

public static void setCurrentMessageContext(MessageContext ctx)

toString

public java.lang.String toString()

getLogCorrelationID

public java.lang.String getLogCorrelationID()
Get a "raw" version of the logCorrelationID. The logCorrelationID is guaranteed to be unique and may be persisted along with the rest of the message context.

Returns:
A string that can be output to a log file as an identifier for this MessageContext. It is suitable for matching related log entries.

getLogIDString

public java.lang.String getLogIDString()
Get a formatted version of the logCorrelationID.

Returns:
A string that can be output to a log file as an identifier for this MessageContext. It is suitable for matching related log entries.

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 org.apache.axiom.soap.SOAPEnvelope getEnvelope()
Returns:
Returns SOAPEnvelope.

getExecutionChain

public java.util.ArrayList getExecutionChain()

addInboundExecutedPhase

public void addInboundExecutedPhase(Handler phase)
Add a Phase to the collection of executed phases for the inbound path. Phases will be inserted in a LIFO data structure.

Parameters:
phase - The phase to add to the list.

removeFirstInboundExecutedPhase

public void removeFirstInboundExecutedPhase()
Remove the first Phase in the collection of executed phases for the inbound path.


getInboundExecutedPhases

public java.util.Iterator getInboundExecutedPhases()
Get an iterator over the inbound executed phase list.

Returns:
An Iterator over the LIFO data structure.

resetInboundExecutedPhases

public void resetInboundExecutedPhases()
Reset the list of executed inbound phases. This is needed because the OutInAxisOperation currently invokes receive() even when a fault occurs, and we will have already executed the flowComplete on those before receiveFault() is called.


addOutboundExecutedPhase

public void addOutboundExecutedPhase(Handler phase)
Add a Phase to the collection of executed phases for the outbound path. Phases will be inserted in a LIFO data structure.

Parameters:
phase - The phase to add to the list.

removeFirstOutboundExecutedPhase

public void removeFirstOutboundExecutedPhase()
Remove the first Phase in the collection of executed phases for the outbound path.


getOutboundExecutedPhases

public java.util.Iterator getOutboundExecutedPhases()
Get an iterator over the outbound executed phase list.

Returns:
An Iterator over the LIFO data structure.

resetOutboundExecutedPhases

public void resetOutboundExecutedPhases()
Reset the list of executed outbound phases. This is needed because the OutInAxisOperation currently invokes receive() even when a fault occurs, and we will have already executed the flowComplete on those before receiveFault() is called.


getFaultTo

public EndpointReference getFaultTo()
Returns:
Returns EndpointReference.

getFrom

public EndpointReference getFrom()
Returns:
Returns EndpointReference.

getMessageID

public java.lang.String getMessageID()
Returns:
Returns message id.

getModuleParameter

public Parameter getModuleParameter(java.lang.String key,
                                    java.lang.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 description 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 specifying 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(java.lang.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(java.lang.String name,
                        java.lang.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 java.lang.Object getProperty(java.lang.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

getProperties

public java.util.Map getProperties()
Retrieves all property values. 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, it will start at whatever level has been set and start there. The returned map is unmodifiable, so any changes to the properties have to be done by calling setProperty(String,Object). In addition, any changes to the properties are not reflected on this map.

Overrides:
getProperties in class AbstractContext
Returns:
An unmodifiable map containing the combination of all available properties or an empty map.

getRelationships

public RelatesTo[] getRelationships()
Returns:
Returns RelatesTo array.

getRelatesTo

public RelatesTo getRelatesTo(java.lang.String type)
Returns:
Returns RelatesTo.

getRelatesTo

public RelatesTo getRelatesTo()
Returns:
Returns RelatesTo.

getReplyTo

public EndpointReference getReplyTo()
Returns:
Returns EndpointReference.

getServiceContext

public ServiceContext getServiceContext()
Returns:
Returns ServiceContext.

getServiceContextID

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

getServiceGroupContext

public ServiceGroupContext getServiceGroupContext()

getServiceGroupContextId

public java.lang.String getServiceGroupContextId()

getSessionContext

public SessionContext getSessionContext()
Returns:
Returns SessionContext.

setSessionContext

public void setSessionContext(SessionContext sessionContext)

getSoapAction

public java.lang.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 java.lang.String getWSAAction()

isDoingMTOM

public boolean isDoingMTOM()
Returns:
Returns boolean.

isDoingREST

public boolean isDoingREST()
Returns:
Returns boolean.

isDoingSwA

public boolean isDoingSwA()
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.

getAxisMessage

public AxisMessage getAxisMessage()

setAxisMessage

public void setAxisMessage(AxisMessage axisMessage)

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 -

setDoingSwA

public void setDoingSwA(boolean b)
Parameters:
b -

setEnvelope

public void setEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope)
                 throws AxisFault
Parameters:
envelope -
Throws:
AxisFault

setExecutionChain

public void setExecutionChain(java.util.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(java.lang.String messageId)
Parameters:
messageId -

setNewThreadRequired

public void setNewThreadRequired(boolean b)
Parameters:
b -

setOperationContext

public void setOperationContext(OperationContext context)
Parameters:
context - The OperationContext

setOutputWritten

public void setOutputWritten(boolean b)
Parameters:
b -

setProcessingFault

public void setProcessingFault(boolean b)
Parameters:
b -

addRelatesTo

public void addRelatesTo(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(java.lang.String serviceContextID)
Sets the service context id.

Parameters:
serviceContextID -

setServiceGroupContext

public void setServiceGroupContext(ServiceGroupContext serviceGroupContext)

setServiceGroupContextId

public void setServiceGroupContextId(java.lang.String serviceGroupContextId)

setSoapAction

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

setTo

public void setTo(EndpointReference to)
Parameters:
to -

setTransportIn

public void setTransportIn(TransportInDescription in)
Parameters:
in -

setTransportOut

public void setTransportOut(TransportOutDescription out)
Parameters:
out -

setWSAAction

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


setWSAMessageId

public void setWSAMessageId(java.lang.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

getIncomingTransportName

public java.lang.String getIncomingTransportName()

setIncomingTransportName

public void setIncomingTransportName(java.lang.String incomingTransportName)

setRelationships

public void setRelationships(RelatesTo[] list)

getEffectivePolicy

public org.apache.neethi.Policy getEffectivePolicy()

isEngaged

public boolean isEngaged(java.lang.String moduleName)

isHeaderPresent

public boolean isHeaderPresent()
Deprecated. The bonus you used to get from this is now built in to SOAPEnvelope.getHeader()

Gets the first child of the envelope, check if it is a soap:Body, which means there is no header. We do this basically to make sure we don't parse and build the om tree of the whole envelope looking for the soap header. If this method returns true, there still is no guarantee that there is a soap:Header present, use getHeader() and also check for null on getHeader() to be absolutely sure.

Returns:
boolean

setAttachmentMap

public void setAttachmentMap(org.apache.axiom.attachments.Attachments attachments)
Setting of the attachments map should be performed at the receipt of a message only. This method is only meant to be used by the Axis2 internals.

Parameters:
attachments -

getAttachmentMap

public org.apache.axiom.attachments.Attachments getAttachmentMap()
You can directly access the attachment map of the message context from here. Returned attachment map can be empty.

Returns:
attachment

addAttachment

public void addAttachment(java.lang.String contentID,
                          javax.activation.DataHandler dataHandler)
Adds an attachment to the attachment Map of this message context. This attachment gets serialised as a MIME attachment when sending the message if SOAP with Attachments is enabled.

Parameters:
contentID - : will be the content ID of the MIME part
dataHandler -

addAttachment

public java.lang.String addAttachment(javax.activation.DataHandler dataHandler)
Adds an attachment to the attachment Map of this message context. This attachment gets serialised as a MIME attachment when sending the message if SOAP with Attachments is enabled. Content ID of the MIME part will be auto generated by Axis2.

Parameters:
dataHandler -
Returns:
the auto generated content ID of the MIME attachment

getAttachment

public javax.activation.DataHandler getAttachment(java.lang.String contentID)
Access the DataHandler of the attachment contained in the map corresponding to the given content ID. Returns "NULL" if a attachment cannot be found by the given content ID.

Parameters:
contentID - : Content ID of the MIME attachment
Returns:
Data handler of the attachment

removeAttachment

public void removeAttachment(java.lang.String contentID)
Removes the attachment with the given content ID from the Attachments Map Do nothing if a attachment cannot be found by the given content ID.

Parameters:
contentID - of the attachment

setSelfManagedData

public void setSelfManagedData(java.lang.Class clazz,
                               java.lang.Object key,
                               java.lang.Object value)
Add a key-value pair of self managed data to the set associated with this message context.

This is primarily intended to allow handlers to manage their own message-specific data when the message context is saved/restored.

Parameters:
clazz - The class of the caller that owns the key-value pair
key - The key for this data object
value - The data object

getSelfManagedData

public java.lang.Object getSelfManagedData(java.lang.Class clazz,
                                           java.lang.Object key)
Retrieve a value of self managed data previously saved with the specified key.

Parameters:
clazz - The class of the caller that owns the key-value pair
key - The key for the data
Returns:
The data object associated with the key, or NULL if not found

containsSelfManagedDataKey

public boolean containsSelfManagedDataKey(java.lang.Class clazz,
                                          java.lang.Object key)
Check to see if the key for the self managed data is available

Parameters:
clazz - The class of the caller that owns the key-value pair
key - The key to look for
Returns:
TRUE if the key exists, FALSE otherwise

removeSelfManagedData

public void removeSelfManagedData(java.lang.Class clazz,
                                  java.lang.Object key)
Removes the mapping of the specified key if the specified key has been set for self managed data

Parameters:
clazz - The class of the caller that owns the key-value pair
key - The key of the object to be removed

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Save the contents of this MessageContext instance.

NOTE: Transient fields and static fields are not saved. Also, objects that represent "static" data are not saved, except for enough information to be able to find matching objects when the message context is re-constituted.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - The stream to write the object contents to
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restore the contents of the MessageContext that was previously saved.

NOTE: The field data must read back in the same order and type as it was written. Some data will need to be validated when resurrected.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - The stream to read the object contents from
Throws:
java.io.IOException
java.lang.ClassNotFoundException

activate

public void activate(ConfigurationContext cc)
This method checks to see if additional work needs to be done in order to complete the object reconstitution. Some parts of the object restored from the readExternal() cannot be completed until we have a configurationContext from the active engine. The configurationContext is used to help this object to plug back into the engine's configuration and deployment objects.

Parameters:
cc - The configuration context object representing the active configuration

activateWithOperationContext

public void activateWithOperationContext(OperationContext operationCtx)
This method checks to see if additional work needs to be done in order to complete the object reconstitution. Some parts of the object restored from the readExternal() cannot be completed until we have an object that gives us a view of the active object graph from the active engine.

NOTE: when activating an object, you only need to call one of the activate methods (activate() or activateWithOperationContext()) but not both.

Parameters:
operationCtx - The operation context object that is a member of the active object graph

extractCopyMessageContext

public MessageContext extractCopyMessageContext()
Return a Read-Only copy of this message context that has been extracted from the object hierachy. In other words, the message context copy does not have links to the object graph.

NOTE: The copy shares certain objects with the original. The intent is to use the copy to read values but not modify them, especially since the copy is not part of the normal *Context and Axis* object graph.

Returns:
A copy of the message context that is not in the object graph

setIsSOAP11Explicit

public void setIsSOAP11Explicit(boolean t)

setInboundExecutedPhasesExplicit

public void setInboundExecutedPhasesExplicit(java.util.LinkedList inb)

setOutboundExecutedPhasesExplicit

public void setOutboundExecutedPhasesExplicit(java.util.LinkedList outb)

setSelfManagedDataMapExplicit

public void setSelfManagedDataMapExplicit(java.util.LinkedHashMap map)

setOptionsExplicit

public void setOptionsExplicit(Options op)

getRootContext

public ConfigurationContext getRootContext()
Specified by:
getRootContext in class AbstractContext


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.