|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.axis.MessageContext
A MessageContext is the Axis implementation of the javax SOAPMessageContext class, and is core to message processing in handlers and other parts of the system. 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)
| Field Summary | |
static java.lang.String |
ACCEPTMISSINGPARAMS
A boolean param, to control whether we accept missing parameters as nulls or refuse to acknowledge them. |
static java.lang.String |
ATTACHMENTS_DIR
The directory where in coming attachments are created. |
static java.lang.String |
AUTHUSER
Place to store an AuthenticatedUser. |
static java.lang.String |
CALL
If on the client - this is the Call object. |
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 |
HTTP_TRANSPORT_VERSION
The value of the property is used by service WSDL generation (aka ?WSDL). |
static java.lang.String |
IS_MSG
Are we doing Msg vs RPC? - For Java Binding. |
protected static org.apache.commons.logging.Log |
log
The Log used for logging all messages. |
static java.lang.String |
QUIT_REQUESTED
Has a quit been requested? Hackish... |
static java.lang.String |
SECURITY_PROVIDER
The security provider. |
protected static java.lang.String |
systemTempDir
Temporary directory to store attachments. |
static java.lang.String |
TRANS_URL
This String is the URL that the message came to. |
static java.lang.String |
WSDLGEN_INTFNAMESPACE
The value of the property is used by service WSDL generation (aka ?WSDL) For the service's interface namespace if not set TRANS_URL property is used. |
static java.lang.String |
WSDLGEN_SERV_LOC_URL
The value of the property is used by service WSDL generation (aka ?WSDL). |
| Constructor Summary | |
MessageContext(AxisEngine engine)
Create a message context. |
|
| Method Summary | |
boolean |
containsProperty(java.lang.String name)
Returns true if the MessageContext contains a property with the specified name. |
void |
dispose()
if a message (or subclass) has any disposal needs, this method is where it goes. |
protected void |
finalize()
during finalization, the dispose() method is called. |
java.util.Iterator |
getAllPropertyNames()
Returns an Iterator view of the names of the properties in this MessageContext and any parents of the LockableHashtable |
AxisEngine |
getAxisEngine()
Get the axis engine. |
java.lang.ClassLoader |
getClassLoader()
Get the classloader, implicitly binding to the thread context classloader if an override has not been supplied. |
static MessageContext |
getCurrentContext()
Get the active message context. |
Message |
getCurrentMessage()
Return the current (i.e. |
java.lang.String |
getEncodingStyle()
Returns the encoding style as a URI that should be used for the SOAP message. |
boolean |
getMaintainSession()
Discover if we are maintaining session state. |
SOAPMessage |
getMessage()
Gets the SOAPMessage from this message context. |
OperationDesc |
getOperation()
The current operation. |
OperationDesc |
getOperationByQName(QName qname)
get the first possible operation that could match a body containing an element of the given QName. |
Style |
getOperationStyle()
Get the operation style. |
Use |
getOperationUse()
Get the operation use. |
java.lang.String |
getPassword()
Get the password. |
boolean |
getPastPivot()
Determine when we've passed the pivot. |
OperationDesc[] |
getPossibleOperationsByQName(QName qname)
Returns a list of operation descriptors that could may possibly match a body containing an element of the given QName. |
java.lang.Object |
getProperty(java.lang.String name)
Returns the value associated with the named property - or null if not defined/set. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator view of the names of the properties in
this MessageContext. |
Message |
getRequestMessage()
Get the request message. |
Message |
getResponseMessage()
Get the response message. |
java.lang.String[] |
getRoles()
Gets the SOAP actor roles associated with an execution of the HandlerChain and its contained Handler
instances. |
SchemaVersion |
getSchemaVersion()
Get the XML schema version information. |
SOAPService |
getService()
Get the SOAPService used to handle services in this
context. |
Session |
getSession()
Get the current session. |
java.lang.String |
getSOAPActionURI()
Get the soapAction URI. |
SOAPConstants |
getSOAPConstants()
Get the SOAPConstants used by this message context. |
java.lang.String |
getStrProp(java.lang.String propName)
Get a String property by name. |
java.lang.String |
getTargetService()
Get the name of the targed service for this message. |
int |
getTimeout()
Get timeout from our MessageContext. |
java.lang.String |
getTransportName()
The name of the transport for this context. |
TypeMapping |
getTypeMapping()
Return the type mapping currently in scope for our encoding style. |
TypeMappingRegistry |
getTypeMappingRegistry()
Get the currently in-scope type mapping registry. |
java.lang.String |
getUsername()
Get the user name. |
boolean |
isClient()
Let us know whether this is the client or the server. |
boolean |
isEncoded()
Indicates if the opration is encoded. |
boolean |
isHighFidelity()
Read the high fidelity property. |
boolean |
isPropertyTrue(java.lang.String propName)
Tests to see if the named property is set in the 'bag', returning false if it is not present at all. |
boolean |
isPropertyTrue(java.lang.String propName,
boolean defaultVal)
Test if a property is set to something we consider to be true in the 'bag'. |
void |
removeProperty(java.lang.String propName)
Removes a property (name-value pair) from the MessageContext. |
void |
reset()
Return this context to a clean state. |
void |
setClassLoader(java.lang.ClassLoader cl)
Set a new classloader. |
void |
setCurrentMessage(Message curMsg)
Set the current message. |
void |
setEncodingStyle(java.lang.String namespaceURI)
Sets the encoding style to the URI passed in. |
void |
setHighFidelity(boolean highFidelity)
Set the high fidelity propert. |
void |
setMaintainSession(boolean yesno)
Set whether we are maintaining session state. |
void |
setMessage(SOAPMessage message)
Sets the SOAPMessage for this message context. |
void |
setOperation(OperationDesc operation)
Set the current operation. |
void |
setPassword(java.lang.String password)
Set the password. |
void |
setPastPivot(boolean pastPivot)
Indicate when we've passed the pivot. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Allows you to set a named property to the passed in value. |
void |
setPropertyParent(java.util.Hashtable parent)
Set the Hashtable that contains the default values for our properties. |
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 |
setRoles(java.lang.String[] roles)
Set the SOAP actor roles associated with an executioni of CodeHandlerChain and its contained Handler
instances. |
void |
setSchemaVersion(SchemaVersion schemaVersion)
Set the XML schema version this message context will use. |
void |
setService(SOAPService sh)
Set the SOAPService used to handle services in this
context. |
void |
setSession(Session session)
Set the current session. |
void |
setSOAPActionURI(java.lang.String SOAPActionURI)
Set the soapAction URI. |
void |
setSOAPConstants(SOAPConstants soapConstants)
Set the SOAPConstants used by this message context. |
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)
Set the transport name for this context. |
void |
setTypeMappingRegistry(TypeMappingRegistry reg)
Replace the engine's type mapping registry with a local one. |
void |
setUsername(java.lang.String username)
Set the username. |
void |
setUseSOAPAction(boolean useSOAPAction)
Enable or dissable the use of soap action information. |
boolean |
useSOAPAction()
Indicates wether the soap action URI is being used or not. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.commons.logging.Log log
Log used for logging all messages.
protected static java.lang.String systemTempDir
public static final java.lang.String ENGINE_HANDLER
public static final java.lang.String TRANS_URL
public static final java.lang.String QUIT_REQUESTED
public static final java.lang.String AUTHUSER
public static final java.lang.String CALL
public static final java.lang.String IS_MSG
public static final java.lang.String ATTACHMENTS_DIR
public static final java.lang.String ACCEPTMISSINGPARAMS
public static final java.lang.String WSDLGEN_INTFNAMESPACE
public static final java.lang.String WSDLGEN_SERV_LOC_URL
public static final java.lang.String HTTP_TRANSPORT_VERSION
public static final java.lang.String SECURITY_PROVIDER
| Constructor Detail |
public MessageContext(AxisEngine engine)
engine - the controlling axis engine. Null is actually accepted here,
though passing a null engine in is strongly discouraged as many of the methods
assume that it is in fact defined.| Method Detail |
public OperationDesc getOperation()
nullpublic void setOperation(OperationDesc operation)
operation - the Operation this context is executing
public OperationDesc[] getPossibleOperationsByQName(QName qname)
throws AxisFault
qname - of the first element in the body
AxisFault - if the operation names could not be looked up
public OperationDesc getOperationByQName(QName qname)
throws AxisFault
qname - name of the message body
AxisFaultpublic static MessageContext getCurrentContext()
protected void finalize()
dispose()public void setTypeMappingRegistry(TypeMappingRegistry reg)
reg - the new TypeMappingRegistrypublic TypeMappingRegistry getTypeMappingRegistry()
public TypeMapping getTypeMapping()
public java.lang.String getTransportName()
public void setTransportName(java.lang.String transportName)
transportName - the name of the transportpublic SOAPConstants getSOAPConstants()
SOAPConstants used by this message context.
public void setSOAPConstants(SOAPConstants soapConstants)
SOAPConstants used by this message context.
This may also affect the encoding style.
soapConstants - the new soap constants to usepublic SchemaVersion getSchemaVersion()
SchemaVersion in usepublic void setSchemaVersion(SchemaVersion schemaVersion)
schemaVersion - the new SchemaVersionpublic Session getSession()
Session this message context is withinpublic void setSession(Session session)
session - the new Sessionpublic boolean isEncoded()
true if it is encoded, false otherwisepublic void setMaintainSession(boolean yesno)
yesno - flag to set to true to maintain sessionspublic boolean getMaintainSession()
true if we are maintaining state, false
otherwisepublic Message getRequestMessage()
public void setRequestMessage(Message reqMsg)
reqMsg - the new request Message.public Message getResponseMessage()
public void setResponseMessage(Message respMsg)
respMsg - the new response Message.public Message getCurrentMessage()
Messagepublic SOAPMessage getMessage()
getMessage in interface SOAPMessageContextSOAPMessage, null if no request
SOAPMessage is present in this
SOAPMessageContextpublic void setCurrentMessage(Message curMsg)
curMsg - the Message to assignpublic void setMessage(SOAPMessage message)
message to
Message and then passing it on to
setCurrentMessage().
setMessage in interface SOAPMessageContextmessage - the SOAPMessage this context is forpublic boolean getPastPivot()
true if we have, false otherwisepublic void setPastPivot(boolean pastPivot)
pastPivot - true if we are past the pivot point, false otherwisepublic void setTimeout(int value)
value - the maximum amount of time, in millisecondspublic int getTimeout()
public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader cl)
cl - the new ClassLoader or nullpublic java.lang.String getTargetService()
public AxisEngine getAxisEngine()
null if the message was
created outside an engine
public void setTargetService(java.lang.String tServ)
throws AxisFault
This looks up the named service in the registry, and has the side effect of setting our TypeMappingRegistry to the service's.
tServ - the name of the target service
AxisFault - if anything goes wrong in resolving or setting the
servicepublic SOAPService getService()
SOAPService used to handle services in this
context.
public void setService(SOAPService sh)
throws AxisFault
SOAPService used to handle services in this
context. This method configures a wide range of
MessageContext properties to suit the handler.
sh - the new service handler
AxisFault - if the service could not be setpublic boolean isClient()
public java.lang.String getStrProp(java.lang.String propName)
String property by name.
propName - the name of the property to fetch
java.lang.ClassCastException - if the property named does not have a
String valuepublic boolean isPropertyTrue(java.lang.String propName)
false if it is not present at all.
This is equivalent to isPropertyTrue(propName, false).
propName - the name of the property to check
public boolean isPropertyTrue(java.lang.String propName,
boolean defaultVal)
defaultVal is returned.Boolean, we'll return booleanValue()Integer, we'll return false
if its 0 else trueString we'll return false if its
"false"" or "0" else truetrue
propName - the name of the property to checkdefaultVal - the default value
public void setProperty(java.lang.String name,
java.lang.Object value)
setProperty in interface MessageContextname - Name of the propertyvalue - Value of the propertypublic boolean containsProperty(java.lang.String name)
containsProperty in interface MessageContextname - Name of the property whose presense is to be tested
public java.util.Iterator getPropertyNames()
Iterator view of the names of the properties in
this MessageContext.
getPropertyNames in interface MessageContextIterator over all property namespublic java.util.Iterator getAllPropertyNames()
public java.lang.Object getProperty(java.lang.String name)
getProperty in interface MessageContextname - the property name
public void setPropertyParent(java.util.Hashtable parent)
parent - public void setUsername(java.lang.String username)
username - the new user namepublic java.lang.String getUsername()
Stringpublic void setPassword(java.lang.String password)
password - a String containing the new passwordpublic java.lang.String getPassword()
Stringpublic Style getOperationStyle()
Style.RPC.
Style of this messagepublic Use getOperationUse()
Usepublic void setUseSOAPAction(boolean useSOAPAction)
useSOAPAction - true if soap action URI information
should be used, false otherwisepublic boolean useSOAPAction()
true if it is, false otherwise
public void setSOAPActionURI(java.lang.String SOAPActionURI)
throws java.lang.IllegalArgumentException
SOAPActionURI - a String giving the new soap action
URI
java.lang.IllegalArgumentException - if the URI is not likedpublic java.lang.String getSOAPActionURI()
public void setEncodingStyle(java.lang.String namespaceURI)
namespaceURI - URI of the encoding to use.public java.lang.String getEncodingStyle()
public void removeProperty(java.lang.String propName)
MessageContextMessageContext.
removeProperty in interface MessageContextpropName - the name of the property to be removedpublic void reset()
public boolean isHighFidelity()
Some behavior may be apropreate for high fidelity contexts that is not relevant for low fidelity ones or vica-versa.
true if the context is high fidelity,
false otherwisepublic void setHighFidelity(boolean highFidelity)
Users of the context may be changing what they do based upon this flag.
highFidelity - the new value of the highFidelity propertypublic java.lang.String[] getRoles()
HandlerChain and its contained Handler
instances.
Not (yet) implemented method in the SOAPMessageContext interface.
Note: SOAP actor roles apply to the SOAP node and are managed
using HandlerChain.setRoles() and
HandlerChain.getRoles(). Handler instances in the
HandlerChain use this information about the SOAP actor roles
to process the SOAP header blocks. Note that the SOAP actor roles are
invariant during the processing of SOAP message through the
HandlerChain.
getRoles in interface SOAPMessageContextHandlerChain.setRoles(java.lang.String[]),
HandlerChain.getRoles()public void setRoles(java.lang.String[] roles)
CodeHandlerChain and its contained Handler
instances.
roles - an array of String instances, each representing
the URI for a SOAP actor rolepublic void dispose()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||