org.apache.axis
public class MessageContext extends Object implements SOAPMessageContext
Field Summary | |
---|---|
static String | ACCEPTMISSINGPARAMS A boolean param, to control whether we accept missing parameters
as nulls or refuse to acknowledge them. |
static String | ATTACHMENTS_DIR The directory where in coming attachments are created. |
static String | AUTHUSER Place to store an AuthenticatedUser. |
static String | CALL If on the client - this is the Call object. |
static 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? |
static String | HTTP_TRANSPORT_VERSION The value of the property is used by service WSDL generation (aka ? |
static String | IS_MSG Are we doing Msg vs RPC? |
protected static Log | log The Log used for logging all messages. |
static String | QUIT_REQUESTED Has a quit been requested? |
protected static String | systemTempDir
Temporary directory to store attachments. |
static String | SECURITY_PROVIDER
The security provider. |
static String | TRANS_URL This String is the URL that the message came to. |
static String | WSDLGEN_INTFNAMESPACE The value of the property is used by service WSDL generation (aka ? |
static String | WSDLGEN_SERV_LOC_URL The value of the property is used by service WSDL generation (aka ? |
Constructor Summary | |
---|---|
MessageContext(AxisEngine engine)
Create a message context. |
Method Summary | |
---|---|
boolean | containsProperty(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. |
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. |
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. request before the pivot, response after)
message.
|
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.
|
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.
|
Object | getProperty(String name)
Returns the value associated with the named property - or null if not
defined/set.
|
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.
|
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.
|
String | getSOAPActionURI()
Get the soapAction URI.
|
SOAPConstants | getSOAPConstants()
Get the SOAPConstants used by this message context.
|
String | getStrProp(String propName)
Get a String property by name.
|
String | getTargetService()
Get the name of the targed service for this message.
|
int | getTimeout()
Get timeout from our MessageContext.
|
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.
|
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(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(String propName, boolean defaultVal)
Test if a property is set to something we consider to be true in the
'bag'.
|
void | removeProperty(String propName) |
void | reset()
Return this context to a clean state. |
void | setClassLoader(ClassLoader cl)
Set a new classloader. |
void | setCurrentMessage(Message curMsg)
Set the current message. |
void | setEncodingStyle(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(String password)
Set the password.
|
void | setPastPivot(boolean pastPivot)
Indicate when we've passed the pivot.
|
void | setProperty(String name, Object value)
Allows you to set a named property to the passed in value.
|
void | setPropertyParent(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(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(String SOAPActionURI)
Set the soapAction URI.
|
void | setSOAPConstants(SOAPConstants soapConstants)
Set the SOAPConstants used by this message context.
|
void | setTargetService(String tServ)
Set the target service for this message.
|
void | setTimeout(int value)
Set timeout in our MessageContext.
|
void | setTransportName(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(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.
|
Log
used for logging all messages.Parameters: 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.
Parameters: name Name of the property whose presense is to be tested
Returns: Returns true if the MessageContext contains the property; otherwise false
See Also: dispose
Returns: Iterator for the property names
null
if the message was
created outside an engine
Returns: the current axis engine
Returns: the class loader
Returns: the current active message context
Returns: the current Message
Returns: String URI of the encoding style to use
Returns: true
if we are maintaining state, false
otherwise
Returns: the SOAPMessage
, null
if no request
SOAPMessage
is present in this
SOAPMessageContext
Returns: the current operation; may be null
Parameters: qname name of the message body
Returns: an operation or null
Throws: AxisFault
Style.RPC
.
Returns: the Style
of this message
Returns: the operation Use
Returns: the current password String
Returns: true
if we have, false
otherwise
Parameters: qname of the first element in the body
Returns: list of operation descriptions
Throws: AxisFault if the operation names could not be looked up
Parameters: name the property name
Returns: Object value of the property - or null
Iterator
view of the names of the properties in
this MessageContext
.
Returns: an Iterator
over all property names
Returns: the request message (may be null).
Returns: the response message (may be null).
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
.
Returns: an array of URIs for SOAP actor roles
See Also: (java.lang.String[]) HandlerChain.setRoles(java.lang.String[])
HandlerChain.getRoles()
Returns: the SchemaVersion
in use
SOAPService
used to handle services in this
context.
Returns: the service handler
Returns: the Session
this message context is within
Returns: the URI of this soap action
SOAPConstants
used by this message context.
Returns: the soap constants
String
property by name.
Parameters: propName the name of the property to fetch
Returns: the value of the named property
Throws: ClassCastException if the property named does not have a
String
value
Returns: the target service
Returns: value the maximum amount of time, in milliseconds
Returns: the transport name
Returns: the type mapping
Returns: the type mapping registry to use for this request.
Returns: the user name as a String
Returns: true if we are a client
Returns: true
if it is encoded, false
otherwise
Some behavior may be apropreate for high fidelity contexts that is not relevant for low fidelity ones or vica-versa.
Returns: true
if the context is high fidelity,
false
otherwise
false
if it is not present at all.
This is equivalent to isPropertyTrue(propName, false)
.
Parameters: propName the name of the property to check
Returns: true or false, depending on the value of the property
defaultVal
is returned.Boolean
, we'll return booleanValue()Integer
, we'll return false
if its 0
else true
String
we'll return false
if its
"false"
" or "0"
else true
true
Parameters: propName the name of the property to check defaultVal the default value
Returns: true or false, depending on the value of the property
Parameters: cl the new ClassLoader
or null
Parameters: curMsg the Message
to assign
Parameters: namespaceURI URI of the encoding to use.
Users of the context may be changing what they do based upon this flag.
Parameters: highFidelity the new value of the highFidelity property
Parameters: yesno flag to set to true
to maintain sessions
message
to
Message
and then passing it on to
setCurrentMessage()
.
Parameters: message the SOAPMessage
this context is for
Parameters: operation the Operation
this context is executing
Parameters: password a String
containing the new password
Parameters: pastPivot true if we are past the pivot point, false otherwise
Parameters: name Name of the property value Value of the property
Parameters: parent
Parameters: reqMsg the new request Message.
Parameters: respMsg the new response Message.
CodeHandlerChain
and its contained Handler
instances.
Parameters: roles an array of String
instances, each representing
the URI for a SOAP actor role
Parameters: schemaVersion the new SchemaVersion
SOAPService
used to handle services in this
context. This method configures a wide range of
MessageContext
properties to suit the handler.
Parameters: sh the new service handler
Throws: AxisFault if the service could not be set
Parameters: session the new Session
Parameters: SOAPActionURI a String
giving the new soap action
URI
Throws: IllegalArgumentException if the URI is not liked
SOAPConstants
used by this message context.
This may also affect the encoding style.
Parameters: soapConstants the new soap constants to use
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
Throws: AxisFault if anything goes wrong in resolving or setting the service
Parameters: value the maximum amount of time, in milliseconds
Parameters: transportName the name of the transport
Parameters: reg the new TypeMappingRegistry
Parameters: username the new user name
Parameters: useSOAPAction true
if soap action URI information
should be used, false
otherwise
Returns: true
if it is, false
otherwise