KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > ws > RespectBindingFeature


1 /*
2  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.ws;
7
8 import javax.xml.bind.JAXBContext;
9 import javax.xml.namespace.QName JavaDoc;
10 import javax.xml.ws.WebServiceFeature;
11 import javax.xml.ws.WebServiceException;
12 import javax.xml.ws.spi.Provider;
13
14 /**
15  * This feature clarifies the use of the <code>wsdl:binding</code>
16  * in a JAX-WS runtime.
17  * <p>
18  * This feature is only useful with web services that have an
19  * associated WSDL. Enabling this feature requires that a JAX-WS
20  * implementation inspect the <code>wsdl:binding</code> for an
21  * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
22  * that have the <code>required</code> attribute set to <code>true</code>
23  * are understood and are being used.
24  * <p>
25  * The following describes the affects of this feature with respect
26  * to be enabled or disabled:
27  * <ul>
28  * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
29  * required <code>wsdl:binding</code> extensions are either understood
30     and used by the runtime, or explicitly disabled by the web service
31  * application. A web service application can disable a particular
32  * extension that has a known WebServiceFeature using either the appropriate
33  * annotation associated with that WebServiceFeature on the server, or one of
34  * the following methods on the client:
35  * <ul>
36  * <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
37  * <li>{@link Service#getPort(Class,WebServiceFeature...)}
38  * <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
39  * <li>{@link Service#createDispatch(QName,Class,Service.Mode mode,WebServiceFeature...)}
40  * <li>{@link Service#createDispatch(EndpointReference,Class,Service.Mode,WebServiceFeature...)}
41  * <li>{@link Service#createDispatch(QName,JAXBContext,Service.Mode,WebServiceFeature...)}
42  * <li>{@link Service#createDispatch(EndpointReference,JAXBContext,Service.Mode,WebServiceFeature...)}
43  * <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
44  * <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
45  * generated <code>Service</code>.
46  * </ul>
47  * The runtime MUST also make sure that binding of
48  * SEI parameters/return values respect the <code>wsdl:binding</code>.
49  * With this feature enabled, if a required (<code>wsdl:required="true"</code>)
50  * <code>wsdl:binding</code> extension is in the WSDL and it is not
51  * supported by a JAX-WS runtime and it has not
52  * been explicitly turned off by the web service developer, then
53  * that JAX-WS runtime MUST behave appropriately based on whether it is
54  * on the client or server:
55  * <UL>
56  * <li>Client: runtime MUST throw a
57  * <code>WebServiceException</code> no sooner than when one of the methods
58  * above is invoked but no later than the first invocation of an endpoint
59  * operation.
60  * <li>Server: throw a WebServiceException and the endpoint MUST fail to deploy
61  * </ul>
62  * <li> DISABLED: In this Mode, an implementation may choose whether
63  * to inspect the <code>wsdl:binding<code> or not and to what degree
64  * the <code>wsdl:binding</code> will be inspected. For example,
65  * one implementation may choose to behave as if this feature is enabled,
66  * another implementation may only choose to verify the SEI's
67  * parameter/return type bindings.
68  * </ul>
69  *
70  * @see javax.xml.ws.soap.AddressingFeature
71  *
72  * @since JAX-WS 2.1
73  */

74 public final class RespectBindingFeature extends WebServiceFeature {
75     /**
76      *
77      * Constant value identifying the RespectBindingFeature
78      */

79     public static final String JavaDoc ID = "javax.xml.ws.RespectBindingFeature";
80     
81     
82     /**
83      * Creates an <code>RespectBindingFeature</code>.
84      * The instance created will be enabled.
85      */

86     public RespectBindingFeature() {
87         this.enabled = true;
88     }
89
90     /**
91      * Creates an RespectBindingFeature
92      *
93      * @param enabled specifies whether this feature should
94      * be enabled or not.
95      */

96     public RespectBindingFeature(boolean enabled) {
97         this.enabled = enabled;
98     }
99     
100     /**
101      * {@inheritDoc}
102      */

103     public String JavaDoc getID() {
104         return ID;
105     }
106 }
107
Popular Tags