KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > ws > handler > MessageContext


1 /*
2  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.ws.handler;
7 import java.util.Map JavaDoc;
8
9 /**
10  * The interface <code>MessageContext</code> abstracts the message
11  * context that is processed by a handler in the <code>handle</code>
12  * method.
13  *
14  * <p>The <code>MessageContext</code> interface provides methods to
15  * manage a property set. <code>MessageContext</code> properties
16  * enable handlers in a handler chain to share processing related
17  * state.
18  *
19  * @since JAX-WS 2.0
20  */

21 public interface MessageContext extends Map JavaDoc<String JavaDoc, Object JavaDoc> {
22     
23     /**
24      * Standard property: message direction, <code>true</code> for
25      * outbound messages, <code>false</code> for inbound.
26      * <p>Type: boolean
27      */

28     public static final String JavaDoc MESSAGE_OUTBOUND_PROPERTY =
29             "javax.xml.ws.handler.message.outbound";
30     
31     /**
32      * Standard property: Map of attachments to a message for the inbound
33      * message, key is the MIME Content-ID, value is a DataHandler.
34      * <p>Type: java.util.Map<String,DataHandler>
35      */

36     public static final String JavaDoc INBOUND_MESSAGE_ATTACHMENTS =
37             "javax.xml.ws.binding.attachments.inbound";
38     
39     /**
40      * Standard property: Map of attachments to a message for the outbound
41      * message, key is the MIME Content-ID, value is a DataHandler.
42      * <p>Type: java.util.Map<String,DataHandler>
43      */

44     public static final String JavaDoc OUTBOUND_MESSAGE_ATTACHMENTS =
45             "javax.xml.ws.binding.attachments.outbound";
46     
47     /**
48      * Standard property: input source for WSDL document.
49      * <p>Type: org.xml.sax.InputSource
50      */

51     public static final String JavaDoc WSDL_DESCRIPTION =
52             "javax.xml.ws.wsdl.description";
53     
54     /**
55      * Standard property: name of WSDL service.
56      * <p>Type: javax.xml.namespace.QName
57      */

58     public static final String JavaDoc WSDL_SERVICE =
59             "javax.xml.ws.wsdl.service";
60     
61     /**
62      * Standard property: name of WSDL port.
63      * <p>Type: javax.xml.namespace.QName
64      */

65     public static final String JavaDoc WSDL_PORT =
66             "javax.xml.ws.wsdl.port";
67     
68     /**
69      * Standard property: name of wsdl interface (2.0) or port type (1.1).
70      * <p>Type: javax.xml.namespace.QName
71      */

72     public static final String JavaDoc WSDL_INTERFACE =
73             "javax.xml.ws.wsdl.interface";
74     
75     /**
76      * Standard property: name of WSDL operation.
77      * <p>Type: javax.xml.namespace.QName
78      */

79     public static final String JavaDoc WSDL_OPERATION =
80             "javax.xml.ws.wsdl.operation";
81     
82     /**
83      * Standard property: HTTP response status code.
84      * <p>Type: java.lang.Integer
85      */

86     public static final String JavaDoc HTTP_RESPONSE_CODE =
87             "javax.xml.ws.http.response.code";
88     
89     /**
90      * Standard property: HTTP request headers.
91      * <p>Type: java.util.Map&lt;java.lang.String, java.util.List&lt;java.lang.String>>
92      */

93     public static final String JavaDoc HTTP_REQUEST_HEADERS =
94             "javax.xml.ws.http.request.headers";
95     
96     /**
97      * Standard property: HTTP response headers.
98      * <p>Type: java.util.Map&lt;java.lang.String, java.util.List&lt;java.lang.String>>
99      */

100     public static final String JavaDoc HTTP_RESPONSE_HEADERS =
101             "javax.xml.ws.http.response.headers";
102     
103     /**
104      * Standard property: HTTP request method.
105      * <p>Type: java.lang.String
106      */

107     public static final String JavaDoc HTTP_REQUEST_METHOD =
108             "javax.xml.ws.http.request.method";
109     
110     /**
111      * Standard property: servlet request object.
112      * <p>Type: javax.servlet.http.HttpServletRequest
113      */

114     public static final String JavaDoc SERVLET_REQUEST =
115             "javax.xml.ws.servlet.request";
116     
117     /**
118      * Standard property: servlet response object.
119      * <p>Type: javax.servlet.http.HttpServletResponse
120      */

121     public static final String JavaDoc SERVLET_RESPONSE =
122             "javax.xml.ws.servlet.response";
123     
124     /**
125      * Standard property: servlet context object.
126      * <p>Type: javax.servlet.ServletContext
127      */

128     public static final String JavaDoc SERVLET_CONTEXT =
129             "javax.xml.ws.servlet.context";
130     
131     /**
132      * Standard property: Query string for request.
133      * <p>Type: String
134      **/

135     public static final String JavaDoc QUERY_STRING =
136             "javax.xml.ws.http.request.querystring";
137     
138     /**
139      * Standard property: Request Path Info
140      * <p>Type: String
141      */

142     public static final String JavaDoc PATH_INFO =
143             "javax.xml.ws.http.request.pathinfo";
144     
145     /**
146      * Standard property: WS Addressing Reference Parameters.
147      * The list MUST include all SOAP headers marked with the
148      * wsa:IsReferenceParameter="true" attribute.
149      * <p>Type: List<Element>
150      *
151      * @since JAX-WS 2.1
152      */

153     public static final String JavaDoc REFERENCE_PARAMETERS =
154             "javax.xml.ws.reference.parameters";
155     
156     /**
157      * Property scope. Properties scoped as <code>APPLICATION</code> are
158      * visible to handlers,
159      * client applications and service endpoints; properties scoped as
160      * <code>HANDLER</code>
161      * are only normally visible to handlers.
162      */

163     public enum Scope {APPLICATION, HANDLER};
164     
165     /**
166      * Sets the scope of a property.
167      *
168      * @param name Name of the property associated with the
169      * <code>MessageContext</code>
170      * @param scope Desired scope of the property
171      * @throws java.lang.IllegalArgumentException if an illegal
172      * property name is specified
173      */

174     public void setScope(String JavaDoc name, Scope scope);
175     
176     /**
177      * Gets the scope of a property.
178      *
179      * @param name Name of the property
180      * @return Scope of the property
181      * @throws java.lang.IllegalArgumentException if a non-existant
182      * property name is specified
183      */

184     public Scope getScope(String JavaDoc name);
185 }
186
Popular Tags