001: /*
002: * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
003: * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
004: */
005:
006: package javax.xml.ws.handler;
007:
008: import java.util.Map;
009:
010: /**
011: * The interface <code>MessageContext</code> abstracts the message
012: * context that is processed by a handler in the <code>handle</code>
013: * method.
014: *
015: * <p>The <code>MessageContext</code> interface provides methods to
016: * manage a property set. <code>MessageContext</code> properties
017: * enable handlers in a handler chain to share processing related
018: * state.
019: *
020: * @since JAX-WS 2.0
021: */
022: public interface MessageContext extends Map<String, Object> {
023:
024: /**
025: * Standard property: message direction, <code>true</code> for
026: * outbound messages, <code>false</code> for inbound.
027: * <p>Type: boolean
028: */
029: public static final String MESSAGE_OUTBOUND_PROPERTY = "javax.xml.ws.handler.message.outbound";
030:
031: /**
032: * Standard property: Map of attachments to a message for the inbound
033: * message, key is the MIME Content-ID, value is a DataHandler.
034: * <p>Type: java.util.Map<String,DataHandler>
035: */
036: public static final String INBOUND_MESSAGE_ATTACHMENTS = "javax.xml.ws.binding.attachments.inbound";
037:
038: /**
039: * Standard property: Map of attachments to a message for the outbound
040: * message, key is the MIME Content-ID, value is a DataHandler.
041: * <p>Type: java.util.Map<String,DataHandler>
042: */
043: public static final String OUTBOUND_MESSAGE_ATTACHMENTS = "javax.xml.ws.binding.attachments.outbound";
044:
045: /**
046: * Standard property: input source for WSDL document.
047: * <p>Type: org.xml.sax.InputSource
048: */
049: public static final String WSDL_DESCRIPTION = "javax.xml.ws.wsdl.description";
050:
051: /**
052: * Standard property: name of WSDL service.
053: * <p>Type: javax.xml.namespace.QName
054: */
055: public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
056:
057: /**
058: * Standard property: name of WSDL port.
059: * <p>Type: javax.xml.namespace.QName
060: */
061: public static final String WSDL_PORT = "javax.xml.ws.wsdl.port";
062:
063: /**
064: * Standard property: name of wsdl interface (2.0) or port type (1.1).
065: * <p>Type: javax.xml.namespace.QName
066: */
067: public static final String WSDL_INTERFACE = "javax.xml.ws.wsdl.interface";
068:
069: /**
070: * Standard property: name of WSDL operation.
071: * <p>Type: javax.xml.namespace.QName
072: */
073: public static final String WSDL_OPERATION = "javax.xml.ws.wsdl.operation";
074:
075: /**
076: * Standard property: HTTP response status code.
077: * <p>Type: java.lang.Integer
078: */
079: public static final String HTTP_RESPONSE_CODE = "javax.xml.ws.http.response.code";
080:
081: /**
082: * Standard property: HTTP request headers.
083: * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
084: */
085: public static final String HTTP_REQUEST_HEADERS = "javax.xml.ws.http.request.headers";
086:
087: /**
088: * Standard property: HTTP response headers.
089: * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
090: */
091: public static final String HTTP_RESPONSE_HEADERS = "javax.xml.ws.http.response.headers";
092:
093: /**
094: * Standard property: HTTP request method.
095: * <p>Type: java.lang.String
096: */
097: public static final String HTTP_REQUEST_METHOD = "javax.xml.ws.http.request.method";
098:
099: /**
100: * Standard property: servlet request object.
101: * <p>Type: javax.servlet.http.HttpServletRequest
102: */
103: public static final String SERVLET_REQUEST = "javax.xml.ws.servlet.request";
104:
105: /**
106: * Standard property: servlet response object.
107: * <p>Type: javax.servlet.http.HttpServletResponse
108: */
109: public static final String SERVLET_RESPONSE = "javax.xml.ws.servlet.response";
110:
111: /**
112: * Standard property: servlet context object.
113: * <p>Type: javax.servlet.ServletContext
114: */
115: public static final String SERVLET_CONTEXT = "javax.xml.ws.servlet.context";
116:
117: /**
118: * Standard property: Query string for request.
119: * <p>Type: String
120: **/
121: public static final String QUERY_STRING = "javax.xml.ws.http.request.querystring";
122:
123: /**
124: * Standard property: Request Path Info
125: * <p>Type: String
126: */
127: public static final String PATH_INFO = "javax.xml.ws.http.request.pathinfo";
128:
129: /**
130: * Standard property: WS Addressing Reference Parameters.
131: * The list MUST include all SOAP headers marked with the
132: * wsa:IsReferenceParameter="true" attribute.
133: * <p>Type: List<Element>
134: *
135: * @since JAX-WS 2.1
136: */
137: public static final String REFERENCE_PARAMETERS = "javax.xml.ws.reference.parameters";
138:
139: /**
140: * Property scope. Properties scoped as <code>APPLICATION</code> are
141: * visible to handlers,
142: * client applications and service endpoints; properties scoped as
143: * <code>HANDLER</code>
144: * are only normally visible to handlers.
145: */
146: public enum Scope {
147: APPLICATION, HANDLER
148: };
149:
150: /**
151: * Sets the scope of a property.
152: *
153: * @param name Name of the property associated with the
154: * <code>MessageContext</code>
155: * @param scope Desired scope of the property
156: * @throws java.lang.IllegalArgumentException if an illegal
157: * property name is specified
158: */
159: public void setScope(String name, Scope scope);
160:
161: /**
162: * Gets the scope of a property.
163: *
164: * @param name Name of the property
165: * @return Scope of the property
166: * @throws java.lang.IllegalArgumentException if a non-existant
167: * property name is specified
168: */
169: public Scope getScope(String name);
170: }
|