src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java

Tue, 07 Nov 2017 18:54:04 -0800

author
asaha
date
Tue, 07 Nov 2017 18:54:04 -0800
changeset 1528
f453f4eaf8b4
parent 0
373ffda63c9a
permissions
-rw-r--r--

Added tag jdk8u162-b06 for changeset 6095742f8034

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2005, 2010, 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 javax.xml.ws.soap.AddressingFeature;
aoqi@0 29
aoqi@0 30 /**
aoqi@0 31 * This feature clarifies the use of the <code>wsdl:binding</code>
aoqi@0 32 * in a JAX-WS runtime.
aoqi@0 33 *
aoqi@0 34 * This feature can be used during the creation of SEI proxy, and
aoqi@0 35 * {@link Dispatch} instances on the client side and {@link Endpoint}
aoqi@0 36 * instances on the server side. This feature cannot be used for {@link Service}
aoqi@0 37 * instance creation on the client side.
aoqi@0 38 * <p>
aoqi@0 39 * This feature is only useful with web services that have an
aoqi@0 40 * associated WSDL. Enabling this feature requires that a JAX-WS
aoqi@0 41 * implementation inspect the <code>wsdl:binding</code> for an
aoqi@0 42 * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
aoqi@0 43 * that have the <code>required</code> attribute set to <code>true</code>
aoqi@0 44 * are understood and are being used.
aoqi@0 45 * <p>
aoqi@0 46 * The following describes the affects of this feature with respect
aoqi@0 47 * to be enabled or disabled:
aoqi@0 48 * <ul>
aoqi@0 49 * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
aoqi@0 50 * required <code>wsdl:binding</code> extensions(including policies) are
aoqi@0 51 * either understood and used by the runtime, or explicitly disabled by the
aoqi@0 52 * web service application. A web service can disable a particular
aoqi@0 53 * extension if there is a corresponding {@link WebServiceFeature} or annotation.
aoqi@0 54 * Similarly, a web service client can disable
aoqi@0 55 * particular extension using the corresponding <code>WebServiceFeature</code> while
aoqi@0 56 * creating a proxy or Dispatch instance.
aoqi@0 57 * The runtime MUST also make sure that binding of
aoqi@0 58 * SEI parameters/return values respect the <code>wsdl:binding</code>.
aoqi@0 59 * With this feature enabled, if a required (<code>wsdl:required="true"</code>)
aoqi@0 60 * <code>wsdl:binding</code> extension is in the WSDL and it is not
aoqi@0 61 * supported by a JAX-WS runtime and it has not
aoqi@0 62 * been explicitly turned off by the web service developer, then
aoqi@0 63 * that JAX-WS runtime MUST behave appropriately based on whether it is
aoqi@0 64 * on the client or server:
aoqi@0 65 * <UL>
aoqi@0 66 * <li>Client: runtime MUST throw a
aoqi@0 67 * {@link WebServiceException} no sooner than when one of the methods
aoqi@0 68 * above is invoked but no later than the first invocation of an endpoint
aoqi@0 69 * operation.
aoqi@0 70 * <li>Server: throw a {@link WebServiceException} and the endpoint MUST fail to deploy
aoqi@0 71 * </ul>
aoqi@0 72 *
aoqi@0 73 * <li> DISABLED: In this Mode, an implementation may choose whether
aoqi@0 74 * to inspect the <code>wsdl:binding</code> or not and to what degree
aoqi@0 75 * the <code>wsdl:binding</code> will be inspected. For example,
aoqi@0 76 * one implementation may choose to behave as if this feature is enabled,
aoqi@0 77 * another implementation may only choose to verify the SEI's
aoqi@0 78 * parameter/return type bindings.
aoqi@0 79 * </ul>
aoqi@0 80 *
aoqi@0 81 * @see AddressingFeature
aoqi@0 82 *
aoqi@0 83 * @since JAX-WS 2.1
aoqi@0 84 */
aoqi@0 85 public final class RespectBindingFeature extends WebServiceFeature {
aoqi@0 86 /**
aoqi@0 87 *
aoqi@0 88 * Constant value identifying the RespectBindingFeature
aoqi@0 89 */
aoqi@0 90 public static final String ID = "javax.xml.ws.RespectBindingFeature";
aoqi@0 91
aoqi@0 92
aoqi@0 93 /**
aoqi@0 94 * Creates an <code>RespectBindingFeature</code>.
aoqi@0 95 * The instance created will be enabled.
aoqi@0 96 */
aoqi@0 97 public RespectBindingFeature() {
aoqi@0 98 this.enabled = true;
aoqi@0 99 }
aoqi@0 100
aoqi@0 101 /**
aoqi@0 102 * Creates an RespectBindingFeature
aoqi@0 103 *
aoqi@0 104 * @param enabled specifies whether this feature should
aoqi@0 105 * be enabled or not.
aoqi@0 106 */
aoqi@0 107 public RespectBindingFeature(boolean enabled) {
aoqi@0 108 this.enabled = enabled;
aoqi@0 109 }
aoqi@0 110
aoqi@0 111 /**
aoqi@0 112 * {@inheritDoc}
aoqi@0 113 */
aoqi@0 114 public String getID() {
aoqi@0 115 return ID;
aoqi@0 116 }
aoqi@0 117 }

mercurial