In order to use this, just add the line below in the code:
@Inject MessageContext messageContext;
@author SERPRO
@see Message
MessageContext
abstracts the message context that is processed by a handler in the handle
method. The MessageContext
interface provides methods to manage a property set. MessageContext
properties enable handlers in a handler chain to share processing related state.
@since JAX-WS 2.0
Axis2 states are held in two information models, called description hierarchy and context hierarchy. Description hierarchy hold deployment configuration and it's values does not change unless deployment configuration change occurs where Context hierarchy hold run time information. Both hierarchies consists four levels, Global, Service Group, Operation and Message. Please look at "Information Model" section of "Axis2 Architecture Guide" for more information.
MessageContext hold run time information about one Message invocation. It hold reference to OperationContext, ServiceGroupContext, and Configuration Context tied with current message. For an example if you need accesses to other messages of the current invocation, you can get to them via OperationContext. Addition to class attributes define in Message context, message context stores the information as name value pairs. Those name value pairs,and class attributes tweak the execution behavior of message context and some of them can be find in org.apache.axis2.Constants class. (TODO we should provide list of supported options). You may set them at any level of context hierarchy and they will affect invocations related to their child elements.
org.apache.axis2.jaxws.core.MessageContext
is an interface that extends the JAX-WS 2.0 javax.xml.ws.handler.MessageContext
defined 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.
A good example is {@link org.araneaframework.framework.filter.StandardMessagingFilterWidget}. It registers a MessageContext in the environment and if a childservice needs to output a message which should have a consistent look (location on the screen, styles etc.) it adds the message via showMessage(String,String)
.
A top level widget can use the MessageContext from the environment to output the accumulated messages.
@author "Toomas Römer"Contains both the message request as well as the response. Response message are usually lazily created (but do not have to be).
Also contains properties, which can be used to by {@link EndpointInterceptor interceptors} to pass information on toendpoints. @author Arjen Poutsma @since 1.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|