src/share/jaxws_classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java

Fri, 14 Feb 2014 11:13:45 +0100

author
mkos
date
Fri, 14 Feb 2014 11:13:45 +0100
changeset 515
6cd506508147
parent 368
0989ad8c0860
child 637
9c07ef4934dd
permissions
-rw-r--r--

8026188: Enhance envelope factory
Summary: Avoiding caching data initialized via TCCL in static context; fix also reviewed by Alexander Fomin
Reviewed-by: ahgross, mgrebac, skoivu

ohair@286 1 /*
alanb@368 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 package com.sun.xml.internal.ws.developer;
ohair@286 27
ohair@286 28 import com.sun.xml.internal.ws.api.message.HeaderList;
ohair@286 29 import com.sun.xml.internal.ws.api.server.WSEndpoint;
ohair@286 30 import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
ohair@286 31
ohair@286 32 import javax.net.ssl.HostnameVerifier;
ohair@286 33 import javax.net.ssl.HttpsURLConnection;
ohair@286 34 import javax.net.ssl.SSLSocketFactory;
ohair@286 35 import javax.xml.ws.BindingProvider;
ohair@286 36 import javax.xml.ws.WebServiceContext;
ohair@286 37 import javax.xml.ws.BindingType;
ohair@286 38 import javax.xml.ws.http.HTTPBinding;
ohair@286 39 import java.net.HttpURLConnection;
ohair@286 40
ohair@286 41 public interface JAXWSProperties {
ohair@286 42 // Content negotiation property: values "none", "pessimistic" and "optimistic"
ohair@286 43 // It is split into two strings so that package renaming for
ohair@286 44 // Java SE 6 doesn't alter the value. So do not combine them
ohair@286 45 @Deprecated
ohair@286 46 public static final String CONTENT_NEGOTIATION_PROPERTY = "com.sun."+"xml.ws.client.ContentNegotiation";
ohair@286 47 public static final String MTOM_THRESHOLOD_VALUE = "com.sun.xml.internal.ws.common.MtomThresholdValue";
ohair@286 48 public static final String HTTP_EXCHANGE = "com.sun.xml.internal.ws.http.exchange";
ohair@286 49
ohair@286 50 /**
ohair@286 51 * Set this property on the {@link BindingProvider#getRequestContext()} to
ohair@286 52 * enable {@link HttpURLConnection#setConnectTimeout(int)}
ohair@286 53 *
ohair@286 54 *<p>
ohair@286 55 * int timeout = ...;
ohair@286 56 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
ohair@286 57 * ctxt.put(CONNECT_TIMEOUT, timeout);
ohair@286 58 */
ohair@286 59 public static final String CONNECT_TIMEOUT =
ohair@286 60 "com.sun.xml.internal.ws.connect.timeout";
ohair@286 61
ohair@286 62 /**
ohair@286 63 * Set this property on the {@link BindingProvider#getRequestContext()} to
alanb@368 64 * enable {@link HttpURLConnection#setReadTimeout(int)}
ohair@286 65 *
ohair@286 66 *<p>
ohair@286 67 * int timeout = ...;
ohair@286 68 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
ohair@286 69 * ctxt.put(REQUEST_TIMEOUT, timeout);
ohair@286 70 */
ohair@286 71 public static final String REQUEST_TIMEOUT =
ohair@286 72 "com.sun.xml.internal.ws.request.timeout";
ohair@286 73
ohair@286 74 /**
ohair@286 75 * Set this property on the {@link BindingProvider#getRequestContext()} to
ohair@286 76 * enable {@link HttpURLConnection#setChunkedStreamingMode(int)}
ohair@286 77 *
ohair@286 78 *<p>
ohair@286 79 * int chunkSize = ...;
ohair@286 80 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
ohair@286 81 * ctxt.put(HTTP_CLIENT_STREAMING_CHUNK_SIZE, chunkSize);
ohair@286 82 */
ohair@286 83 public static final String HTTP_CLIENT_STREAMING_CHUNK_SIZE = "com.sun.xml.internal.ws.transport.http.client.streaming.chunk.size";
ohair@286 84
ohair@286 85
ohair@286 86 /**
ohair@286 87 * Set this property on the {@link BindingProvider#getRequestContext()} to
ohair@286 88 * enable {@link HttpsURLConnection#setHostnameVerifier(HostnameVerifier)}}. The property
ohair@286 89 * is set as follows:
ohair@286 90 *
ohair@286 91 * <p>
ohair@286 92 * HostNameVerifier hostNameVerifier = ...;
ohair@286 93 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
ohair@286 94 * ctxt.put(HOSTNAME_VERIFIER, hostNameVerifier);
ohair@286 95 *
ohair@286 96 * <p>
ohair@286 97 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
ohair@286 98 */
ohair@286 99 public static final String HOSTNAME_VERIFIER = "com.sun.xml.internal.ws.transport.https.client.hostname.verifier";
ohair@286 100
ohair@286 101 /**
ohair@286 102 * Set this property on the {@link BindingProvider#getRequestContext()} to
ohair@286 103 * enable {@link HttpsURLConnection#setSSLSocketFactory(SSLSocketFactory)}. The property is set
ohair@286 104 * as follows:
ohair@286 105 *
ohair@286 106 * <p>
ohair@286 107 * SSLSocketFactory sslFactory = ...;
ohair@286 108 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
ohair@286 109 * ctxt.put(SSL_SOCKET_FACTORY, sslFactory);
ohair@286 110 *
ohair@286 111 * <p>
ohair@286 112 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
ohair@286 113 */
ohair@286 114 public static final String SSL_SOCKET_FACTORY = "com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory";
ohair@286 115
ohair@286 116 /**
ohair@286 117 * Acccess the list of SOAP headers in the SOAP message.
ohair@286 118 *
ohair@286 119 * <p>
ohair@286 120 * On {@link WebServiceContext}, this property returns a {@link HeaderList} object
ohair@286 121 * that represents SOAP headers in the request message that was received.
ohair@286 122 * On {@link BindingProvider#getResponseContext()}, this property returns a
ohair@286 123 * {@link HeaderList} object that represents SOAP headers in the response message from the server.
ohair@286 124 *
ohair@286 125 * <p>
ohair@286 126 * The property is read-only, and please do not modify the returned {@link HeaderList}
ohair@286 127 * as that may break the JAX-WS RI in some unexpected way.
ohair@286 128 *
ohair@286 129 * <p>
ohair@286 130 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
ohair@286 131 */
ohair@286 132 public static final String INBOUND_HEADER_LIST_PROPERTY = "com.sun.xml.internal.ws.api.message.HeaderList";
ohair@286 133
ohair@286 134 /**
ohair@286 135 * Access the {@link WSEndpoint} object that delivered the request.
ohair@286 136 *
ohair@286 137 * <p>
ohair@286 138 * {@link WSEndpoint} is the root of the objects that are together
ohair@286 139 * responsible for delivering requests to the application SEI object.
ohair@286 140 * One can look up this {@link WSEndpoint} from {@link WebServiceContext},
ohair@286 141 * and from there access many parts of the JAX-WS RI runtime.
ohair@286 142 *
ohair@286 143 * <p>
ohair@286 144 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
ohair@286 145 *
ohair@286 146 * @since 2.1.2
ohair@286 147 */
ohair@286 148 public static final String WSENDPOINT = "com.sun.xml.internal.ws.api.server.WSEndpoint";
ohair@286 149
ohair@286 150 /**
ohair@286 151 * Gets the <tt>wsa:To</tt> header.
ohair@286 152 *
ohair@286 153 * The propery value is available on incoming SOAP message. The type of the value
ohair@286 154 * is {@link WSEndpointReference}.
ohair@286 155 *
ohair@286 156 * Null if the incoming SOAP message didn't have the header.
ohair@286 157 *
ohair@286 158 * @since 2.1.3
ohair@286 159 */
ohair@286 160 public static final String ADDRESSING_TO = "com.sun.xml.internal.ws.api.addressing.to";
ohair@286 161
ohair@286 162 /**
ohair@286 163 * Gets the <tt>wsa:From</tt> header.
ohair@286 164 *
ohair@286 165 * The propery value is available on incoming SOAP message. The type of the value
ohair@286 166 * is {@link WSEndpointReference}.
ohair@286 167 *
ohair@286 168 * Null if the incoming SOAP message didn't have the header.
ohair@286 169 *
ohair@286 170 * @since 2.1.3
ohair@286 171 */
ohair@286 172 public static final String ADDRESSING_FROM = "com.sun.xml.internal.ws.api.addressing.from";
ohair@286 173
ohair@286 174 /**
ohair@286 175 * Gets the <tt>wsa:Action</tt> header value.
ohair@286 176 *
ohair@286 177 * The propery value is available on incoming SOAP message. The type of the value
ohair@286 178 * is {@link String}.
ohair@286 179 *
ohair@286 180 * Null if the incoming SOAP message didn't have the header.
ohair@286 181 *
ohair@286 182 * @since 2.1.3
ohair@286 183 */
ohair@286 184 public static final String ADDRESSING_ACTION = "com.sun.xml.internal.ws.api.addressing.action";
ohair@286 185
ohair@286 186 /**
ohair@286 187 * Gets the <tt>wsa:MessageID</tt> header value.
ohair@286 188 *
ohair@286 189 * The propery value is available on incoming SOAP message. The type of the value
ohair@286 190 * is {@link String}.
ohair@286 191 *
ohair@286 192 * Null if the incoming SOAP message didn't have the header.
ohair@286 193 *
ohair@286 194 * @since 2.1.3
ohair@286 195 */
ohair@286 196 public static final String ADDRESSING_MESSAGEID = "com.sun.xml.internal.ws.api.addressing.messageId";
ohair@286 197
ohair@286 198 /**
ohair@286 199 * Reconstructs the URL the client used to make the request. The returned URL
ohair@286 200 * contains a protocol, server name, port number, and server path, but it does
ohair@286 201 * not include query string parameters.
ohair@286 202 * <p>
ohair@286 203 * The property value is available on incoming SOAP message on servlet transport.
ohair@286 204 *
ohair@286 205 * @since 2.1.3
ohair@286 206 */
ohair@286 207 public static final String HTTP_REQUEST_URL = "com.sun.xml.internal.ws.transport.http.servlet.requestURL";
ohair@286 208
ohair@286 209 /**
ohair@286 210 * Binding to represent RESTful services. {@link HTTPBinding#HTTP_BINDING} works
ohair@286 211 * only for Dispatch/Provider services, but this binding works with even SEI based
ohair@286 212 * services. It would be XML, NOT SOAP on the wire. Hence, the SEI parameters
ohair@286 213 * shouldn't be mapped to headers.
ohair@286 214 *
ohair@286 215 * <p>
ohair@286 216 * Note that, this only solves limited RESTful usecases.
ohair@286 217 *
ohair@286 218 * <p>To enable restful binding on the service, specify the binding id via
ohair@286 219 * {@link BindingType} or DD
ohair@286 220 * <pre>
ohair@286 221 * &#64;WebService
ohair@286 222 * &#64;BindingType(JAXWSProperties.REST_BINDING)
ohair@286 223 * </pre>
ohair@286 224 *
ohair@286 225 * <p>To enable restful binding on the client side, specify the binding id via
ohair@286 226 * {@link BindingTypeFeature}
ohair@286 227 * <pre>
ohair@286 228 * proxy = echoImplService.getEchoImplPort(new BindingTypeFeature(JAXWSProperties.REST_BINDING));
ohair@286 229 * </pre>
ohair@286 230 *
ohair@286 231 * @since 2.1.4
ohair@286 232 */
ohair@286 233 public static final String REST_BINDING = "http://jax-ws.dev.java.net/rest";
ohair@286 234
ohair@286 235 }

mercurial