|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.axis2.context.AbstractContext org.apache.axis2.context.MessageContext
public class MessageContext
Axis2 states are held in two information models, called description hierarchy and context hierarchy. Description hierarchy hold deployment configuration and it's values does not change unless deployment configuration change occurs where Context hierarchy hold run time information. Both hierarchies consists four levels, Global, Service Group, Operation and Message. Please look at "Information Model" section of "Axis2 Architecture Guide" for more information.
MessageContext hold run time information about one Message invocation. It hold reference to OperationContext, ServiceGroupContext, and Configuration Context tied with current message. For an example if you need accesses to other messages of the current invocation, you can get to them via OperationContext. Addition to class attributes define in Message context, message context stores the information as name value pairs. Those name value pairs,and class attributes tweak the execution behavior of message context and some of them can be find in org.apache.axis2.Constants class. (TODO we should provide list of supported options). You may set them at any level of context hierarchy and they will affect invocations related to their child elements.
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 |
addExecutedPhase(Handler phase)
Add a Phase to the collection of executed phases for the path. |
void |
addRelatesTo(RelatesTo reference)
Add a RelatesTo |
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.Iterator |
getExecutedPhases()
Get an iterator over the executed phase list. |
java.util.ArrayList |
getExecutionChain()
|
java.lang.Exception |
getFailureReason()
Obtain the Exception which caused the processing chain to halt. |
EndpointReference |
getFaultTo()
|
int |
getFLOW()
|
EndpointReference |
getFrom()
|
java.lang.String |
getIncomingTransportName()
|
java.lang.Object |
getLocalProperty(java.lang.String name)
Retrieves a property value. |
java.lang.Object |
getLocalProperty(java.lang.String name,
boolean searchOptions)
|
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()
|
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)
Get any RelatesTos of a particular type associated with this MessageContext TODO: Shouldn't this return a List? |
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 |
isFault()
|
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 |
isPropertyTrue(java.lang.String name)
Check if a given property is true. |
boolean |
isPropertyTrue(java.lang.String name,
boolean defaultVal)
Check if a given property is true. |
boolean |
isResponseWritten()
|
boolean |
isServerSide()
|
boolean |
isSOAP11()
|
void |
pause()
Pause the execution of the current handler chain |
void |
readExternal(java.io.ObjectInput inObject)
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 |
removeFirstExecutedPhase()
Remove the first Phase in the collection of executed phases |
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 |
resetExecutedPhases()
Reset the list of executed 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 |
setExecutedPhasesExplicit(java.util.LinkedList inb)
|
void |
setExecutionChain(java.util.ArrayList executionChain)
Set the execution chain of Handler in this MessageContext. |
void |
setFailureReason(java.lang.Exception failureReason)
Set the failure reason. |
void |
setFaultTo(EndpointReference reference)
|
void |
setFLOW(int FLOW)
|
void |
setFrom(EndpointReference reference)
|
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 |
setOutputWritten(boolean b)
|
void |
setPaused(boolean paused)
|
void |
setProcessingFault(boolean b)
|
void |
setRelationships(RelatesTo[] list)
|
void |
setReplyTo(EndpointReference reference)
Set ReplyTo destination |
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 o)
Save the contents of this MessageContext instance. |
Methods inherited from class org.apache.axis2.context.AbstractContext |
---|
clearPropertyDifferences, flush, getLastTouchedTime, getParent, getPropertyDifferences, getPropertyNames, getPropertyNonReplicable, isAncestor, mergeProperties, removeProperty, removePropertyNonReplicable, setLastTouchedTime, setNonReplicableProperty, setParent, setProperties, setProperty, touch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.ThreadLocal currentMessageContext
protected Options options
public static final int IN_FLOW
public static final int IN_FAULT_FLOW
public static final int OUT_FLOW
public static final int OUT_FAULT_FLOW
public static final java.lang.String REMOTE_ADDR
public static final java.lang.String TRANSPORT_ADDR
public static final java.lang.String TRANSPORT_HEADERS
public transient org.apache.axiom.attachments.Attachments attachments
public static final java.lang.String TRANSPORT_OUT
public static final java.lang.String TRANSPORT_IN
public static final java.lang.String CHARACTER_SET_ENCODING
public static final java.lang.String UTF_8
public static final java.lang.String UTF_16
public static final java.lang.String TRANSPORT_SUCCEED
public static final java.lang.String DEFAULT_CHAR_SET_ENCODING
public int FLOW
public static final java.lang.String TRANSPORT_NON_BLOCKING
public static final java.lang.String DISABLE_ASYNC_CALLBACK_ON_TRANSPORT_ERROR
public boolean outputWritten
Constructor Detail |
---|
public MessageContext()
Method Detail |
---|
public static MessageContext getCurrentMessageContext()
public static void setCurrentMessageContext(MessageContext ctx)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getLogCorrelationID()
public java.lang.String getLogIDString()
public void pause()
public AxisOperation getAxisOperation()
public AxisService getAxisService()
public AxisServiceGroup getAxisServiceGroup()
public ConfigurationContext getConfigurationContext()
public int getCurrentHandlerIndex()
public int getCurrentPhaseIndex()
public org.apache.axiom.soap.SOAPEnvelope getEnvelope()
public java.util.ArrayList getExecutionChain()
public void addExecutedPhase(Handler phase)
phase
- The phase to add to the list.public void removeFirstExecutedPhase()
public java.util.Iterator getExecutedPhases()
public void resetExecutedPhases()
public EndpointReference getFaultTo()
public EndpointReference getFrom()
public java.lang.String getMessageID()
public Parameter getModuleParameter(java.lang.String key, java.lang.String moduleName, HandlerDescription handler)
key
- :
Parameter NamemoduleName
- :
Name of the modulehandler
- HandlerDescription
Parameter
public OperationContext getOperationContext()
public Parameter getParameter(java.lang.String key)
key
- name of desired parameter
Parameter
public java.lang.Object getLocalProperty(java.lang.String name)
getLocalProperty
in class AbstractContext
name
- name of the property to search for
public java.lang.Object getLocalProperty(java.lang.String name, boolean searchOptions)
public java.lang.Object getProperty(java.lang.String name)
getProperty
in class AbstractContext
name
- name of the property to search for
public boolean isPropertyTrue(java.lang.String name)
name
- name of the property to check
public boolean isPropertyTrue(java.lang.String name, boolean defaultVal)
name
- name of the property to checkdefaultVal
- the default value if the property doesn't exist
public java.util.Map getProperties()
AbstractContext.setProperty(String,Object)
. In addition,
any changes to the properties are not reflected on this map.
getProperties
in class AbstractContext
public RelatesTo[] getRelationships()
public RelatesTo getRelatesTo(java.lang.String type)
type
- the relationship type
public RelatesTo getRelatesTo()
public EndpointReference getReplyTo()
public ServiceContext getServiceContext()
public java.lang.String getServiceContextID()
public ServiceGroupContext getServiceGroupContext()
public java.lang.String getServiceGroupContextId()
public SessionContext getSessionContext()
public void setSessionContext(SessionContext sessionContext)
public java.lang.String getSoapAction()
public EndpointReference getTo()
public TransportInDescription getTransportIn()
public TransportOutDescription getTransportOut()
public java.lang.String getWSAAction()
public boolean isDoingMTOM()
public boolean isDoingREST()
public boolean isDoingSwA()
public boolean isNewThreadRequired()
public boolean isOutputWritten()
public boolean isPaused()
public void setPaused(boolean paused)
public boolean isProcessingFault()
public boolean isResponseWritten()
public boolean isSOAP11()
public boolean isServerSide()
public AxisMessage getAxisMessage()
public void setAxisMessage(AxisMessage axisMessage)
public void setAxisOperation(AxisOperation axisOperation)
public void setAxisService(AxisService axisService)
public void setAxisServiceGroup(AxisServiceGroup axisServiceGroup)
public void setConfigurationContext(ConfigurationContext context)
context
- public void setCurrentHandlerIndex(int currentHandlerIndex)
public void setCurrentPhaseIndex(int currentPhaseIndex)
public void setDoingMTOM(boolean b)
b
- public void setDoingREST(boolean b)
b
- public void setDoingSwA(boolean b)
b
- public void setEnvelope(org.apache.axiom.soap.SOAPEnvelope envelope) throws AxisFault
envelope
-
AxisFault
public void setExecutionChain(java.util.ArrayList executionChain)
executionChain
- public void setFaultTo(EndpointReference reference)
reference
- public void setFrom(EndpointReference reference)
reference
- public void setMessageID(java.lang.String messageId)
messageId
- public void setNewThreadRequired(boolean b)
b
- public void setOperationContext(OperationContext context)
context
- The OperationContextpublic void setOutputWritten(boolean b)
b
- public void setProcessingFault(boolean b)
b
- public void addRelatesTo(RelatesTo reference)
reference
- RelatesTo describing how we relate to another messagepublic void setReplyTo(EndpointReference reference)
reference
- the ReplyTo EPRpublic void setResponseWritten(boolean b)
b
- public void setServerSide(boolean b)
b
- public void setServiceContext(ServiceContext context)
context
- public void setServiceContextID(java.lang.String serviceContextID)
serviceContextID
- public void setServiceGroupContext(ServiceGroupContext serviceGroupContext)
public void setServiceGroupContextId(java.lang.String serviceGroupContextId)
public void setSoapAction(java.lang.String soapAction)
soapAction
- public void setTo(EndpointReference to)
to
- public void setTransportIn(TransportInDescription in)
in
- public void setTransportOut(TransportOutDescription out)
out
- public void setWSAAction(java.lang.String actionURI)
public void setWSAMessageId(java.lang.String messageID)
public int getFLOW()
public void setFLOW(int FLOW)
public Options getOptions()
public void setOptions(Options options)
options
- the options to setpublic java.lang.String getIncomingTransportName()
public void setIncomingTransportName(java.lang.String incomingTransportName)
public void setRelationships(RelatesTo[] list)
public org.apache.neethi.Policy getEffectivePolicy()
public boolean isEngaged(java.lang.String moduleName)
public boolean isHeaderPresent()
public void setAttachmentMap(org.apache.axiom.attachments.Attachments attachments)
attachments
- public org.apache.axiom.attachments.Attachments getAttachmentMap()
public void addAttachment(java.lang.String contentID, javax.activation.DataHandler dataHandler)
contentID
- :
will be the content ID of the MIME part (without the "cid:" prefix)dataHandler
- public java.lang.String addAttachment(javax.activation.DataHandler dataHandler)
dataHandler
-
public javax.activation.DataHandler getAttachment(java.lang.String contentID)
contentID
- :
Content ID of the MIME attachment (without the "cid:" prefix)
public void removeAttachment(java.lang.String contentID)
contentID
- of the attachment (without the "cid:" prefix)public void setSelfManagedData(java.lang.Class clazz, java.lang.Object key, java.lang.Object value)
clazz
- The class of the caller that owns the key-value pairkey
- The key for this data objectvalue
- The data objectpublic java.lang.Object getSelfManagedData(java.lang.Class clazz, java.lang.Object key)
clazz
- The class of the caller that owns the key-value pairkey
- The key for the data
public boolean containsSelfManagedDataKey(java.lang.Class clazz, java.lang.Object key)
clazz
- The class of the caller that owns the key-value pairkey
- The key to look for
public void removeSelfManagedData(java.lang.Class clazz, java.lang.Object key)
clazz
- The class of the caller that owns the key-value pairkey
- The key of the object to be removedpublic void writeExternal(java.io.ObjectOutput o) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The stream to write the object contents to
java.io.IOException
public void readExternal(java.io.ObjectInput inObject) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The stream to read the object contents from
java.io.IOException
java.lang.ClassNotFoundException
public void activate(ConfigurationContext cc)
cc
- The configuration context object representing the active configurationpublic void activateWithOperationContext(OperationContext operationCtx)
operationCtx
- The operation context object that is a member of the active object graphpublic MessageContext extractCopyMessageContext()
public void setIsSOAP11Explicit(boolean t)
public void setExecutedPhasesExplicit(java.util.LinkedList inb)
public void setSelfManagedDataMapExplicit(java.util.LinkedHashMap map)
public void setOptionsExplicit(Options op)
public ConfigurationContext getRootContext()
getRootContext
in class AbstractContext
public boolean isFault()
public java.lang.Exception getFailureReason()
public void setFailureReason(java.lang.Exception failureReason)
failureReason
- an Exception which caused processing to halt.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |