Tue, 07 Nov 2017 18:54:04 -0800
Added tag jdk8u162-b06 for changeset 6095742f8034
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. Oracle designates this |
aoqi@0 | 8 | * particular file as subject to the "Classpath" exception as provided |
aoqi@0 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aoqi@0 | 10 | * |
aoqi@0 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 15 | * accompanied this code). |
aoqi@0 | 16 | * |
aoqi@0 | 17 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 20 | * |
aoqi@0 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 22 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 23 | * questions. |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | package javax.xml.ws; |
aoqi@0 | 27 | |
aoqi@0 | 28 | import java.util.List; |
aoqi@0 | 29 | import java.util.Map; |
aoqi@0 | 30 | import javax.xml.ws.spi.Provider; |
aoqi@0 | 31 | import javax.xml.ws.spi.http.HttpContext; |
aoqi@0 | 32 | import javax.xml.ws.wsaddressing.W3CEndpointReference; |
aoqi@0 | 33 | import org.w3c.dom.Element; |
aoqi@0 | 34 | |
aoqi@0 | 35 | |
aoqi@0 | 36 | /** |
aoqi@0 | 37 | * A Web service endpoint. |
aoqi@0 | 38 | * |
aoqi@0 | 39 | * <p>Endpoints are created using the static methods defined in this |
aoqi@0 | 40 | * class. An endpoint is always tied to one <code>Binding</code> |
aoqi@0 | 41 | * and one implementor, both set at endpoint creation time. |
aoqi@0 | 42 | * |
aoqi@0 | 43 | * <p>An endpoint is either in a published or an unpublished state. |
aoqi@0 | 44 | * The <code>publish</code> methods can be used to start publishing |
aoqi@0 | 45 | * an endpoint, at which point it starts accepting incoming requests. |
aoqi@0 | 46 | * Conversely, the <code>stop</code> method can be used to stop |
aoqi@0 | 47 | * accepting incoming requests and take the endpoint down. |
aoqi@0 | 48 | * Once stopped, an endpoint cannot be published again. |
aoqi@0 | 49 | * |
aoqi@0 | 50 | * <p>An <code>Executor</code> may be set on the endpoint in order |
aoqi@0 | 51 | * to gain better control over the threads used to dispatch incoming |
aoqi@0 | 52 | * requests. For instance, thread pooling with certain parameters |
aoqi@0 | 53 | * can be enabled by creating a <code>ThreadPoolExecutor</code> and |
aoqi@0 | 54 | * registering it with the endpoint. |
aoqi@0 | 55 | * |
aoqi@0 | 56 | * <p>Handler chains can be set using the contained <code>Binding</code>. |
aoqi@0 | 57 | * |
aoqi@0 | 58 | * <p>An endpoint may have a list of metadata documents, such as WSDL |
aoqi@0 | 59 | * and XMLSchema documents, bound to it. At publishing time, the |
aoqi@0 | 60 | * JAX-WS implementation will try to reuse as much of that metadata |
aoqi@0 | 61 | * as possible instead of generating new ones based on the annotations |
aoqi@0 | 62 | * present on the implementor. |
aoqi@0 | 63 | * |
aoqi@0 | 64 | * @since JAX-WS 2.0 |
aoqi@0 | 65 | * |
aoqi@0 | 66 | * @see javax.xml.ws.Binding |
aoqi@0 | 67 | * @see javax.xml.ws.BindingType |
aoqi@0 | 68 | * @see javax.xml.ws.soap.SOAPBinding |
aoqi@0 | 69 | * @see java.util.concurrent.Executor |
aoqi@0 | 70 | * |
aoqi@0 | 71 | **/ |
aoqi@0 | 72 | public abstract class Endpoint { |
aoqi@0 | 73 | |
aoqi@0 | 74 | /** Standard property: name of WSDL service. |
aoqi@0 | 75 | * <p>Type: javax.xml.namespace.QName |
aoqi@0 | 76 | **/ |
aoqi@0 | 77 | public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service"; |
aoqi@0 | 78 | |
aoqi@0 | 79 | /** Standard property: name of WSDL port. |
aoqi@0 | 80 | * <p>Type: javax.xml.namespace.QName |
aoqi@0 | 81 | **/ |
aoqi@0 | 82 | public static final String WSDL_PORT = "javax.xml.ws.wsdl.port"; |
aoqi@0 | 83 | |
aoqi@0 | 84 | |
aoqi@0 | 85 | /** |
aoqi@0 | 86 | * Creates an endpoint with the specified implementor object. If there is |
aoqi@0 | 87 | * a binding specified via a BindingType annotation then it MUST be used else |
aoqi@0 | 88 | * a default of SOAP 1.1 / HTTP binding MUST be used. |
aoqi@0 | 89 | * <p> |
aoqi@0 | 90 | * The newly created endpoint may be published by calling |
aoqi@0 | 91 | * one of the {@link javax.xml.ws.Endpoint#publish(String)} and |
aoqi@0 | 92 | * {@link javax.xml.ws.Endpoint#publish(Object)} methods. |
aoqi@0 | 93 | * |
aoqi@0 | 94 | * |
aoqi@0 | 95 | * @param implementor The endpoint implementor. |
aoqi@0 | 96 | * |
aoqi@0 | 97 | * @return The newly created endpoint. |
aoqi@0 | 98 | * |
aoqi@0 | 99 | **/ |
aoqi@0 | 100 | public static Endpoint create(Object implementor) { |
aoqi@0 | 101 | return create(null, implementor); |
aoqi@0 | 102 | } |
aoqi@0 | 103 | |
aoqi@0 | 104 | /** |
aoqi@0 | 105 | * Creates an endpoint with the specified implementor object and web |
aoqi@0 | 106 | * service features. If there is a binding specified via a BindingType |
aoqi@0 | 107 | * annotation then it MUST be used else a default of SOAP 1.1 / HTTP |
aoqi@0 | 108 | * binding MUST be used. |
aoqi@0 | 109 | * <p> |
aoqi@0 | 110 | * The newly created endpoint may be published by calling |
aoqi@0 | 111 | * one of the {@link javax.xml.ws.Endpoint#publish(String)} and |
aoqi@0 | 112 | * {@link javax.xml.ws.Endpoint#publish(Object)} methods. |
aoqi@0 | 113 | * |
aoqi@0 | 114 | * |
aoqi@0 | 115 | * @param implementor The endpoint implementor. |
aoqi@0 | 116 | * @param features A list of WebServiceFeature to configure on the |
aoqi@0 | 117 | * endpoint. Supported features not in the <code>features |
aoqi@0 | 118 | * </code> parameter will have their default values. |
aoqi@0 | 119 | * |
aoqi@0 | 120 | * |
aoqi@0 | 121 | * @return The newly created endpoint. |
aoqi@0 | 122 | * @since JAX-WS 2.2 |
aoqi@0 | 123 | * |
aoqi@0 | 124 | */ |
aoqi@0 | 125 | public static Endpoint create(Object implementor, WebServiceFeature ... features) { |
aoqi@0 | 126 | return create(null, implementor, features); |
aoqi@0 | 127 | } |
aoqi@0 | 128 | |
aoqi@0 | 129 | /** |
aoqi@0 | 130 | * Creates an endpoint with the specified binding type and |
aoqi@0 | 131 | * implementor object. |
aoqi@0 | 132 | * <p> |
aoqi@0 | 133 | * The newly created endpoint may be published by calling |
aoqi@0 | 134 | * one of the {@link javax.xml.ws.Endpoint#publish(String)} and |
aoqi@0 | 135 | * {@link javax.xml.ws.Endpoint#publish(Object)} methods. |
aoqi@0 | 136 | * |
aoqi@0 | 137 | * @param bindingId A URI specifying the binding to use. If the bindingID is |
aoqi@0 | 138 | * <code>null</code> and no binding is specified via a BindingType |
aoqi@0 | 139 | * annotation then a default SOAP 1.1 / HTTP binding MUST be used. |
aoqi@0 | 140 | * |
aoqi@0 | 141 | * @param implementor The endpoint implementor. |
aoqi@0 | 142 | * |
aoqi@0 | 143 | * @return The newly created endpoint. |
aoqi@0 | 144 | * |
aoqi@0 | 145 | **/ |
aoqi@0 | 146 | public static Endpoint create(String bindingId, Object implementor) { |
aoqi@0 | 147 | return Provider.provider().createEndpoint(bindingId, implementor); |
aoqi@0 | 148 | } |
aoqi@0 | 149 | |
aoqi@0 | 150 | /** |
aoqi@0 | 151 | * Creates an endpoint with the specified binding type, |
aoqi@0 | 152 | * implementor object, and web service features. |
aoqi@0 | 153 | * <p> |
aoqi@0 | 154 | * The newly created endpoint may be published by calling |
aoqi@0 | 155 | * one of the {@link javax.xml.ws.Endpoint#publish(String)} and |
aoqi@0 | 156 | * {@link javax.xml.ws.Endpoint#publish(Object)} methods. |
aoqi@0 | 157 | * |
aoqi@0 | 158 | * @param bindingId A URI specifying the binding to use. If the bindingID is |
aoqi@0 | 159 | * <code>null</code> and no binding is specified via a BindingType |
aoqi@0 | 160 | * annotation then a default SOAP 1.1 / HTTP binding MUST be used. |
aoqi@0 | 161 | * |
aoqi@0 | 162 | * @param implementor The endpoint implementor. |
aoqi@0 | 163 | * |
aoqi@0 | 164 | * @param features A list of WebServiceFeature to configure on the |
aoqi@0 | 165 | * endpoint. Supported features not in the <code>features |
aoqi@0 | 166 | * </code> parameter will have their default values. |
aoqi@0 | 167 | * |
aoqi@0 | 168 | * @return The newly created endpoint. |
aoqi@0 | 169 | * @since JAX-WS 2.2 |
aoqi@0 | 170 | */ |
aoqi@0 | 171 | public static Endpoint create(String bindingId, Object implementor, WebServiceFeature ... features) { |
aoqi@0 | 172 | return Provider.provider().createEndpoint(bindingId, implementor, features); |
aoqi@0 | 173 | } |
aoqi@0 | 174 | |
aoqi@0 | 175 | /** |
aoqi@0 | 176 | * Returns the binding for this endpoint. |
aoqi@0 | 177 | * |
aoqi@0 | 178 | * @return The binding for this endpoint |
aoqi@0 | 179 | **/ |
aoqi@0 | 180 | public abstract Binding getBinding(); |
aoqi@0 | 181 | |
aoqi@0 | 182 | /** |
aoqi@0 | 183 | * Returns the implementation object for this endpoint. |
aoqi@0 | 184 | * |
aoqi@0 | 185 | * @return The implementor for this endpoint |
aoqi@0 | 186 | **/ |
aoqi@0 | 187 | public abstract Object getImplementor(); |
aoqi@0 | 188 | |
aoqi@0 | 189 | /** |
aoqi@0 | 190 | * Publishes this endpoint at the given address. |
aoqi@0 | 191 | * The necessary server infrastructure will be created and |
aoqi@0 | 192 | * configured by the JAX-WS implementation using some default configuration. |
aoqi@0 | 193 | * In order to get more control over the server configuration, please |
aoqi@0 | 194 | * use the {@link javax.xml.ws.Endpoint#publish(Object)} method instead. |
aoqi@0 | 195 | * |
aoqi@0 | 196 | * @param address A URI specifying the address to use. The address |
aoqi@0 | 197 | * MUST be compatible with the binding specified at the |
aoqi@0 | 198 | * time the endpoint was created. |
aoqi@0 | 199 | * |
aoqi@0 | 200 | * @throws java.lang.IllegalArgumentException |
aoqi@0 | 201 | * If the provided address URI is not usable |
aoqi@0 | 202 | * in conjunction with the endpoint's binding. |
aoqi@0 | 203 | * |
aoqi@0 | 204 | * @throws java.lang.IllegalStateException |
aoqi@0 | 205 | * If the endpoint has been published already or it has been stopped. |
aoqi@0 | 206 | * |
aoqi@0 | 207 | * @throws java.lang.SecurityException |
aoqi@0 | 208 | * If a <code>java.lang.SecurityManger</code> |
aoqi@0 | 209 | * is being used and the application doesn't have the |
aoqi@0 | 210 | * <code>WebServicePermission("publishEndpoint")</code> permission. |
aoqi@0 | 211 | **/ |
aoqi@0 | 212 | public abstract void publish(String address); |
aoqi@0 | 213 | |
aoqi@0 | 214 | /** |
aoqi@0 | 215 | * Creates and publishes an endpoint for the specified implementor |
aoqi@0 | 216 | * object at the given address. |
aoqi@0 | 217 | * <p> |
aoqi@0 | 218 | * The necessary server infrastructure will be created and |
aoqi@0 | 219 | * configured by the JAX-WS implementation using some default configuration. |
aoqi@0 | 220 | * |
aoqi@0 | 221 | * In order to get more control over the server configuration, please |
aoqi@0 | 222 | * use the {@link javax.xml.ws.Endpoint#create(String,Object)} and |
aoqi@0 | 223 | * {@link javax.xml.ws.Endpoint#publish(Object)} methods instead. |
aoqi@0 | 224 | * |
aoqi@0 | 225 | * @param address A URI specifying the address and transport/protocol |
aoqi@0 | 226 | * to use. A http: URI MUST result in the SOAP 1.1/HTTP |
aoqi@0 | 227 | * binding being used. Implementations may support other |
aoqi@0 | 228 | * URI schemes. |
aoqi@0 | 229 | * @param implementor The endpoint implementor. |
aoqi@0 | 230 | * |
aoqi@0 | 231 | * @return The newly created endpoint. |
aoqi@0 | 232 | * |
aoqi@0 | 233 | * @throws java.lang.SecurityException |
aoqi@0 | 234 | * If a <code>java.lang.SecurityManger</code> |
aoqi@0 | 235 | * is being used and the application doesn't have the |
aoqi@0 | 236 | * <code>WebServicePermission("publishEndpoint")</code> permission. |
aoqi@0 | 237 | * |
aoqi@0 | 238 | **/ |
aoqi@0 | 239 | public static Endpoint publish(String address, Object implementor) { |
aoqi@0 | 240 | return Provider.provider().createAndPublishEndpoint(address, implementor); |
aoqi@0 | 241 | } |
aoqi@0 | 242 | |
aoqi@0 | 243 | /** |
aoqi@0 | 244 | * Creates and publishes an endpoint for the specified implementor |
aoqi@0 | 245 | * object at the given address. The created endpoint is configured |
aoqi@0 | 246 | * with the web service features. |
aoqi@0 | 247 | * <p> |
aoqi@0 | 248 | * The necessary server infrastructure will be created and |
aoqi@0 | 249 | * configured by the JAX-WS implementation using some default configuration. |
aoqi@0 | 250 | * |
aoqi@0 | 251 | * In order to get more control over the server configuration, please |
aoqi@0 | 252 | * use the {@link javax.xml.ws.Endpoint#create(String,Object)} and |
aoqi@0 | 253 | * {@link javax.xml.ws.Endpoint#publish(Object)} methods instead. |
aoqi@0 | 254 | * |
aoqi@0 | 255 | * @param address A URI specifying the address and transport/protocol |
aoqi@0 | 256 | * to use. A http: URI MUST result in the SOAP 1.1/HTTP |
aoqi@0 | 257 | * binding being used. Implementations may support other |
aoqi@0 | 258 | * URI schemes. |
aoqi@0 | 259 | * @param implementor The endpoint implementor. |
aoqi@0 | 260 | * @param features A list of WebServiceFeature to configure on the |
aoqi@0 | 261 | * endpoint. Supported features not in the <code>features |
aoqi@0 | 262 | * </code> parameter will have their default values. |
aoqi@0 | 263 | * @return The newly created endpoint. |
aoqi@0 | 264 | * |
aoqi@0 | 265 | * @throws java.lang.SecurityException |
aoqi@0 | 266 | * If a <code>java.lang.SecurityManger</code> |
aoqi@0 | 267 | * is being used and the application doesn't have the |
aoqi@0 | 268 | * <code>WebServicePermission("publishEndpoint")</code> permission. |
aoqi@0 | 269 | * @since JAX-WS 2.2 |
aoqi@0 | 270 | */ |
aoqi@0 | 271 | public static Endpoint publish(String address, Object implementor, WebServiceFeature ... features) { |
aoqi@0 | 272 | return Provider.provider().createAndPublishEndpoint(address, implementor, features); |
aoqi@0 | 273 | } |
aoqi@0 | 274 | |
aoqi@0 | 275 | |
aoqi@0 | 276 | /** |
aoqi@0 | 277 | * Publishes this endpoint at the provided server context. |
aoqi@0 | 278 | * A server context encapsulates the server infrastructure |
aoqi@0 | 279 | * and addressing information for a particular transport. |
aoqi@0 | 280 | * For a call to this method to succeed, the server context |
aoqi@0 | 281 | * passed as an argument to it MUST be compatible with the |
aoqi@0 | 282 | * endpoint's binding. |
aoqi@0 | 283 | * |
aoqi@0 | 284 | * @param serverContext An object representing a server |
aoqi@0 | 285 | * context to be used for publishing the endpoint. |
aoqi@0 | 286 | * |
aoqi@0 | 287 | * @throws java.lang.IllegalArgumentException |
aoqi@0 | 288 | * If the provided server context is not |
aoqi@0 | 289 | * supported by the implementation or turns |
aoqi@0 | 290 | * out to be unusable in conjunction with the |
aoqi@0 | 291 | * endpoint's binding. |
aoqi@0 | 292 | * |
aoqi@0 | 293 | * @throws java.lang.IllegalStateException |
aoqi@0 | 294 | * If the endpoint has been published already or it has been stopped. |
aoqi@0 | 295 | * |
aoqi@0 | 296 | * @throws java.lang.SecurityException |
aoqi@0 | 297 | * If a <code>java.lang.SecurityManger</code> |
aoqi@0 | 298 | * is being used and the application doesn't have the |
aoqi@0 | 299 | * <code>WebServicePermission("publishEndpoint")</code> permission. |
aoqi@0 | 300 | **/ |
aoqi@0 | 301 | public abstract void publish(Object serverContext); |
aoqi@0 | 302 | |
aoqi@0 | 303 | /** |
aoqi@0 | 304 | * Publishes this endpoint at the provided server context. |
aoqi@0 | 305 | * A server context encapsulates the server infrastructure |
aoqi@0 | 306 | * and addressing information for a particular transport. |
aoqi@0 | 307 | * For a call to this method to succeed, the server context |
aoqi@0 | 308 | * passed as an argument to it MUST be compatible with the |
aoqi@0 | 309 | * endpoint's binding. |
aoqi@0 | 310 | * |
aoqi@0 | 311 | * <p> |
aoqi@0 | 312 | * This is meant for container developers to publish the |
aoqi@0 | 313 | * the endpoints portably and not intended for the end |
aoqi@0 | 314 | * developers. |
aoqi@0 | 315 | * |
aoqi@0 | 316 | * |
aoqi@0 | 317 | * @param serverContext An object representing a server |
aoqi@0 | 318 | * context to be used for publishing the endpoint. |
aoqi@0 | 319 | * |
aoqi@0 | 320 | * @throws java.lang.IllegalArgumentException |
aoqi@0 | 321 | * If the provided server context is not |
aoqi@0 | 322 | * supported by the implementation or turns |
aoqi@0 | 323 | * out to be unusable in conjunction with the |
aoqi@0 | 324 | * endpoint's binding. |
aoqi@0 | 325 | * |
aoqi@0 | 326 | * @throws java.lang.IllegalStateException |
aoqi@0 | 327 | * If the endpoint has been published already or it has been stopped. |
aoqi@0 | 328 | * |
aoqi@0 | 329 | * @throws java.lang.SecurityException |
aoqi@0 | 330 | * If a <code>java.lang.SecurityManger</code> |
aoqi@0 | 331 | * is being used and the application doesn't have the |
aoqi@0 | 332 | * <code>WebServicePermission("publishEndpoint")</code> permission. |
aoqi@0 | 333 | * @since JAX-WS 2.2 |
aoqi@0 | 334 | */ |
aoqi@0 | 335 | public void publish(HttpContext serverContext) { |
aoqi@0 | 336 | throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour."); |
aoqi@0 | 337 | } |
aoqi@0 | 338 | |
aoqi@0 | 339 | /** |
aoqi@0 | 340 | * Stops publishing this endpoint. |
aoqi@0 | 341 | * |
aoqi@0 | 342 | * If the endpoint is not in a published state, this method |
aoqi@0 | 343 | * has no effect. |
aoqi@0 | 344 | * |
aoqi@0 | 345 | **/ |
aoqi@0 | 346 | public abstract void stop(); |
aoqi@0 | 347 | |
aoqi@0 | 348 | /** |
aoqi@0 | 349 | * Returns true if the endpoint is in the published state. |
aoqi@0 | 350 | * |
aoqi@0 | 351 | * @return <code>true</code> if the endpoint is in the published state. |
aoqi@0 | 352 | **/ |
aoqi@0 | 353 | public abstract boolean isPublished(); |
aoqi@0 | 354 | |
aoqi@0 | 355 | /** |
aoqi@0 | 356 | * Returns a list of metadata documents for the service. |
aoqi@0 | 357 | * |
aoqi@0 | 358 | * @return <code>List<javax.xml.transform.Source></code> A list of metadata documents for the service |
aoqi@0 | 359 | **/ |
aoqi@0 | 360 | public abstract List<javax.xml.transform.Source> getMetadata(); |
aoqi@0 | 361 | |
aoqi@0 | 362 | /** |
aoqi@0 | 363 | * Sets the metadata for this endpoint. |
aoqi@0 | 364 | * |
aoqi@0 | 365 | * @param metadata A list of XML document sources containing |
aoqi@0 | 366 | * metadata information for the endpoint (e.g. |
aoqi@0 | 367 | * WSDL or XML Schema documents) |
aoqi@0 | 368 | * |
aoqi@0 | 369 | * @throws java.lang.IllegalStateException If the endpoint |
aoqi@0 | 370 | * has already been published. |
aoqi@0 | 371 | **/ |
aoqi@0 | 372 | public abstract void setMetadata(List<javax.xml.transform.Source> metadata); |
aoqi@0 | 373 | |
aoqi@0 | 374 | /** |
aoqi@0 | 375 | * Returns the executor for this <code>Endpoint</code>instance. |
aoqi@0 | 376 | * |
aoqi@0 | 377 | * The executor is used to dispatch an incoming request to |
aoqi@0 | 378 | * the implementor object. |
aoqi@0 | 379 | * |
aoqi@0 | 380 | * @return The <code>java.util.concurrent.Executor</code> to be |
aoqi@0 | 381 | * used to dispatch a request. |
aoqi@0 | 382 | * |
aoqi@0 | 383 | * @see java.util.concurrent.Executor |
aoqi@0 | 384 | **/ |
aoqi@0 | 385 | public abstract java.util.concurrent.Executor getExecutor(); |
aoqi@0 | 386 | |
aoqi@0 | 387 | /** |
aoqi@0 | 388 | * Sets the executor for this <code>Endpoint</code> instance. |
aoqi@0 | 389 | * |
aoqi@0 | 390 | * The executor is used to dispatch an incoming request to |
aoqi@0 | 391 | * the implementor object. |
aoqi@0 | 392 | * |
aoqi@0 | 393 | * If this <code>Endpoint</code> is published using the |
aoqi@0 | 394 | * <code>publish(Object)</code> method and the specified server |
aoqi@0 | 395 | * context defines its own threading behavior, the executor |
aoqi@0 | 396 | * may be ignored. |
aoqi@0 | 397 | * |
aoqi@0 | 398 | * @param executor The <code>java.util.concurrent.Executor</code> |
aoqi@0 | 399 | * to be used to dispatch a request. |
aoqi@0 | 400 | * |
aoqi@0 | 401 | * @throws SecurityException If the instance does not support |
aoqi@0 | 402 | * setting an executor for security reasons (e.g. the |
aoqi@0 | 403 | * necessary permissions are missing). |
aoqi@0 | 404 | * |
aoqi@0 | 405 | * @see java.util.concurrent.Executor |
aoqi@0 | 406 | **/ |
aoqi@0 | 407 | public abstract void setExecutor(java.util.concurrent.Executor executor); |
aoqi@0 | 408 | |
aoqi@0 | 409 | |
aoqi@0 | 410 | /** |
aoqi@0 | 411 | * Returns the property bag for this <code>Endpoint</code> instance. |
aoqi@0 | 412 | * |
aoqi@0 | 413 | * @return Map<String,Object> The property bag |
aoqi@0 | 414 | * associated with this instance. |
aoqi@0 | 415 | **/ |
aoqi@0 | 416 | public abstract Map<String,Object> getProperties(); |
aoqi@0 | 417 | |
aoqi@0 | 418 | /** |
aoqi@0 | 419 | * Sets the property bag for this <code>Endpoint</code> instance. |
aoqi@0 | 420 | * |
aoqi@0 | 421 | * @param properties The property bag associated with |
aoqi@0 | 422 | * this instance. |
aoqi@0 | 423 | **/ |
aoqi@0 | 424 | public abstract void setProperties(Map<String,Object> properties); |
aoqi@0 | 425 | |
aoqi@0 | 426 | /** |
aoqi@0 | 427 | * Returns the <code>EndpointReference</code> associated with |
aoqi@0 | 428 | * this <code>Endpoint</code> instance. |
aoqi@0 | 429 | * <p> |
aoqi@0 | 430 | * If the Binding for this <code>bindingProvider</code> is |
aoqi@0 | 431 | * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a |
aoqi@0 | 432 | * <code>W3CEndpointReference</code> MUST be returned. |
aoqi@0 | 433 | * |
aoqi@0 | 434 | * @param referenceParameters Reference parameters to be associated with the |
aoqi@0 | 435 | * returned <code>EndpointReference</code> instance. |
aoqi@0 | 436 | * @return EndpointReference of this <code>Endpoint</code> instance. |
aoqi@0 | 437 | * If the returned <code>EndpointReference</code> is of type |
aoqi@0 | 438 | * <code>W3CEndpointReference</code> then it MUST contain the |
aoqi@0 | 439 | * the specified <code>referenceParameters</code>. |
aoqi@0 | 440 | |
aoqi@0 | 441 | * @throws WebServiceException If any error in the creation of |
aoqi@0 | 442 | * the <code>EndpointReference</code> or if the <code>Endpoint</code> is |
aoqi@0 | 443 | * not in the published state. |
aoqi@0 | 444 | * @throws UnsupportedOperationException If this <code>BindingProvider</code> |
aoqi@0 | 445 | * uses the XML/HTTP binding. |
aoqi@0 | 446 | * |
aoqi@0 | 447 | * @see W3CEndpointReference |
aoqi@0 | 448 | * |
aoqi@0 | 449 | * @since JAX-WS 2.1 |
aoqi@0 | 450 | **/ |
aoqi@0 | 451 | public abstract EndpointReference getEndpointReference(Element... referenceParameters); |
aoqi@0 | 452 | |
aoqi@0 | 453 | |
aoqi@0 | 454 | /** |
aoqi@0 | 455 | * Returns the <code>EndpointReference</code> associated with |
aoqi@0 | 456 | * this <code>Endpoint</code> instance. |
aoqi@0 | 457 | * |
aoqi@0 | 458 | * @param clazz Specifies the type of EndpointReference that MUST be returned. |
aoqi@0 | 459 | * @param referenceParameters Reference parameters to be associated with the |
aoqi@0 | 460 | * returned <code>EndpointReference</code> instance. |
aoqi@0 | 461 | * @return EndpointReference of type <code>clazz</code> of this |
aoqi@0 | 462 | * <code>Endpoint</code> instance. |
aoqi@0 | 463 | * If the returned <code>EndpointReference</code> is of type |
aoqi@0 | 464 | * <code>W3CEndpointReference</code> then it MUST contain the |
aoqi@0 | 465 | * the specified <code>referenceParameters</code>. |
aoqi@0 | 466 | |
aoqi@0 | 467 | * @throws WebServiceException If any error in the creation of |
aoqi@0 | 468 | * the <code>EndpointReference</code> or if the <code>Endpoint</code> is |
aoqi@0 | 469 | * not in the published state or if the <code>clazz</code> is not a supported |
aoqi@0 | 470 | * <code>EndpointReference</code> type. |
aoqi@0 | 471 | * @throws UnsupportedOperationException If this <code>BindingProvider</code> |
aoqi@0 | 472 | * uses the XML/HTTP binding. |
aoqi@0 | 473 | * |
aoqi@0 | 474 | * |
aoqi@0 | 475 | * @since JAX-WS 2.1 |
aoqi@0 | 476 | **/ |
aoqi@0 | 477 | public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz, |
aoqi@0 | 478 | Element... referenceParameters); |
aoqi@0 | 479 | |
aoqi@0 | 480 | /** |
aoqi@0 | 481 | * By settng a <code>EndpointContext</code>, JAX-WS runtime knows about |
aoqi@0 | 482 | * addresses of other endpoints in an application. If multiple endpoints |
aoqi@0 | 483 | * share different ports of a WSDL, then the multiple port addresses |
aoqi@0 | 484 | * are patched when the WSDL is accessed. |
aoqi@0 | 485 | * |
aoqi@0 | 486 | * <p> |
aoqi@0 | 487 | * This needs to be set before publishing the endpoints. |
aoqi@0 | 488 | * |
aoqi@0 | 489 | * @param ctxt that is shared for multiple endpoints |
aoqi@0 | 490 | * @throws java.lang.IllegalStateException |
aoqi@0 | 491 | * If the endpoint has been published already or it has been stopped. |
aoqi@0 | 492 | * |
aoqi@0 | 493 | * @since JAX-WS 2.2 |
aoqi@0 | 494 | */ |
aoqi@0 | 495 | public void setEndpointContext(EndpointContext ctxt) { |
aoqi@0 | 496 | throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour."); |
aoqi@0 | 497 | } |
aoqi@0 | 498 | } |