Home » synapse-1.2-src » org.apache.synapse » [javadoc | source]
org.apache.synapse
public interface: MessageContext [javadoc | source]

All Known Implementing Classes:
    ScriptMessageContext, Axis2MessageContext

The Synapse Message Context is available to all mediators through which it flows. It allows one to call to the underlying SynapseEnvironment (i.e. the SOAP engine - such as Axis2) where required. It also allows one to access the current SynapseConfiguration. Additionally it holds per message properties (i.e. local properties valid for the lifetime of the message), and the current SOAPEnvelope
Method from org.apache.synapse.MessageContext Summary:
getConfiguration,   getContextEntries,   getEndpoint,   getEntry,   getEnvelope,   getEnvironment,   getFaultSequence,   getFaultStack,   getFaultTo,   getFrom,   getMainSequence,   getMessageID,   getProperty,   getPropertyKeySet,   getRelatesTo,   getReplyTo,   getSequence,   getServiceLog,   getSoapAction,   getTo,   getTracingState,   getWSAAction,   getWSAMessageID,   isDoingGET,   isDoingMTOM,   isDoingPOX,   isDoingSWA,   isFaultResponse,   isResponse,   isSOAP11,   pushFaultHandler,   setConfiguration,   setContextEntries,   setDoingGET,   setDoingMTOM,   setDoingPOX,   setDoingSWA,   setEnvelope,   setEnvironment,   setFaultResponse,   setFaultTo,   setFrom,   setMessageID,   setProperty,   setRelatesTo,   setReplyTo,   setResponse,   setSoapAction,   setTo,   setTracingState,   setWSAAction,   setWSAMessageID
Method from org.apache.synapse.MessageContext Detail:
 public SynapseConfiguration getConfiguration()
    Get a reference to the current SynapseConfiguration
 public Map getContextEntries()
    Return all the entries which are in the MessageContext. This does not represent all the declared entries in the configuration, rather only the entries that the context has already used. This will not lookup for the entries in the Configuration.
 public Endpoint getEndpoint(String key)
    Return the endpoint with the given key from the configuration, or the local message context. This method looks up for the endpoint with the given key from the local message context to make this look up transactional - i.e. a request and response message pair will not see a difference in the said endpoint if it was dynamic and changed in between at the registry
 public Object getEntry(String key)
    Get the value of a property set on the message instance, from the local registry or the remote registry - by cascading through
 public SOAPEnvelope getEnvelope()
    Get the SOAP envelope of this message
 public SynapseEnvironment getEnvironment()
    Returns a reference to the host Synapse Environment
 public Mediator getFaultSequence()
    Return the fault sequence from the configuration, or the local message context This method looks up for the sequence named Constants.FAULT_SEQUENCE_KEY from the local message context to make this look up transactional - i.e. a request and response message pair will not see a difference in the fault sequence if the fault sequence was dynamic and changed in between at the registry
 public Stack getFaultStack()
 public EndpointReference getFaultTo()
    Get the faultTo EPR if available
 public EndpointReference getFrom()
    Get the from EPR if available
 public Mediator getMainSequence()
    Return the main sequence from the configuration, or the local message context This method looks up for the sequence named Constants.MAIN_SEQUENCE_KEY from the local message context to make this look up transactional - i.e. a request and response message pair will not see a difference in the main sequence if the main sequence was dynamic and changed in between at the registry
 public String getMessageID()
    Get the message id if available
 public Object getProperty(String key)
    Get the value of a custom (local) property set on the message instance
 public Set getPropertyKeySet()
    Returns the Set of keys over the properties on this message context
 public RelatesTo getRelatesTo()
    Get the relatesTo of this message
 public EndpointReference getReplyTo()
    Get the replyTo EPR if available
 public Mediator getSequence(String key)
    Return the sequence with the given key from the configuration, or the local message context. This method looks up for the sequence with the given key from the local message context to make this look up transactional - i.e. a request and response message pair will not see a difference in the said sequence if it was dynamic and changed in between at the registry
 public Log getServiceLog()
    Return the service level Log for this message context or null
 public String getSoapAction()
    Returns the SOAPAction of the message
 public EndpointReference getTo()
    Get the To EPR
 public int getTracingState()
    This is used to check whether the tracing should be enabled on the current mediator or not
 public String getWSAAction()
    Returns the WSAAction
 public String getWSAMessageID()
    Gets the message name
 public boolean isDoingGET()
    Is this message over GET?
 public boolean isDoingMTOM()
    If this message using MTOM?
 public boolean isDoingPOX()
    Is this message over POX?
 public boolean isDoingSWA()
    If this message using SWA?
 public boolean isFaultResponse()
    Is this message a response to a fault message?
 public boolean isResponse()
    Is this message a response to a synchronous message sent out through Synapse?
 public boolean isSOAP11()
    Is this message a SOAP 1.1 message?
 public  void pushFaultHandler(FaultHandler fault)
 public  void setConfiguration(SynapseConfiguration cfg)
    Set or replace the Synapse Configuration instance to be used. May be used to programatically change the configuration at runtime etc.
 public  void setContextEntries(Map<String, Object> entries)
    Sets the entries to the current context and not to the configuration. This can be used to forcibly override an existing set of resources in the configuration, because the resource lookup will look for the context first. But this only sets the entries to the current context
 public  void setDoingGET(boolean b)
    Marks this message as over REST/GET
 public  void setDoingMTOM(boolean b)
    Marks as using MTOM
 public  void setDoingPOX(boolean b)
    Marks this message as over POX
 public  void setDoingSWA(boolean b)
    Marks as using SWA
 public  void setEnvelope(SOAPEnvelope envelope) throws AxisFault
    Sets the given envelope as the current SOAPEnvelope for this message
 public  void setEnvironment(SynapseEnvironment se)
    Sets the SynapseEnvironment reference to this context
 public  void setFaultResponse(boolean b)
    Marks this message as a fault response
 public  void setFaultTo(EndpointReference reference)
    Set the faultTo EPR
 public  void setFrom(EndpointReference reference)
    Set the from EPR
 public  void setMessageID(String string)
    Set the message id
 public  void setProperty(String key,
    Object value)
    Set a custom (local) property with the given name on the message instance
 public  void setRelatesTo(RelatesTo[] reference)
    Sets the relatesTo references for this message
 public  void setReplyTo(EndpointReference reference)
    Set the replyTo EPR
 public  void setResponse(boolean b)
    Mark this message as a response or not.
 public  void setSoapAction(String string)
    Set the SOAPAction
 public  void setTo(EndpointReference reference)
    Set the To EPR
 public  void setTracingState(int tracingState)
    This is used to set the value of tracing enable variable
 public  void setWSAAction(String actionURI)
    Sets the WSAAction
 public  void setWSAMessageID(String messageID)
    Set the message