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 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()
           
 AxisClassLoader getClassLoader(java.lang.String name)
           
 Message getCurrentMessage()
          Return the current (i.e.
 boolean getMaintainSession()
          Are we maintaining session state?
 boolean getPastPivot()
          Determine when we've past the pivot
 java.lang.Object getProperty(java.lang.String propName)
           
 Message getRequestMessage()
          Placeholder.
 Message getResponseMessage()
          Placeholder.
 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 past the pivot
 void setProperty(java.lang.String propName, java.lang.Object propValue)
           
 void setRequestMessage(Message reqMsg)
          Placeholder.
 void setResponseMessage(Message respMsg)
          Placeholder.
 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)
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()
Placeholder.

setRequestMessage

public void setRequestMessage(Message reqMsg)
Placeholder.

getResponseMessage

public Message getResponseMessage()
Placeholder.

setResponseMessage

public void setResponseMessage(Message respMsg)
Placeholder.

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 past the pivot

setPastPivot

public void setPastPivot(boolean pastPivot)
Indicate when we've past 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()

getClassLoader

public AxisClassLoader getClassLoader(java.lang.String name)

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.