MessageContext (Java Platform SE 8 ) (original) (raw)
- All Superinterfaces:
Map<String,Object>
All Known Subinterfaces:
LogicalMessageContext, SOAPMessageContext
public interface MessageContext
extends Map<String,Object>
The interface 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
Nested Class Summary
Nested Classes
Modifier and Type Interface Description static class MessageContext.Scope Property scope. * ### Nested classes/interfaces inherited from interface java.util.[Map](../../../../java/util/Map.html "interface in java.util") `[Map.Entry](../../../../java/util/Map.Entry.html "interface in java.util")<[K](../../../../java/util/Map.Entry.html "type parameter in Map.Entry"),[V](../../../../java/util/Map.Entry.html "type parameter in Map.Entry")>`
Field Summary
Fields
Modifier and Type Field Description static String HTTP_REQUEST_HEADERS Standard property: HTTP request headers. static String HTTP_REQUEST_METHOD Standard property: HTTP request method. static String HTTP_RESPONSE_CODE Standard property: HTTP response status code. static String HTTP_RESPONSE_HEADERS Standard property: HTTP response headers. static String INBOUND_MESSAGE_ATTACHMENTS Standard property: Map of attachments to a message for the inbound message, key is the MIME Content-ID, value is a DataHandler. static String MESSAGE_OUTBOUND_PROPERTY Standard property: message direction, true for outbound messages, false for inbound. static String OUTBOUND_MESSAGE_ATTACHMENTS Standard property: Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler. static String PATH_INFO Standard property: Request Path Info static String QUERY_STRING Standard property: Query string for request. static String REFERENCE_PARAMETERS Standard property: WS Addressing Reference Parameters. static String SERVLET_CONTEXT Standard property: servlet context object. static String SERVLET_REQUEST Standard property: servlet request object. static String SERVLET_RESPONSE Standard property: servlet response object. static String WSDL_DESCRIPTION Standard property: input source for WSDL document. static String WSDL_INTERFACE Standard property: name of wsdl interface (2.0) or port type (1.1). static String WSDL_OPERATION Standard property: name of WSDL operation. static String WSDL_PORT Standard property: name of WSDL port. static String WSDL_SERVICE Standard property: name of WSDL service. Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type Method Description MessageContext.Scope getScope(String name) Gets the scope of a property. void setScope(String name,MessageContext.Scope scope) Sets the scope of a property. * ### Methods inherited from interface java.util.[Map](../../../../java/util/Map.html "interface in java.util") `[clear](../../../../java/util/Map.html#clear--), [compute](../../../../java/util/Map.html#compute-K-java.util.function.BiFunction-), [computeIfAbsent](../../../../java/util/Map.html#computeIfAbsent-K-java.util.function.Function-), [computeIfPresent](../../../../java/util/Map.html#computeIfPresent-K-java.util.function.BiFunction-), [containsKey](../../../../java/util/Map.html#containsKey-java.lang.Object-), [containsValue](../../../../java/util/Map.html#containsValue-java.lang.Object-), [entrySet](../../../../java/util/Map.html#entrySet--), [equals](../../../../java/util/Map.html#equals-java.lang.Object-), [forEach](../../../../java/util/Map.html#forEach-java.util.function.BiConsumer-), [get](../../../../java/util/Map.html#get-java.lang.Object-), [getOrDefault](../../../../java/util/Map.html#getOrDefault-java.lang.Object-V-), [hashCode](../../../../java/util/Map.html#hashCode--), [isEmpty](../../../../java/util/Map.html#isEmpty--), [keySet](../../../../java/util/Map.html#keySet--), [merge](../../../../java/util/Map.html#merge-K-V-java.util.function.BiFunction-), [put](../../../../java/util/Map.html#put-K-V-), [putAll](../../../../java/util/Map.html#putAll-java.util.Map-), [putIfAbsent](../../../../java/util/Map.html#putIfAbsent-K-V-), [remove](../../../../java/util/Map.html#remove-java.lang.Object-), [remove](../../../../java/util/Map.html#remove-java.lang.Object-java.lang.Object-), [replace](../../../../java/util/Map.html#replace-K-V-), [replace](../../../../java/util/Map.html#replace-K-V-V-), [replaceAll](../../../../java/util/Map.html#replaceAll-java.util.function.BiFunction-), [size](../../../../java/util/Map.html#size--), [values](../../../../java/util/Map.html#values--)`
Field Detail
* #### MESSAGE\_OUTBOUND\_PROPERTY static final [String](../../../../java/lang/String.html "class in java.lang") MESSAGE_OUTBOUND_PROPERTY Standard property: message direction, `true` for outbound messages, `false` for inbound. Type: boolean See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.MESSAGE%5FOUTBOUND%5FPROPERTY) * #### INBOUND\_MESSAGE\_ATTACHMENTS static final [String](../../../../java/lang/String.html "class in java.lang") INBOUND_MESSAGE_ATTACHMENTS Standard property: Map of attachments to a message for the inbound message, key is the MIME Content-ID, value is a DataHandler. Type: java.util.Map<String,DataHandler> See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.INBOUND%5FMESSAGE%5FATTACHMENTS) * #### OUTBOUND\_MESSAGE\_ATTACHMENTS static final [String](../../../../java/lang/String.html "class in java.lang") OUTBOUND_MESSAGE_ATTACHMENTS Standard property: Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler. Type: java.util.Map<String,DataHandler> See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.OUTBOUND%5FMESSAGE%5FATTACHMENTS) * #### WSDL\_DESCRIPTION static final [String](../../../../java/lang/String.html "class in java.lang") WSDL_DESCRIPTION Standard property: input source for WSDL document. Type: org.xml.sax.InputSource See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.WSDL%5FDESCRIPTION) * #### WSDL\_SERVICE static final [String](../../../../java/lang/String.html "class in java.lang") WSDL_SERVICE Standard property: name of WSDL service. Type: javax.xml.namespace.QName See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.WSDL%5FSERVICE) * #### WSDL\_PORT static final [String](../../../../java/lang/String.html "class in java.lang") WSDL_PORT Standard property: name of WSDL port. Type: javax.xml.namespace.QName See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.WSDL%5FPORT) * #### WSDL\_INTERFACE static final [String](../../../../java/lang/String.html "class in java.lang") WSDL_INTERFACE Standard property: name of wsdl interface (2.0) or port type (1.1). Type: javax.xml.namespace.QName See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.WSDL%5FINTERFACE) * #### WSDL\_OPERATION static final [String](../../../../java/lang/String.html "class in java.lang") WSDL_OPERATION Standard property: name of WSDL operation. Type: javax.xml.namespace.QName See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.WSDL%5FOPERATION) * #### HTTP\_RESPONSE\_CODE static final [String](../../../../java/lang/String.html "class in java.lang") HTTP_RESPONSE_CODE Standard property: HTTP response status code. Type: java.lang.Integer See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.HTTP%5FRESPONSE%5FCODE) * #### HTTP\_REQUEST\_HEADERS static final [String](../../../../java/lang/String.html "class in java.lang") HTTP_REQUEST_HEADERS Standard property: HTTP request headers. Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>> See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.HTTP%5FREQUEST%5FHEADERS) * #### HTTP\_RESPONSE\_HEADERS static final [String](../../../../java/lang/String.html "class in java.lang") HTTP_RESPONSE_HEADERS Standard property: HTTP response headers. Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>> See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.HTTP%5FRESPONSE%5FHEADERS) * #### HTTP\_REQUEST\_METHOD static final [String](../../../../java/lang/String.html "class in java.lang") HTTP_REQUEST_METHOD Standard property: HTTP request method. Type: java.lang.String See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.HTTP%5FREQUEST%5FMETHOD) * #### SERVLET\_REQUEST static final [String](../../../../java/lang/String.html "class in java.lang") SERVLET_REQUEST Standard property: servlet request object. Type: javax.servlet.http.HttpServletRequest See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.SERVLET%5FREQUEST) * #### SERVLET\_RESPONSE static final [String](../../../../java/lang/String.html "class in java.lang") SERVLET_RESPONSE Standard property: servlet response object. Type: javax.servlet.http.HttpServletResponse See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.SERVLET%5FRESPONSE) * #### SERVLET\_CONTEXT static final [String](../../../../java/lang/String.html "class in java.lang") SERVLET_CONTEXT Standard property: servlet context object. Type: javax.servlet.ServletContext See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.SERVLET%5FCONTEXT) * #### QUERY\_STRING static final [String](../../../../java/lang/String.html "class in java.lang") QUERY_STRING Standard property: Query string for request. Type: String See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.QUERY%5FSTRING) * #### PATH\_INFO static final [String](../../../../java/lang/String.html "class in java.lang") PATH_INFO Standard property: Request Path Info Type: String See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.PATH%5FINFO) * #### REFERENCE\_PARAMETERS static final [String](../../../../java/lang/String.html "class in java.lang") REFERENCE_PARAMETERS Standard property: WS Addressing Reference Parameters. The list MUST include all SOAP headers marked with the wsa:IsReferenceParameter="true" attribute. Type: List<Element> Since: JAX-WS 2.1 See Also: [Constant Field Values](../../../../constant-values.html#javax.xml.ws.handler.MessageContext.REFERENCE%5FPARAMETERS)
Method Detail
* #### setScope void setScope([String](../../../../java/lang/String.html "class in java.lang") name, [MessageContext.Scope](../../../../javax/xml/ws/handler/MessageContext.Scope.html "enum in javax.xml.ws.handler") scope) Sets the scope of a property. Parameters: `name` \- Name of the property associated with the`MessageContext` `scope` \- Desired scope of the property Throws: `[IllegalArgumentException](../../../../java/lang/IllegalArgumentException.html "class in java.lang")` \- if an illegal property name is specified * #### getScope [MessageContext.Scope](../../../../javax/xml/ws/handler/MessageContext.Scope.html "enum in javax.xml.ws.handler") getScope([String](../../../../java/lang/String.html "class in java.lang") name) Gets the scope of a property. Parameters: `name` \- Name of the property Returns: Scope of the property Throws: `[IllegalArgumentException](../../../../java/lang/IllegalArgumentException.html "class in java.lang")` \- if a non-existant property name is specified
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.