Package org.apache.axis2.jaxws.core
Class MessageContext
- java.lang.Object
-
- org.apache.axis2.jaxws.core.MessageContext
-
public class MessageContext extends Object
Theorg.apache.axis2.jaxws.core.MessageContextis an interface that extends the JAX-WS 2.0javax.xml.ws.handler.MessageContextdefined in the spec. This encapsulates all of the functionality needed of the MessageContext for the other JAX-WS spec pieces (the handlers for example) and also provides the needed bits of contextual information for the rest of the JAX-WS implementation. Specifically, this is responsible for providing APIs so that the client and server implementation portions can get to the Message, defined by the Message Model format and also any metadata that is available.
-
-
Constructor Summary
Constructors Constructor Description MessageContext()Construct a MessageContext without a prior Axis2 MessageContext (usage outbound dispatch/proxy)MessageContext(MessageContext mc)Construct a MessageContext with a prior MessageContext (usage inbound client/server or outbound server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(Object key)voidfreeInputStream()Free the resources associated with the incoming input stream.MessageContextgetAxisMessageContext()AxisFaultgetCausedByException()ClassLoadergetClassLoader()EndpointDescriptiongetEndpointDescription()InvocationContextgetInvocationContext()ThrowablegetLocalException()The local exception is the Throwable object held on the Message from a problem that occurred due to something other than the server.MEPContextgetMEPContext()MessagegetMessage()Service.ModegetMode()OperationDescriptiongetOperationDescription()QNamegetOperationName()Map<String,Object>getProperties()ObjectgetProperty(String key)booleanisMaintainSession()Used to determine whether or not session state has been enabled.booleanisOutbound()booleanisServer()voidsetCausedByException(AxisFault t)voidsetEndpointDescription(EndpointDescription ed)voidsetInvocationContext(InvocationContext ic)voidsetLocalException(Throwable t)The local exception is the Throwable object held on the Message from a problem that occurred due to something other than the server.voidsetMEPContext(MEPContext mepCtx)Set the wrapper MEPContext.voidsetMessage(Message msg)voidsetMode(Service.Mode m)voidsetOperationDescription(OperationDescription od)voidsetOperationName(QName op)voidsetOutbound(boolean isOutbound)voidsetProperties(Map<String,Object> _properties)ObjectsetProperty(String key, Object value)voidsetPropertyNoReturn(String key, Object value)Like getProperty, but does not return prior value.voidsetServer(boolean isServer)Indicate if server role
-
-
-
Constructor Detail
-
MessageContext
public MessageContext()
Construct a MessageContext without a prior Axis2 MessageContext (usage outbound dispatch/proxy)
-
MessageContext
public MessageContext(MessageContext mc) throws WebServiceException
Construct a MessageContext with a prior MessageContext (usage inbound client/server or outbound server)- Parameters:
mc-- Throws:
WebServiceException
-
-
Method Detail
-
getInvocationContext
public InvocationContext getInvocationContext()
-
setInvocationContext
public void setInvocationContext(InvocationContext ic)
-
containsKey
public boolean containsKey(Object key)
-
setPropertyNoReturn
public void setPropertyNoReturn(String key, Object value)
Like getProperty, but does not return prior value. This method should be used in scenarios where the prior value is not needed.- Parameters:
key- Stringvalue- Object
-
getEndpointDescription
public EndpointDescription getEndpointDescription()
-
setEndpointDescription
public void setEndpointDescription(EndpointDescription ed)
-
getOperationDescription
public OperationDescription getOperationDescription()
-
setOperationDescription
public void setOperationDescription(OperationDescription od)
-
getMode
public Service.Mode getMode()
-
setMode
public void setMode(Service.Mode m)
-
getOperationName
public QName getOperationName()
-
setOperationName
public void setOperationName(QName op)
-
setMessage
public void setMessage(Message msg)
-
getMessage
public Message getMessage()
-
getAxisMessageContext
public MessageContext getAxisMessageContext()
-
getClassLoader
public ClassLoader getClassLoader()
-
isMaintainSession
public boolean isMaintainSession()
Used to determine whether or not session state has been enabled.- Returns:
-
getLocalException
public Throwable getLocalException()
The local exception is the Throwable object held on the Message from a problem that occurred due to something other than the server. In other words, no message ever travelled across the wire.- Returns:
- the Throwable object or null
-
setLocalException
public void setLocalException(Throwable t)
The local exception is the Throwable object held on the Message from a problem that occurred due to something other than the server. In other words, no message ever travelled across the wire.- Parameters:
t-- See Also:
Throwable
-
setCausedByException
public void setCausedByException(AxisFault t)
- Parameters:
t-
-
getCausedByException
public AxisFault getCausedByException()
- Returns:
-
setMEPContext
public void setMEPContext(MEPContext mepCtx)
Set the wrapper MEPContext. Internally, this method also sets the MEPContext's children so the pointer is bi-directional; you can get the MEPContext from the MessageContext and vice-versa.- Parameters:
mepCtx-
-
getMEPContext
public MEPContext getMEPContext()
-
isOutbound
public boolean isOutbound()
- Returns:
- if outbound MessageContext
-
setOutbound
public void setOutbound(boolean isOutbound)
- Parameters:
isOutbound- true if outbound MessageContext
-
isServer
public boolean isServer()
- Returns:
- true if server role
-
setServer
public void setServer(boolean isServer)
Indicate if server role- Parameters:
isServer-
-
freeInputStream
public void freeInputStream() throws IOExceptionFree the resources associated with the incoming input stream. (i.e. HTTPInputStream) This allows the transport layer to free resources and pool connections- Throws:
IOException
-
-