001 /*
002 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package javax.xml.ws.handler;
027
028 import java.util.Map;
029
030 /** The interface <code>MessageContext</code> abstracts the message
031 * context that is processed by a handler in the <code>handle</code>
032 * method.
033 *
034 * <p>The <code>MessageContext</code> interface provides methods to
035 * manage a property set. <code>MessageContext</code> properties
036 * enable handlers in a handler chain to share processing related
037 * state.
038 *
039 * @since JAX-WS 2.0
040 **/
041 public interface MessageContext extends Map<String, Object> {
042
043 /** Standard property: message direction, <code>true</code> for
044 * outbound messages, <code>false</code> for inbound.
045 * <p>Type: boolean
046 **/
047 public static final String MESSAGE_OUTBOUND_PROPERTY = "javax.xml.ws.handler.message.outbound";
048
049 /** Standard property: Map of attachments to a message for the inbound
050 * message, key is the MIME Content-ID, value is a DataHandler.
051 * <p>Type: java.util.Map<String,DataHandler>
052 **/
053 public static final String INBOUND_MESSAGE_ATTACHMENTS = "javax.xml.ws.binding.attachments.inbound";
054
055 /** Standard property: Map of attachments to a message for the outbound
056 * message, key is the MIME Content-ID, value is a DataHandler.
057 * <p>Type: java.util.Map<String,DataHandler>
058 **/
059 public static final String OUTBOUND_MESSAGE_ATTACHMENTS = "javax.xml.ws.binding.attachments.outbound";
060
061 /** Standard property: input source for WSDL document.
062 * <p>Type: org.xml.sax.InputSource
063 **/
064 public static final String WSDL_DESCRIPTION = "javax.xml.ws.wsdl.description";
065
066 /** Standard property: name of WSDL service.
067 * <p>Type: javax.xml.namespace.QName
068 **/
069 public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
070
071 /** Standard property: name of WSDL port.
072 * <p>Type: javax.xml.namespace.QName
073 **/
074 public static final String WSDL_PORT = "javax.xml.ws.wsdl.port";
075
076 /** Standard property: name of wsdl interface (2.0) or port type (1.1).
077 * <p>Type: javax.xml.namespace.QName
078 **/
079 public static final String WSDL_INTERFACE = "javax.xml.ws.wsdl.interface";
080
081 /** Standard property: name of WSDL operation.
082 * <p>Type: javax.xml.namespace.QName
083 **/
084 public static final String WSDL_OPERATION = "javax.xml.ws.wsdl.operation";
085
086 /** Standard property: HTTP response status code.
087 * <p>Type: java.lang.Integer
088 **/
089 public static final String HTTP_RESPONSE_CODE = "javax.xml.ws.http.response.code";
090
091 /** Standard property: HTTP request headers.
092 * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
093 **/
094 public static final String HTTP_REQUEST_HEADERS = "javax.xml.ws.http.request.headers";
095
096 /** Standard property: HTTP response headers.
097 * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
098 **/
099 public static final String HTTP_RESPONSE_HEADERS = "javax.xml.ws.http.response.headers";
100
101 /** Standard property: HTTP request method.
102 * <p>Type: java.lang.String
103 **/
104 public static final String HTTP_REQUEST_METHOD = "javax.xml.ws.http.request.method";
105
106 /** Standard property: servlet request object.
107 * <p>Type: javax.servlet.http.HttpServletRequest
108 **/
109 public static final String SERVLET_REQUEST = "javax.xml.ws.servlet.request";
110
111 /** Standard property: servlet response object.
112 * <p>Type: javax.servlet.http.HttpServletResponse
113 **/
114 public static final String SERVLET_RESPONSE = "javax.xml.ws.servlet.response";
115
116 /** Standard property: servlet context object.
117 * <p>Type: javax.servlet.ServletContext
118 **/
119 public static final String SERVLET_CONTEXT = "javax.xml.ws.servlet.context";
120
121 /** Standard property: Query string for request.
122 * <p>Type: String
123 **/
124 public static final String QUERY_STRING = "javax.xml.ws.http.request.querystring";
125
126 /** Standard property: Request Path Info
127 * <p>Type: String
128 **/
129 public static final String PATH_INFO = "javax.xml.ws.http.request.pathinfo";
130
131 /**
132 * Property scope. Properties scoped as <code>APPLICATION</code> are
133 * visible to handlers,
134 * client applications and service endpoints; properties scoped as
135 * <code>HANDLER</code>
136 * are only normally visible to handlers.
137 **/
138 public enum Scope {
139 APPLICATION, HANDLER
140 };
141
142 /** Sets the scope of a property.
143 *
144 * @param name Name of the property associated with the
145 * <code>MessageContext</code>
146 * @param scope Desired scope of the property
147 * @throws java.lang.IllegalArgumentException if an illegal
148 * property name is specified
149 *
150 **/
151 public void setScope(String name, Scope scope);
152
153 /** Gets the scope of a property.
154 *
155 * @param name Name of the property
156 * @return Scope of the property
157 * @throws java.lang.IllegalArgumentException if a non-existant
158 * property name is specified
159 *
160 **/
161 public Scope getScope(String name);
162 }
|