Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/ws/RespectBindingFeature.java
38890 views
/*1* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.ws;2627import javax.xml.ws.soap.AddressingFeature;2829/**30* This feature clarifies the use of the <code>wsdl:binding</code>31* in a JAX-WS runtime.32*33* This feature can be used during the creation of SEI proxy, and34* {@link Dispatch} instances on the client side and {@link Endpoint}35* instances on the server side. This feature cannot be used for {@link Service}36* instance creation on the client side.37* <p>38* This feature is only useful with web services that have an39* associated WSDL. Enabling this feature requires that a JAX-WS40* implementation inspect the <code>wsdl:binding</code> for an41* endpoint at runtime to make sure that all <code>wsdl:extensions</code>42* that have the <code>required</code> attribute set to <code>true</code>43* are understood and are being used.44* <p>45* The following describes the affects of this feature with respect46* to be enabled or disabled:47* <ul>48* <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all49* required <code>wsdl:binding</code> extensions(including policies) are50* either understood and used by the runtime, or explicitly disabled by the51* web service application. A web service can disable a particular52* extension if there is a corresponding {@link WebServiceFeature} or annotation.53* Similarly, a web service client can disable54* particular extension using the corresponding <code>WebServiceFeature</code> while55* creating a proxy or Dispatch instance.56* The runtime MUST also make sure that binding of57* SEI parameters/return values respect the <code>wsdl:binding</code>.58* With this feature enabled, if a required (<code>wsdl:required="true"</code>)59* <code>wsdl:binding</code> extension is in the WSDL and it is not60* supported by a JAX-WS runtime and it has not61* been explicitly turned off by the web service developer, then62* that JAX-WS runtime MUST behave appropriately based on whether it is63* on the client or server:64* <UL>65* <li>Client: runtime MUST throw a66* {@link WebServiceException} no sooner than when one of the methods67* above is invoked but no later than the first invocation of an endpoint68* operation.69* <li>Server: throw a {@link WebServiceException} and the endpoint MUST fail to deploy70* </ul>71*72* <li> DISABLED: In this Mode, an implementation may choose whether73* to inspect the <code>wsdl:binding</code> or not and to what degree74* the <code>wsdl:binding</code> will be inspected. For example,75* one implementation may choose to behave as if this feature is enabled,76* another implementation may only choose to verify the SEI's77* parameter/return type bindings.78* </ul>79*80* @see AddressingFeature81*82* @since JAX-WS 2.183*/84public final class RespectBindingFeature extends WebServiceFeature {85/**86*87* Constant value identifying the RespectBindingFeature88*/89public static final String ID = "javax.xml.ws.RespectBindingFeature";909192/**93* Creates an <code>RespectBindingFeature</code>.94* The instance created will be enabled.95*/96public RespectBindingFeature() {97this.enabled = true;98}99100/**101* Creates an RespectBindingFeature102*103* @param enabled specifies whether this feature should104* be enabled or not.105*/106public RespectBindingFeature(boolean enabled) {107this.enabled = enabled;108}109110/**111* {@inheritDoc}112*/113public String getID() {114return ID;115}116}117118119