KickJava   Java API By Example, From Geeks To Geeks.

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


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.namespace.QName JavaDoc;
9 import java.util.Iterator JavaDoc;
10 import javax.xml.ws.handler.HandlerResolver;
11 import javax.xml.bind.JAXBContext;
12 import javax.xml.ws.spi.ServiceDelegate;
13 import javax.xml.ws.spi.Provider;
14
15 /**
16  * <code>Service</code> objects provide the client view of a Web service.
17  * <p><code>Service</code> acts as a factory of the following:
18  * <ul>
19  * <li>Proxies for a target service endpoint.
20  * <li>Instances of {@link javax.xml.ws.Dispatch} for
21  * dynamic message-oriented invocation of a remote
22  * operation.
23  * </li>
24  *
25  * <p>The ports available on a service can be enumerated using the
26  * <code>getPorts</code> method. Alternatively, you can pass a
27  * service endpoint interface to the unary <code>getPort</code> method
28  * and let the runtime select a compatible port.
29  *
30  * <p>Handler chains for all the objects created by a <code>Service</code>
31  * can be set by means of a <code>HandlerResolver</code>.
32  *
33  * <p>An <code>Executor</code> may be set on the service in order
34  * to gain better control over the threads used to dispatch asynchronous
35  * callbacks. For instance, thread pooling with certain parameters
36  * can be enabled by creating a <code>ThreadPoolExecutor</code> and
37  * registering it with the service.
38  *
39  * @since JAX-WS 2.0
40  *
41  * @see javax.xml.ws.spi.Provider
42  * @see javax.xml.ws.handler.HandlerResolver
43  * @see java.util.concurrent.Executor
44  **/

45 public class Service {
46     
47     private ServiceDelegate delegate;
48     /**
49      * The orientation of a dynamic client or service. <code>MESSAGE</code> provides
50      * access to entire protocol message, <code>PAYLOAD</code> to protocol message
51      * payload only.
52      **/

53     public enum Mode { MESSAGE, PAYLOAD };
54     
55     protected Service(java.net.URL JavaDoc wsdlDocumentLocation, QName JavaDoc serviceName) {
56         delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
57                 serviceName,
58                 this.getClass());
59     }
60     
61     
62     /**
63      * The <code>getPort</code> method returns a proxy. A service client
64      * uses this proxy to invoke operations on the target
65      * service endpoint. The <code>serviceEndpointInterface</code>
66      * specifies the service endpoint interface that is supported by
67      * the created dynamic proxy instance.
68      *
69      * @param portName Qualified name of the service endpoint in
70      * the WSDL service description.
71      * @param serviceEndpointInterface Service endpoint interface
72      * supported by the dynamic proxy instance.
73      * @return Object Proxy instance that
74      * supports the specified service endpoint
75      * interface.
76      * @throws WebServiceException This exception is thrown in the
77      * following cases:
78      * <UL>
79      * <LI>If there is an error in creation of
80      * the proxy.
81      * <LI>If there is any missing WSDL metadata
82      * as required by this method.
83      * <LI>If an illegal
84      * <code>serviceEndpointInterface</code>
85      * or <code>portName</code> is specified.
86      * </UL>
87      * @see java.lang.reflect.Proxy
88      * @see java.lang.reflect.InvocationHandler
89      **/

90     public <T> T getPort(QName JavaDoc portName,
91             Class JavaDoc<T> serviceEndpointInterface) {
92         return delegate.getPort(portName, serviceEndpointInterface);
93     }
94     
95     /**
96      * The <code>getPort</code> method returns a proxy. A service client
97      * uses this proxy to invoke operations on the target
98      * service endpoint. The <code>serviceEndpointInterface</code>
99      * specifies the service endpoint interface that is supported by
100      * the created dynamic proxy instance.
101      *
102      * @param portName Qualified name of the service endpoint in
103      * the WSDL service description.
104      * @param serviceEndpointInterface Service endpoint interface
105      * supported by the dynamic proxy instance.
106      * @param features A list of WebServiceFeatures to configure on the
107      * proxy. Supported features not in the <code>features
108      * </code> parameter will have their default values.
109      * @return Object Proxy instance that
110      * supports the specified service endpoint
111      * interface.
112      * @throws WebServiceException This exception is thrown in the
113      * following cases:
114      * <UL>
115      * <LI>If there is an error in creation of
116      * the proxy.
117      * <LI>If there is any missing WSDL metadata
118      * as required by this method.
119      * <LI>If an illegal
120      * <code>serviceEndpointInterface</code>
121      * or <code>portName</code> is specified.
122      * <LI>If a feature is enabled that is not compatible
123      * with this port or is unsupported.
124      * </UL>
125      * @see java.lang.reflect.Proxy
126      * @see java.lang.reflect.InvocationHandler
127      * @see WebServiceFeature
128      *
129      * @since JAX-WS 2.1
130      **/

131     public <T> T getPort(QName JavaDoc portName,
132             Class JavaDoc<T> serviceEndpointInterface, WebServiceFeature... features) {
133         return delegate.getPort(portName, serviceEndpointInterface, features);
134     }
135     
136     
137     /**
138      * The <code>getPort</code> method returns a proxy. The parameter
139      * <code>serviceEndpointInterface</code> specifies the service
140      * endpoint interface that is supported by the returned proxy.
141      * In the implementation of this method, the JAX-WS
142      * runtime system takes the responsibility of selecting a protocol
143      * binding (and a port) and configuring the proxy accordingly.
144      * The returned proxy should not be reconfigured by the client.
145      *
146      * @param serviceEndpointInterface Service endpoint interface.
147      * @return Object instance that supports the
148      * specified service endpoint interface.
149      * @throws WebServiceException
150      * <UL>
151      * <LI>If there is an error during creation
152      * of the proxy.
153      * <LI>If there is any missing WSDL metadata
154      * as required by this method.
155      * <LI>If an illegal.
156      * <code>serviceEndpointInterface</code>
157      * is specified.
158      * </UL>
159      **/

160     public <T> T getPort(Class JavaDoc<T> serviceEndpointInterface) {
161         return delegate.getPort(serviceEndpointInterface);
162     }
163        
164     
165     /**
166      * The <code>getPort</code> method returns a proxy. The parameter
167      * <code>serviceEndpointInterface</code> specifies the service
168      * endpoint interface that is supported by the returned proxy.
169      * In the implementation of this method, the JAX-WS
170      * runtime system takes the responsibility of selecting a protocol
171      * binding (and a port) and configuring the proxy accordingly.
172      * The returned proxy should not be reconfigured by the client.
173      *
174      * @param serviceEndpointInterface Service endpoint interface.
175      * @param features A list of WebServiceFeatures to configure on the
176      * proxy. Supported features not in the <code>features
177      * </code> parameter will have their default values.
178      * @return Object instance that supports the
179      * specified service endpoint interface.
180      * @throws WebServiceException
181      * <UL>
182      * <LI>If there is an error during creation
183      * of the proxy.
184      * <LI>If there is any missing WSDL metadata
185      * as required by this method.
186      * <LI>If an illegal
187      * <code>serviceEndpointInterface</code>
188      * is specified.
189      * <LI>If a feature is enabled that is not compatible
190      * with this port or is unsupported.
191      * </UL>
192      *
193      * @see WebServiceFeature
194      *
195      * @since JAX-WS 2.1
196      **/

197     public <T> T getPort(Class JavaDoc<T> serviceEndpointInterface,
198             WebServiceFeature... features) {
199         return delegate.getPort(serviceEndpointInterface, features);
200     }
201
202     
203     /**
204      * The <code>getPort</code> method returns a proxy.
205      * The parameter <code>endpointReference</code> specifies the
206      * endpoint that will be invoked by the returned proxy. If there
207      * are any reference parameters in the
208      * <code>endpointReference</code>, then those reference
209      * parameters MUST appear as SOAP headers, indicating them to be
210      * reference parameters, on all messages sent to the endpoint.
211      * The <code>endpointReference's</code> address MUST be used
212      * for invocations on the endpoint.
213      * The parameter <code>serviceEndpointInterface</code> specifies
214      * the service endpoint interface that is supported by the
215      * returned proxy.
216      * In the implementation of this method, the JAX-WS
217      * runtime system takes the responsibility of selecting a protocol
218      * binding (and a port) and configuring the proxy accordingly from
219      * the WSDL associated with this <code>Service</code> instance or
220      * from the metadata from the <code>endpointReference</code>.
221      * If this <code>Service</code> instance has a WSDL and
222      * the <code>endpointReference</code> metadata
223      * also has a WSDL, then the WSDL from this instance MUST be used.
224      * If this <code>Service</code> instance does not have a WSDL and
225      * the <code>endpointReference</code> does have a WSDL, then the
226      * WSDL from the <code>endpointReference</code> MAY be used.
227      * The returned proxy should not be reconfigured by the client.
228      * If this <code>Service</code> instance has a known proxy
229      * port that matches the information contained in
230      * the WSDL,
231      * then that proxy is returned, otherwise a WebServiceException
232      * is thrown.
233      * <p>
234      * Calling this method has the same behavior as the following
235      * <pre>
236      * <code>port = service.getPort(portName, serviceEndpointInterface);</code>
237      * </pre>
238      * where the <code>portName</code> is retrieved from the
239      * metadata of the <code>endpointReference</code> or from the
240      * <code>serviceEndpointInterface</code> and the WSDL
241      * associated with this <code>Service</code> instance.
242      *
243      * @param endpointReference The <code>EndpointReference</code>
244      * for the target service endpoint that will be invoked by the
245      * returned proxy.
246      * @param serviceEndpointInterface Service endpoint interface.
247      * @param features A list of <code>WebServiceFeatures</code> to configure on the
248      * proxy. Supported features not in the <code>features
249      * </code> parameter will have their default values.
250      * @return Object Proxy instance that supports the
251      * specified service endpoint interface.
252      * @throws WebServiceException
253      * <UL>
254      * <LI>If there is an error during creation
255      * of the proxy.
256      * <LI>If there is any missing WSDL metadata
257      * as required by this method.
258      * <LI>If the <code>endpointReference</code> metadata does
259      * not match the <code>serviceName</code> of this
260      * <code>Service</code> instance.
261      * <LI>If a <code>portName</code> cannot be extracted
262      * from the WSDL or <code>endpointReference</code> metadata.
263      * <LI>If an invalid
264      * <code>endpointReference</code>
265      * is specified.
266      * <LI>If an invalid
267      * <code>serviceEndpointInterface</code>
268      * is specified.
269      * <LI>If a feature is enabled that is not compatible
270      * with this port or is unsupported.
271      * </UL>
272      *
273      * @since JAX-WS 2.1
274      **/

275     public <T> T getPort(EndpointReference endpointReference,
276            Class JavaDoc<T> serviceEndpointInterface, WebServiceFeature... features) {
277         return delegate.getPort(endpointReference, serviceEndpointInterface, features);
278     }
279     
280     /**
281      * Creates a new port for the service. Ports created in this way contain
282      * no WSDL port type information and can only be used for creating
283      * <code>Dispatch</code>instances.
284      *
285      * @param portName Qualified name for the target service endpoint.
286      * @param bindingId A String identifier of a binding.
287      * @param endpointAddress Address of the target service endpoint as a URI.
288      * @throws WebServiceException If any error in the creation of
289      * the port.
290      *
291      * @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
292      * @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
293      * @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
294      **/

295     public void addPort(QName JavaDoc portName, String JavaDoc bindingId, String JavaDoc endpointAddress) {
296         delegate.addPort(portName, bindingId, endpointAddress);
297     }
298     
299         
300     /**
301      * Creates a <code>Dispatch</code> instance for use with objects of
302      * the user's choosing.
303      *
304      * @param portName Qualified name for the target service endpoint
305      * @param type The class of object used for messages or message
306      * payloads. Implementations are required to support
307      * <code>javax.xml.transform.Source</code>, <code>javax.xml.soap.SOAPMessage</code>
308      * and <code>javax.activation.DataSource</code>, depending on
309      * the binding in use.
310      * @param mode Controls whether the created dispatch instance is message
311      * or payload oriented, i.e. whether the user will work with complete
312      * protocol messages or message payloads. E.g. when using the SOAP
313      * protocol, this parameter controls whether the user will work with
314      * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
315      * when type is SOAPMessage.
316      *
317      * @return Dispatch instance.
318      * @throws WebServiceException If any error in the creation of
319      * the <code>Dispatch</code> object.
320      *
321      * @see javax.xml.transform.Source
322      * @see javax.xml.soap.SOAPMessage
323      **/

324     public <T> Dispatch<T> createDispatch(QName JavaDoc portName, Class JavaDoc<T> type, Mode mode) {
325         return delegate.createDispatch(portName, type, mode);
326     }
327     
328     
329     /**
330      * Creates a <code>Dispatch</code> instance for use with objects of
331      * the user's choosing.
332      *
333      * @param portName Qualified name for the target service endpoint
334      * @param type The class of object used for messages or message
335      * payloads. Implementations are required to support
336      * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
337      * @param mode Controls whether the created dispatch instance is message
338      * or payload oriented, i.e. whether the user will work with complete
339      * protocol messages or message payloads. E.g. when using the SOAP
340      * protocol, this parameter controls whether the user will work with
341      * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
342      * when type is <code>SOAPMessage</code>.
343      * @param features A list of <code>WebServiceFeatures</code> to configure on the
344      * proxy. Supported features not in the <code>features
345      * </code> parameter will have their default values.
346      *
347      * @return Dispatch instance.
348      * @throws WebServiceException If any error in the creation of
349      * the <code>Dispatch</code> object or if a
350      * feature is enabled that is not compatible with
351      * this port or is unsupported.
352      *
353      * @see javax.xml.transform.Source
354      * @see javax.xml.soap.SOAPMessage
355      * @see WebServiceFeature
356      *
357      * @since JAX-WS 2.1
358      **/

359     public <T> Dispatch<T> createDispatch(QName JavaDoc portName, Class JavaDoc<T> type,
360             Service.Mode mode, WebServiceFeature... features) {
361         return delegate.createDispatch(portName, type, mode, features);
362     }
363     
364     
365     /**
366      * Creates a <code>Dispatch</code> instance for use with objects of
367      * the user's choosing. If there
368      * are any reference parameters in the
369      * <code>endpointReference</code>, then those reference
370      * parameters MUST appear as SOAP headers, indicating them to be
371      * reference parameters, on all messages sent to the endpoint.
372      * The <code>endpointReference's</code> address MUST be used
373      * for invocations on the endpoint.
374      * In the implementation of this method, the JAX-WS
375      * runtime system takes the responsibility of selecting a protocol
376      * binding (and a port) and configuring the dispatch accordingly from
377      * the WSDL associated with this <code>Service</code> instance or
378      * from the metadata from the <code>endpointReference</code>.
379      * If this <code>Service</code> instance has a WSDL and
380      * the <code>endpointReference</code>
381      * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
382      * If this <code>Service</code> instance does not have a WSDL and
383      * the <code>endpointReference</code> does have a WSDL, then the
384      * WSDL from the <code>endpointReference</code> MAY be used.
385      * An implementation MUST be able to retrieve the <code>portName</code> from the
386      * <code>endpointReference</code> metadata.
387      * <p>
388      * This method behaves the same as calling
389      * <pre>
390      * <code>dispatch = service.createDispatch(portName, type, mode, features);</code>
391      * </pre>
392      * where the <code>portName</code> is retrieved from the
393      * WSDL or <code>EndpointReference</code> metadata.
394      *
395      * @param endpointReference The <code>EndpointReference</code>
396      * for the target service endpoint that will be invoked by the
397      * returned <code>Dispatch</code> object.
398      * @param type The class of object used to messages or message
399      * payloads. Implementations are required to support
400      * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
401      * @param mode Controls whether the created dispatch instance is message
402      * or payload oriented, i.e. whether the user will work with complete
403      * protocol messages or message payloads. E.g. when using the SOAP
404      * protocol, this parameter controls whether the user will work with
405      * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
406      * when type is <code>SOAPMessage</code>.
407      * @param features An array of <code>WebServiceFeatures</code> to configure on the
408      * proxy. Supported features not in the <code>features
409      * </code> parameter will have their default values.
410      *
411      * @return Dispatch instance
412      * @throws WebServiceException
413      * <UL>
414      * <LI>If there is any missing WSDL metadata
415      * as required by this method.
416      * <li>If the <code>endpointReference</code> metadata does
417      * not match the <code>serviceName</code> or <code>portName</code>
418      * of a WSDL associated
419      * with this <code>Service</code> instance.
420      * <li>If the <code>portName</code> cannot be determined
421      * from the <code>EndpointReference</code> metadata.
422      * <li>If any error in the creation of
423      * the <code>Dispatch</code> object.
424      * <li>If a feature is enabled that is not
425      * compatible with this port or is unsupported.
426      * </UL>
427      *
428      * @see javax.xml.transform.Source
429      * @see javax.xml.soap.SOAPMessage
430      * @see WebServiceFeature
431      *
432      * @since JAX-WS 2.1
433      **/

434     public <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
435             Class JavaDoc<T> type, Service.Mode mode,
436             WebServiceFeature... features) {
437         return delegate.createDispatch(endpointReference, type, mode, features);
438     }
439     
440     /**
441      * Creates a <code>Dispatch</code> instance for use with JAXB
442      * generated objects.
443      *
444      * @param portName Qualified name for the target service endpoint
445      * @param context The JAXB context used to marshall and unmarshall
446      * messages or message payloads.
447      * @param mode Controls whether the created dispatch instance is message
448      * or payload oriented, i.e. whether the user will work with complete
449      * protocol messages or message payloads. E.g. when using the SOAP
450      * protocol, this parameter controls whether the user will work with
451      * SOAP messages or the contents of a SOAP body.
452      *
453      * @return Dispatch instance.
454      * @throws WebServiceException If any error in the creation of
455      * the <code>Dispatch</code> object.
456      *
457      * @see javax.xml.bind.JAXBContext
458      **/

459     public Dispatch<Object JavaDoc> createDispatch(QName JavaDoc portName, JAXBContext context,
460             Mode mode) {
461         return delegate.createDispatch(portName, context, mode);
462     }
463         
464     
465     /**
466      * Creates a <code>Dispatch</code> instance for use with JAXB
467      * generated objects.
468      *
469      * @param portName Qualified name for the target service endpoint
470      * @param context The JAXB context used to marshall and unmarshall
471      * messages or message payloads.
472      * @param mode Controls whether the created dispatch instance is message
473      * or payload oriented, i.e. whether the user will work with complete
474      * protocol messages or message payloads. E.g. when using the SOAP
475      * protocol, this parameter controls whether the user will work with
476      * SOAP messages or the contents of a SOAP body.
477      * @param features A list of <code>WebServiceFeatures</code> to configure on the
478      * proxy. Supported features not in the <code>features
479      * </code> parameter will have their default values.
480      *
481      * @return Dispatch instance.
482      * @throws WebServiceException If any error in the creation of
483      * the <code>Dispatch</code> object or if a
484      * feature is enabled that is not compatible with
485      * this port or is unsupported.
486      *
487      * @see javax.xml.bind.JAXBContext
488      * @see WebServiceFeature
489      *
490      * @since JAX-WS 2.1
491      **/

492     public Dispatch<Object JavaDoc> createDispatch(QName JavaDoc portName,
493             JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
494         return delegate.createDispatch(portName, context, mode, features);
495     }
496     
497     
498     /**
499      * Creates a <code>Dispatch</code> instance for use with JAXB
500      * generated objects. If there
501      * are any reference parameters in the
502      * <code>endpointReference</code>, then those reference
503      * parameters MUST appear as SOAP headers, indicating them to be
504      * reference parameters, on all messages sent to the endpoint.
505      * The <code>endpointReference's</code> address MUST be used
506      * for invocations on the endpoint.
507      * In the implementation of this method, the JAX-WS
508      * runtime system takes the responsibility of selecting a protocol
509      * binding (and a port) and configuring the dispatch accordingly from
510      * the WSDL associated with this <code>Service</code> instance or
511      * from the metadata from the <code>endpointReference</code>.
512      * If this <code>Service</code> instance has a WSDL and
513      * the <code>endpointReference</code>
514      * also has a WSDL in its metadata, then the WSDL from this instance
515      * MUST be used.
516      * If this <code>Service</code> instance does not have a WSDL and
517      * the <code>endpointReference</code> does have a WSDL, then the
518      * WSDL from the <code>endpointReference</code> MAY be used.
519      * An implementation MUST be able to retrieve the <code>portName</code> from the
520      * <code>endpointReference</code> metadata.
521      * <p>
522      * This method behavies the same as calling
523      * <pre>
524      * <code>dispatch = service.createDispatch(portName, context, mode, features);</code>
525      * </pre>
526      * where the <code>portName</code> is retrieved from the
527      * WSDL or <code>endpointReference</code> metadata.
528      *
529      * @param endpointReference The <code>EndpointReference</code>
530      * for the target service endpoint that will be invoked by the
531      * returned <code>Dispatch</code> object.
532      * @param context The JAXB context used to marshall and unmarshall
533      * messages or message payloads.
534      * @param mode Controls whether the created dispatch instance is message
535      * or payload oriented, i.e. whether the user will work with complete
536      * protocol messages or message payloads. E.g. when using the SOAP
537      * protocol, this parameter controls whether the user will work with
538      * SOAP messages or the contents of a SOAP body.
539      * @param features An array of <code>WebServiceFeatures</code> to configure on the
540      * proxy. Supported features not in the <code>features
541      * </code> parameter will have their default values.
542      *
543      * @return Dispatch instance
544      * @throws WebServiceException
545      * <UL>
546      * <li>If there is any missing WSDL metadata
547      * as required by this method.
548      * <li>If the <code>endpointReference</code> metadata does
549      * not match the <code>serviceName</code> or <code>portName</code>
550      * of a WSDL associated
551      * with this <code>Service</code> instance.
552      * <li>If the <code>portName</code> cannot be determined
553      * from the <code>EndpointReference</code> metadata.
554      * <li>If any error in the creation of
555      * the <code>Dispatch</code> object.
556      * <li>if a feature is enabled that is not
557      * compatible with this port or is unsupported.
558      * </UL>
559      *
560      * @see javax.xml.bind.JAXBContext
561      * @see WebServiceFeature
562      *
563      * @since JAX-WS 2.1
564     **/

565     public Dispatch<Object JavaDoc> createDispatch(EndpointReference endpointReference,
566             JAXBContext context, Service.Mode mode,
567             WebServiceFeature... features) {
568         return delegate.createDispatch(endpointReference, context, mode, features);
569     }
570     
571     /**
572      * Gets the name of this service.
573      * @return Qualified name of this service
574      **/

575     public QName JavaDoc getServiceName() {
576         return delegate.getServiceName();
577     }
578     
579     /**
580      * Returns an <code>Iterator</code> for the list of
581      * <code>QName</code>s of service endpoints grouped by this
582      * service
583      *
584      * @return Returns <code>java.util.Iterator</code> with elements
585      * of type <code>javax.xml.namespace.QName</code>.
586      * @throws WebServiceException If this Service class does not
587      * have access to the required WSDL metadata.
588      **/

589     public Iterator JavaDoc<javax.xml.namespace.QName JavaDoc> getPorts() {
590         return delegate.getPorts();
591     }
592     
593     /**
594      * Gets the location of the WSDL document for this Service.
595      *
596      * @return URL for the location of the WSDL document for
597      * this service.
598      **/

599     public java.net.URL JavaDoc getWSDLDocumentLocation() {
600         return delegate.getWSDLDocumentLocation();
601     }
602     
603     /**
604      * Returns the configured handler resolver.
605      *
606      * @return HandlerResolver The <code>HandlerResolver</code> being
607      * used by this <code>Service</code> instance, or <code>null</code>
608      * if there isn't one.
609      **/

610     public HandlerResolver getHandlerResolver() {
611         return delegate.getHandlerResolver();
612     }
613     
614     /**
615      * Sets the <code>HandlerResolver</code> for this <code>Service</code>
616      * instance.
617      * <p>
618      * The handler resolver, if present, will be called once for each
619      * proxy or dispatch instance that is created, and the handler chain
620      * returned by the resolver will be set on the instance.
621      *
622      * @param handlerResolver The <code>HandlerResolver</code> to use
623      * for all subsequently created proxy/dispatch objects.
624      *
625      * @see javax.xml.ws.handler.HandlerResolver
626      **/

627     public void setHandlerResolver(HandlerResolver handlerResolver) {
628         delegate.setHandlerResolver(handlerResolver);
629     }
630     
631     /**
632      * Returns the executor for this <code>Service</code>instance.
633      *
634      * The executor is used for all asynchronous invocations that
635      * require callbacks.
636      *
637      * @return The <code>java.util.concurrent.Executor</code> to be
638      * used to invoke a callback.
639      *
640      * @see java.util.concurrent.Executor
641      **/

642     public java.util.concurrent.Executor JavaDoc getExecutor() {
643         return delegate.getExecutor();
644     }
645     
646     /**
647      * Sets the executor for this <code>Service</code> instance.
648      *
649      * The executor is used for all asynchronous invocations that
650      * require callbacks.
651      *
652      * @param executor The <code>java.util.concurrent.Executor</code>
653      * to be used to invoke a callback.
654      *
655      * @throws SecurityException If the instance does not support
656      * setting an executor for security reasons (e.g. the
657      * necessary permissions are missing).
658      *
659      * @see java.util.concurrent.Executor
660      **/

661     public void setExecutor(java.util.concurrent.Executor JavaDoc executor) {
662         delegate.setExecutor(executor);
663     }
664     
665     /**
666      * Creates a <code>Service</code> instance.
667      *
668      * The specified WSDL document location and service qualified name MUST
669      * uniquely identify a <code>wsdl:service</code> element.
670      *
671      * @param wsdlDocumentLocation <code>URL</code> for the WSDL document location
672      * for the service
673      * @param serviceName <code>QName</code> for the service
674      * @throws WebServiceException If any error in creation of the
675      * specified service.
676      **/

677     public static Service create(
678             java.net.URL JavaDoc wsdlDocumentLocation,
679             QName JavaDoc serviceName) {
680         return new Service(wsdlDocumentLocation, serviceName);
681     }
682     
683     /**
684      * Creates a <code>Service</code> instance.
685      *
686      * @param serviceName <code>QName</code> for the service
687      * @throws WebServiceException If any error in creation of the
688      * specified service
689      */

690     public static Service create(QName JavaDoc serviceName) {
691         return new Service(null, serviceName);
692     }
693 }
694
695
696
697
Popular Tags