org.apache.axis
Class MessageContext

java.lang.Object
  |
  +--org.apache.axis.MessageContext

public class MessageContext
extends java.lang.Object

Some more general docs will go here. This class also contains constants for accessing some well-known properties. Using a hierarchical namespace is strongly suggested in order to lower the chance for conflicts. (These constants should be viewed as an explicit list of well known and widely used context keys, there's nothing wrong with directly using the key strings. This is the reason for the hierarchical constant namespace. Actually I think we might just list the keys in the docs and provide no such constants since they create yet another namespace, but we'd have no compile-time checks then. Whaddya think? - todo by Jacek)

Author:
Doug Davis (dug@us.ibm.com), Jacek Kopecky (jacek@idoox.com)

Field Summary
static java.lang.String AUTHUSER
          Place to store an AuthenticatedUser
static java.lang.String ENGINE_HANDLER
          Contains an instance of Handler, which is the ServiceContext and the entrypoint of this service.
static java.lang.String PASSWORD
          A String with the user's password (if available)
static java.lang.String QUIT_REQUESTED
          Has a quit been requested? Hackish...
static java.lang.String TRANS_URL
          This String is the URL that the message came to
static java.lang.String USERID
          A String with the user's ID (if available)
 
Constructor Summary
MessageContext(AxisEngine engine)
           
 
Method Summary
 void clearProperty(java.lang.String propName)
           
 AxisEngine getAxisEngine()
           
 AxisClassLoader getClassLoader()
           
 Message getCurrentMessage()
          Return the current (i.e.
 boolean getMaintainSession()
          Are we maintaining session state?
 boolean getPastPivot()
          Determine when we've passed the pivot
 java.lang.Object getProperty(java.lang.String propName)
           
 Message getRequestMessage()
          Get the request message.
 Message getResponseMessage()
          Get the response message.
 ServiceDescription getServiceDescription()
           
 Handler getServiceHandler()
           
 Session getSession()
          Sessions
 java.lang.String getStrProp(java.lang.String propName)
          Just a util so we don't have to cast the result
 java.lang.String getTargetService()
           
 int getTimeout()
          Get timeout from our MessageContext.
 java.lang.String getTransportName()
          Transport
 TypeMappingRegistry getTypeMappingRegistry()
          Get the currently in-scope type mapping registry.
 void reset()
           
 void setClassLoader(AxisClassLoader cl)
           
 void setCurrentMessage(Message curMsg)
          Set the current (i.e.
 void setMaintainSession(boolean yesno)
          Set whether we are maintaining session state
 void setPastPivot(boolean pastPivot)
          Indicate when we've passed the pivot
 void setProperty(java.lang.String propName, java.lang.Object propValue)
           
 void setRequestMessage(Message reqMsg)
          Set the request message, and make sure that message is associated with this MessageContext.
 void setResponseMessage(Message respMsg)
          Set the response message, and make sure that message is associated with this MessageContext.
 void setServiceDescription(ServiceDescription serviceDesc)
           
 void setServiceHandler(Handler sh)
           
 void setSession(Session session)
           
 void setTargetService(java.lang.String tServ)
          Set the target service for this message.
 void setTimeout(int value)
          Set timeout in our MessageContext.
 void setTransportName(java.lang.String transportName)
           
 void setTypeMappingRegistry(TypeMappingRegistry reg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENGINE_HANDLER

public static java.lang.String ENGINE_HANDLER
Contains an instance of Handler, which is the ServiceContext and the entrypoint of this service. (if it has been so configured - will our deployment tool do this by default? - todo by Jacek)

TRANS_URL

public static java.lang.String TRANS_URL
This String is the URL that the message came to

QUIT_REQUESTED

public static java.lang.String QUIT_REQUESTED
Has a quit been requested? Hackish... but useful... -- RobJ

USERID

public static java.lang.String USERID
A String with the user's ID (if available)

PASSWORD

public static java.lang.String PASSWORD
A String with the user's password (if available)

AUTHUSER

public static java.lang.String AUTHUSER
Place to store an AuthenticatedUser
Constructor Detail

MessageContext

public MessageContext(AxisEngine engine)
Method Detail

setTypeMappingRegistry

public void setTypeMappingRegistry(TypeMappingRegistry reg)

getTypeMappingRegistry

public TypeMappingRegistry getTypeMappingRegistry()
Get the currently in-scope type mapping registry. By default, will return a reference to the AxisEngine's TMR until someone sets our local one (usually as a result of setting the serviceHandler).
Returns:
the type mapping registry to use for this request.

getServiceDescription

public ServiceDescription getServiceDescription()

setServiceDescription

public void setServiceDescription(ServiceDescription serviceDesc)

getTransportName

public java.lang.String getTransportName()
Transport

setTransportName

public void setTransportName(java.lang.String transportName)

getSession

public Session getSession()
Sessions

setSession

public void setSession(Session session)

setMaintainSession

public void setMaintainSession(boolean yesno)
Set whether we are maintaining session state

getMaintainSession

public boolean getMaintainSession()
Are we maintaining session state?

getRequestMessage

public Message getRequestMessage()
Get the request message.
Returns:
the request message (may be null).

setRequestMessage

public void setRequestMessage(Message reqMsg)
Set the request message, and make sure that message is associated with this MessageContext.
Parameters:
reqMsg - the new request Message.

getResponseMessage

public Message getResponseMessage()
Get the response message.
Returns:
the response message (may be null).

setResponseMessage

public void setResponseMessage(Message respMsg)
Set the response message, and make sure that message is associated with this MessageContext.
Parameters:
reqMsg - the new response Message.

getCurrentMessage

public Message getCurrentMessage()
Return the current (i.e. request before the pivot, response after) message.

setCurrentMessage

public void setCurrentMessage(Message curMsg)
Set the current (i.e. request before the pivot, response after) message.

getPastPivot

public boolean getPastPivot()
Determine when we've passed the pivot

setPastPivot

public void setPastPivot(boolean pastPivot)
Indicate when we've passed the pivot

setTimeout

public void setTimeout(int value)
Set timeout in our MessageContext.
Parameters:
value - the maximum amount of time, in milliseconds

getTimeout

public int getTimeout()
Get timeout from our MessageContext.
Returns:
value the maximum amount of time, in milliseconds

getClassLoader

public AxisClassLoader getClassLoader()

setClassLoader

public void setClassLoader(AxisClassLoader cl)

getTargetService

public java.lang.String getTargetService()

getAxisEngine

public AxisEngine getAxisEngine()

setTargetService

public void setTargetService(java.lang.String tServ)
Set the target service for this message. This looks up the named service in the registry, and has the side effect of setting our TypeMappingRegistry to the service's.
Parameters:
tServ - the name of the target service.

getServiceHandler

public Handler getServiceHandler()

setServiceHandler

public void setServiceHandler(Handler sh)

getStrProp

public java.lang.String getStrProp(java.lang.String propName)
Just a util so we don't have to cast the result

getProperty

public java.lang.Object getProperty(java.lang.String propName)

setProperty

public void setProperty(java.lang.String propName,
                        java.lang.Object propValue)

clearProperty

public void clearProperty(java.lang.String propName)

reset

public void reset()


Copyright © 2001 Apache XML Project. All Rights Reserved.