001: /*
002: * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
003: * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
004: */
005:
006: package javax.xml.ws;
007:
008: import javax.xml.namespace.QName;
009: import java.util.Iterator;
010: import javax.xml.ws.handler.HandlerResolver;
011: import javax.xml.bind.JAXBContext;
012: import javax.xml.ws.spi.ServiceDelegate;
013: import javax.xml.ws.spi.Provider;
014:
015: /**
016: * <code>Service</code> objects provide the client view of a Web service.
017: * <p><code>Service</code> acts as a factory of the following:
018: * <ul>
019: * <li>Proxies for a target service endpoint.
020: * <li>Instances of {@link javax.xml.ws.Dispatch} for
021: * dynamic message-oriented invocation of a remote
022: * operation.
023: * </li>
024: *
025: * <p>The ports available on a service can be enumerated using the
026: * <code>getPorts</code> method. Alternatively, you can pass a
027: * service endpoint interface to the unary <code>getPort</code> method
028: * and let the runtime select a compatible port.
029: *
030: * <p>Handler chains for all the objects created by a <code>Service</code>
031: * can be set by means of a <code>HandlerResolver</code>.
032: *
033: * <p>An <code>Executor</code> may be set on the service in order
034: * to gain better control over the threads used to dispatch asynchronous
035: * callbacks. For instance, thread pooling with certain parameters
036: * can be enabled by creating a <code>ThreadPoolExecutor</code> and
037: * registering it with the service.
038: *
039: * @since JAX-WS 2.0
040: *
041: * @see javax.xml.ws.spi.Provider
042: * @see javax.xml.ws.handler.HandlerResolver
043: * @see java.util.concurrent.Executor
044: **/
045: public class Service {
046:
047: private ServiceDelegate delegate;
048:
049: /**
050: * The orientation of a dynamic client or service. <code>MESSAGE</code> provides
051: * access to entire protocol message, <code>PAYLOAD</code> to protocol message
052: * payload only.
053: **/
054: public enum Mode {
055: MESSAGE, PAYLOAD
056: };
057:
058: protected Service(java.net.URL wsdlDocumentLocation,
059: QName serviceName) {
060: delegate = Provider.provider().createServiceDelegate(
061: wsdlDocumentLocation, serviceName, this .getClass());
062: }
063:
064: /**
065: * The <code>getPort</code> method returns a proxy. A service client
066: * uses this proxy to invoke operations on the target
067: * service endpoint. The <code>serviceEndpointInterface</code>
068: * specifies the service endpoint interface that is supported by
069: * the created dynamic proxy instance.
070: *
071: * @param portName Qualified name of the service endpoint in
072: * the WSDL service description.
073: * @param serviceEndpointInterface Service endpoint interface
074: * supported by the dynamic proxy instance.
075: * @return Object Proxy instance that
076: * supports the specified service endpoint
077: * interface.
078: * @throws WebServiceException This exception is thrown in the
079: * following cases:
080: * <UL>
081: * <LI>If there is an error in creation of
082: * the proxy.
083: * <LI>If there is any missing WSDL metadata
084: * as required by this method.
085: * <LI>If an illegal
086: * <code>serviceEndpointInterface</code>
087: * or <code>portName</code> is specified.
088: * </UL>
089: * @see java.lang.reflect.Proxy
090: * @see java.lang.reflect.InvocationHandler
091: **/
092: public <T> T getPort(QName portName,
093: Class<T> serviceEndpointInterface) {
094: return delegate.getPort(portName, serviceEndpointInterface);
095: }
096:
097: /**
098: * The <code>getPort</code> method returns a proxy. A service client
099: * uses this proxy to invoke operations on the target
100: * service endpoint. The <code>serviceEndpointInterface</code>
101: * specifies the service endpoint interface that is supported by
102: * the created dynamic proxy instance.
103: *
104: * @param portName Qualified name of the service endpoint in
105: * the WSDL service description.
106: * @param serviceEndpointInterface Service endpoint interface
107: * supported by the dynamic proxy instance.
108: * @param features A list of WebServiceFeatures to configure on the
109: * proxy. Supported features not in the <code>features
110: * </code> parameter will have their default values.
111: * @return Object Proxy instance that
112: * supports the specified service endpoint
113: * interface.
114: * @throws WebServiceException This exception is thrown in the
115: * following cases:
116: * <UL>
117: * <LI>If there is an error in creation of
118: * the proxy.
119: * <LI>If there is any missing WSDL metadata
120: * as required by this method.
121: * <LI>If an illegal
122: * <code>serviceEndpointInterface</code>
123: * or <code>portName</code> is specified.
124: * <LI>If a feature is enabled that is not compatible
125: * with this port or is unsupported.
126: * </UL>
127: * @see java.lang.reflect.Proxy
128: * @see java.lang.reflect.InvocationHandler
129: * @see WebServiceFeature
130: *
131: * @since JAX-WS 2.1
132: **/
133: public <T> T getPort(QName portName,
134: Class<T> serviceEndpointInterface,
135: WebServiceFeature... features) {
136: return delegate.getPort(portName, serviceEndpointInterface,
137: features);
138: }
139:
140: /**
141: * The <code>getPort</code> method returns a proxy. The parameter
142: * <code>serviceEndpointInterface</code> specifies the service
143: * endpoint interface that is supported by the returned proxy.
144: * In the implementation of this method, the JAX-WS
145: * runtime system takes the responsibility of selecting a protocol
146: * binding (and a port) and configuring the proxy accordingly.
147: * The returned proxy should not be reconfigured by the client.
148: *
149: * @param serviceEndpointInterface Service endpoint interface.
150: * @return Object instance that supports the
151: * specified service endpoint interface.
152: * @throws WebServiceException
153: * <UL>
154: * <LI>If there is an error during creation
155: * of the proxy.
156: * <LI>If there is any missing WSDL metadata
157: * as required by this method.
158: * <LI>If an illegal.
159: * <code>serviceEndpointInterface</code>
160: * is specified.
161: * </UL>
162: **/
163: public <T> T getPort(Class<T> serviceEndpointInterface) {
164: return delegate.getPort(serviceEndpointInterface);
165: }
166:
167: /**
168: * The <code>getPort</code> method returns a proxy. The parameter
169: * <code>serviceEndpointInterface</code> specifies the service
170: * endpoint interface that is supported by the returned proxy.
171: * In the implementation of this method, the JAX-WS
172: * runtime system takes the responsibility of selecting a protocol
173: * binding (and a port) and configuring the proxy accordingly.
174: * The returned proxy should not be reconfigured by the client.
175: *
176: * @param serviceEndpointInterface Service endpoint interface.
177: * @param features A list of WebServiceFeatures to configure on the
178: * proxy. Supported features not in the <code>features
179: * </code> parameter will have their default values.
180: * @return Object instance that supports the
181: * specified service endpoint interface.
182: * @throws WebServiceException
183: * <UL>
184: * <LI>If there is an error during creation
185: * of the proxy.
186: * <LI>If there is any missing WSDL metadata
187: * as required by this method.
188: * <LI>If an illegal
189: * <code>serviceEndpointInterface</code>
190: * is specified.
191: * <LI>If a feature is enabled that is not compatible
192: * with this port or is unsupported.
193: * </UL>
194: *
195: * @see WebServiceFeature
196: *
197: * @since JAX-WS 2.1
198: **/
199: public <T> T getPort(Class<T> serviceEndpointInterface,
200: WebServiceFeature... features) {
201: return delegate.getPort(serviceEndpointInterface, features);
202: }
203:
204: /**
205: * The <code>getPort</code> method returns a proxy.
206: * The parameter <code>endpointReference</code> specifies the
207: * endpoint that will be invoked by the returned proxy. If there
208: * are any reference parameters in the
209: * <code>endpointReference</code>, then those reference
210: * parameters MUST appear as SOAP headers, indicating them to be
211: * reference parameters, on all messages sent to the endpoint.
212: * The <code>endpointReference's</code> address MUST be used
213: * for invocations on the endpoint.
214: * The parameter <code>serviceEndpointInterface</code> specifies
215: * the service endpoint interface that is supported by the
216: * returned proxy.
217: * In the implementation of this method, the JAX-WS
218: * runtime system takes the responsibility of selecting a protocol
219: * binding (and a port) and configuring the proxy accordingly from
220: * the WSDL associated with this <code>Service</code> instance or
221: * from the metadata from the <code>endpointReference</code>.
222: * If this <code>Service</code> instance has a WSDL and
223: * the <code>endpointReference</code> metadata
224: * also has a WSDL, then the WSDL from this instance MUST be used.
225: * If this <code>Service</code> instance does not have a WSDL and
226: * the <code>endpointReference</code> does have a WSDL, then the
227: * WSDL from the <code>endpointReference</code> MAY be used.
228: * The returned proxy should not be reconfigured by the client.
229: * If this <code>Service</code> instance has a known proxy
230: * port that matches the information contained in
231: * the WSDL,
232: * then that proxy is returned, otherwise a WebServiceException
233: * is thrown.
234: * <p>
235: * Calling this method has the same behavior as the following
236: * <pre>
237: * <code>port = service.getPort(portName, serviceEndpointInterface);</code>
238: * </pre>
239: * where the <code>portName</code> is retrieved from the
240: * metadata of the <code>endpointReference</code> or from the
241: * <code>serviceEndpointInterface</code> and the WSDL
242: * associated with this <code>Service</code> instance.
243: *
244: * @param endpointReference The <code>EndpointReference</code>
245: * for the target service endpoint that will be invoked by the
246: * returned proxy.
247: * @param serviceEndpointInterface Service endpoint interface.
248: * @param features A list of <code>WebServiceFeatures</code> to configure on the
249: * proxy. Supported features not in the <code>features
250: * </code> parameter will have their default values.
251: * @return Object Proxy instance that supports the
252: * specified service endpoint interface.
253: * @throws WebServiceException
254: * <UL>
255: * <LI>If there is an error during creation
256: * of the proxy.
257: * <LI>If there is any missing WSDL metadata
258: * as required by this method.
259: * <LI>If the <code>endpointReference</code> metadata does
260: * not match the <code>serviceName</code> of this
261: * <code>Service</code> instance.
262: * <LI>If a <code>portName</code> cannot be extracted
263: * from the WSDL or <code>endpointReference</code> metadata.
264: * <LI>If an invalid
265: * <code>endpointReference</code>
266: * is specified.
267: * <LI>If an invalid
268: * <code>serviceEndpointInterface</code>
269: * is specified.
270: * <LI>If a feature is enabled that is not compatible
271: * with this port or is unsupported.
272: * </UL>
273: *
274: * @since JAX-WS 2.1
275: **/
276: public <T> T getPort(EndpointReference endpointReference,
277: Class<T> serviceEndpointInterface,
278: WebServiceFeature... features) {
279: return delegate.getPort(endpointReference,
280: serviceEndpointInterface, features);
281: }
282:
283: /**
284: * Creates a new port for the service. Ports created in this way contain
285: * no WSDL port type information and can only be used for creating
286: * <code>Dispatch</code>instances.
287: *
288: * @param portName Qualified name for the target service endpoint.
289: * @param bindingId A String identifier of a binding.
290: * @param endpointAddress Address of the target service endpoint as a URI.
291: * @throws WebServiceException If any error in the creation of
292: * the port.
293: *
294: * @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
295: * @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
296: * @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
297: **/
298: public void addPort(QName portName, String bindingId,
299: String endpointAddress) {
300: delegate.addPort(portName, bindingId, endpointAddress);
301: }
302:
303: /**
304: * Creates a <code>Dispatch</code> instance for use with objects of
305: * the user's choosing.
306: *
307: * @param portName Qualified name for the target service endpoint
308: * @param type The class of object used for messages or message
309: * payloads. Implementations are required to support
310: * <code>javax.xml.transform.Source</code>, <code>javax.xml.soap.SOAPMessage</code>
311: * and <code>javax.activation.DataSource</code>, depending on
312: * the binding in use.
313: * @param mode Controls whether the created dispatch instance is message
314: * or payload oriented, i.e. whether the user will work with complete
315: * protocol messages or message payloads. E.g. when using the SOAP
316: * protocol, this parameter controls whether the user will work with
317: * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
318: * when type is SOAPMessage.
319: *
320: * @return Dispatch instance.
321: * @throws WebServiceException If any error in the creation of
322: * the <code>Dispatch</code> object.
323: *
324: * @see javax.xml.transform.Source
325: * @see javax.xml.soap.SOAPMessage
326: **/
327: public <T> Dispatch<T> createDispatch(QName portName,
328: Class<T> type, Mode mode) {
329: return delegate.createDispatch(portName, type, mode);
330: }
331:
332: /**
333: * Creates a <code>Dispatch</code> instance for use with objects of
334: * the user's choosing.
335: *
336: * @param portName Qualified name for the target service endpoint
337: * @param type The class of object used for messages or message
338: * payloads. Implementations are required to support
339: * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
340: * @param mode Controls whether the created dispatch instance is message
341: * or payload oriented, i.e. whether the user will work with complete
342: * protocol messages or message payloads. E.g. when using the SOAP
343: * protocol, this parameter controls whether the user will work with
344: * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
345: * when type is <code>SOAPMessage</code>.
346: * @param features A list of <code>WebServiceFeatures</code> to configure on the
347: * proxy. Supported features not in the <code>features
348: * </code> parameter will have their default values.
349: *
350: * @return Dispatch instance.
351: * @throws WebServiceException If any error in the creation of
352: * the <code>Dispatch</code> object or if a
353: * feature is enabled that is not compatible with
354: * this port or is unsupported.
355: *
356: * @see javax.xml.transform.Source
357: * @see javax.xml.soap.SOAPMessage
358: * @see WebServiceFeature
359: *
360: * @since JAX-WS 2.1
361: **/
362: public <T> Dispatch<T> createDispatch(QName portName,
363: Class<T> type, Service.Mode mode,
364: WebServiceFeature... features) {
365: return delegate.createDispatch(portName, type, mode, features);
366: }
367:
368: /**
369: * Creates a <code>Dispatch</code> instance for use with objects of
370: * the user's choosing. If there
371: * are any reference parameters in the
372: * <code>endpointReference</code>, then those reference
373: * parameters MUST appear as SOAP headers, indicating them to be
374: * reference parameters, on all messages sent to the endpoint.
375: * The <code>endpointReference's</code> address MUST be used
376: * for invocations on the endpoint.
377: * In the implementation of this method, the JAX-WS
378: * runtime system takes the responsibility of selecting a protocol
379: * binding (and a port) and configuring the dispatch accordingly from
380: * the WSDL associated with this <code>Service</code> instance or
381: * from the metadata from the <code>endpointReference</code>.
382: * If this <code>Service</code> instance has a WSDL and
383: * the <code>endpointReference</code>
384: * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
385: * If this <code>Service</code> instance does not have a WSDL and
386: * the <code>endpointReference</code> does have a WSDL, then the
387: * WSDL from the <code>endpointReference</code> MAY be used.
388: * An implementation MUST be able to retrieve the <code>portName</code> from the
389: * <code>endpointReference</code> metadata.
390: * <p>
391: * This method behaves the same as calling
392: * <pre>
393: * <code>dispatch = service.createDispatch(portName, type, mode, features);</code>
394: * </pre>
395: * where the <code>portName</code> is retrieved from the
396: * WSDL or <code>EndpointReference</code> metadata.
397: *
398: * @param endpointReference The <code>EndpointReference</code>
399: * for the target service endpoint that will be invoked by the
400: * returned <code>Dispatch</code> object.
401: * @param type The class of object used to messages or message
402: * payloads. Implementations are required to support
403: * <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.
404: * @param mode Controls whether the created dispatch instance is message
405: * or payload oriented, i.e. whether the user will work with complete
406: * protocol messages or message payloads. E.g. when using the SOAP
407: * protocol, this parameter controls whether the user will work with
408: * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
409: * when type is <code>SOAPMessage</code>.
410: * @param features An array of <code>WebServiceFeatures</code> to configure on the
411: * proxy. Supported features not in the <code>features
412: * </code> parameter will have their default values.
413: *
414: * @return Dispatch instance
415: * @throws WebServiceException
416: * <UL>
417: * <LI>If there is any missing WSDL metadata
418: * as required by this method.
419: * <li>If the <code>endpointReference</code> metadata does
420: * not match the <code>serviceName</code> or <code>portName</code>
421: * of a WSDL associated
422: * with this <code>Service</code> instance.
423: * <li>If the <code>portName</code> cannot be determined
424: * from the <code>EndpointReference</code> metadata.
425: * <li>If any error in the creation of
426: * the <code>Dispatch</code> object.
427: * <li>If a feature is enabled that is not
428: * compatible with this port or is unsupported.
429: * </UL>
430: *
431: * @see javax.xml.transform.Source
432: * @see javax.xml.soap.SOAPMessage
433: * @see WebServiceFeature
434: *
435: * @since JAX-WS 2.1
436: **/
437: public <T> Dispatch<T> createDispatch(
438: EndpointReference endpointReference, Class<T> type,
439: Service.Mode mode, WebServiceFeature... features) {
440: return delegate.createDispatch(endpointReference, type, mode,
441: features);
442: }
443:
444: /**
445: * Creates a <code>Dispatch</code> instance for use with JAXB
446: * generated objects.
447: *
448: * @param portName Qualified name for the target service endpoint
449: * @param context The JAXB context used to marshall and unmarshall
450: * messages or message payloads.
451: * @param mode Controls whether the created dispatch instance is message
452: * or payload oriented, i.e. whether the user will work with complete
453: * protocol messages or message payloads. E.g. when using the SOAP
454: * protocol, this parameter controls whether the user will work with
455: * SOAP messages or the contents of a SOAP body.
456: *
457: * @return Dispatch instance.
458: * @throws WebServiceException If any error in the creation of
459: * the <code>Dispatch</code> object.
460: *
461: * @see javax.xml.bind.JAXBContext
462: **/
463: public Dispatch<Object> createDispatch(QName portName,
464: JAXBContext context, Mode mode) {
465: return delegate.createDispatch(portName, context, mode);
466: }
467:
468: /**
469: * Creates a <code>Dispatch</code> instance for use with JAXB
470: * generated objects.
471: *
472: * @param portName Qualified name for the target service endpoint
473: * @param context The JAXB context used to marshall and unmarshall
474: * messages or message payloads.
475: * @param mode Controls whether the created dispatch instance is message
476: * or payload oriented, i.e. whether the user will work with complete
477: * protocol messages or message payloads. E.g. when using the SOAP
478: * protocol, this parameter controls whether the user will work with
479: * SOAP messages or the contents of a SOAP body.
480: * @param features A list of <code>WebServiceFeatures</code> to configure on the
481: * proxy. Supported features not in the <code>features
482: * </code> parameter will have their default values.
483: *
484: * @return Dispatch instance.
485: * @throws WebServiceException If any error in the creation of
486: * the <code>Dispatch</code> object or if a
487: * feature is enabled that is not compatible with
488: * this port or is unsupported.
489: *
490: * @see javax.xml.bind.JAXBContext
491: * @see WebServiceFeature
492: *
493: * @since JAX-WS 2.1
494: **/
495: public Dispatch<Object> createDispatch(QName portName,
496: JAXBContext context, Service.Mode mode,
497: WebServiceFeature... features) {
498: return delegate.createDispatch(portName, context, mode,
499: features);
500: }
501:
502: /**
503: * Creates a <code>Dispatch</code> instance for use with JAXB
504: * generated objects. If there
505: * are any reference parameters in the
506: * <code>endpointReference</code>, then those reference
507: * parameters MUST appear as SOAP headers, indicating them to be
508: * reference parameters, on all messages sent to the endpoint.
509: * The <code>endpointReference's</code> address MUST be used
510: * for invocations on the endpoint.
511: * In the implementation of this method, the JAX-WS
512: * runtime system takes the responsibility of selecting a protocol
513: * binding (and a port) and configuring the dispatch accordingly from
514: * the WSDL associated with this <code>Service</code> instance or
515: * from the metadata from the <code>endpointReference</code>.
516: * If this <code>Service</code> instance has a WSDL and
517: * the <code>endpointReference</code>
518: * also has a WSDL in its metadata, then the WSDL from this instance
519: * MUST be used.
520: * If this <code>Service</code> instance does not have a WSDL and
521: * the <code>endpointReference</code> does have a WSDL, then the
522: * WSDL from the <code>endpointReference</code> MAY be used.
523: * An implementation MUST be able to retrieve the <code>portName</code> from the
524: * <code>endpointReference</code> metadata.
525: * <p>
526: * This method behavies the same as calling
527: * <pre>
528: * <code>dispatch = service.createDispatch(portName, context, mode, features);</code>
529: * </pre>
530: * where the <code>portName</code> is retrieved from the
531: * WSDL or <code>endpointReference</code> metadata.
532: *
533: * @param endpointReference The <code>EndpointReference</code>
534: * for the target service endpoint that will be invoked by the
535: * returned <code>Dispatch</code> object.
536: * @param context The JAXB context used to marshall and unmarshall
537: * messages or message payloads.
538: * @param mode Controls whether the created dispatch instance is message
539: * or payload oriented, i.e. whether the user will work with complete
540: * protocol messages or message payloads. E.g. when using the SOAP
541: * protocol, this parameter controls whether the user will work with
542: * SOAP messages or the contents of a SOAP body.
543: * @param features An array of <code>WebServiceFeatures</code> to configure on the
544: * proxy. Supported features not in the <code>features
545: * </code> parameter will have their default values.
546: *
547: * @return Dispatch instance
548: * @throws WebServiceException
549: * <UL>
550: * <li>If there is any missing WSDL metadata
551: * as required by this method.
552: * <li>If the <code>endpointReference</code> metadata does
553: * not match the <code>serviceName</code> or <code>portName</code>
554: * of a WSDL associated
555: * with this <code>Service</code> instance.
556: * <li>If the <code>portName</code> cannot be determined
557: * from the <code>EndpointReference</code> metadata.
558: * <li>If any error in the creation of
559: * the <code>Dispatch</code> object.
560: * <li>if a feature is enabled that is not
561: * compatible with this port or is unsupported.
562: * </UL>
563: *
564: * @see javax.xml.bind.JAXBContext
565: * @see WebServiceFeature
566: *
567: * @since JAX-WS 2.1
568: **/
569: public Dispatch<Object> createDispatch(
570: EndpointReference endpointReference, JAXBContext context,
571: Service.Mode mode, WebServiceFeature... features) {
572: return delegate.createDispatch(endpointReference, context,
573: mode, features);
574: }
575:
576: /**
577: * Gets the name of this service.
578: * @return Qualified name of this service
579: **/
580: public QName getServiceName() {
581: return delegate.getServiceName();
582: }
583:
584: /**
585: * Returns an <code>Iterator</code> for the list of
586: * <code>QName</code>s of service endpoints grouped by this
587: * service
588: *
589: * @return Returns <code>java.util.Iterator</code> with elements
590: * of type <code>javax.xml.namespace.QName</code>.
591: * @throws WebServiceException If this Service class does not
592: * have access to the required WSDL metadata.
593: **/
594: public Iterator<javax.xml.namespace.QName> getPorts() {
595: return delegate.getPorts();
596: }
597:
598: /**
599: * Gets the location of the WSDL document for this Service.
600: *
601: * @return URL for the location of the WSDL document for
602: * this service.
603: **/
604: public java.net.URL getWSDLDocumentLocation() {
605: return delegate.getWSDLDocumentLocation();
606: }
607:
608: /**
609: * Returns the configured handler resolver.
610: *
611: * @return HandlerResolver The <code>HandlerResolver</code> being
612: * used by this <code>Service</code> instance, or <code>null</code>
613: * if there isn't one.
614: **/
615: public HandlerResolver getHandlerResolver() {
616: return delegate.getHandlerResolver();
617: }
618:
619: /**
620: * Sets the <code>HandlerResolver</code> for this <code>Service</code>
621: * instance.
622: * <p>
623: * The handler resolver, if present, will be called once for each
624: * proxy or dispatch instance that is created, and the handler chain
625: * returned by the resolver will be set on the instance.
626: *
627: * @param handlerResolver The <code>HandlerResolver</code> to use
628: * for all subsequently created proxy/dispatch objects.
629: *
630: * @see javax.xml.ws.handler.HandlerResolver
631: **/
632: public void setHandlerResolver(HandlerResolver handlerResolver) {
633: delegate.setHandlerResolver(handlerResolver);
634: }
635:
636: /**
637: * Returns the executor for this <code>Service</code>instance.
638: *
639: * The executor is used for all asynchronous invocations that
640: * require callbacks.
641: *
642: * @return The <code>java.util.concurrent.Executor</code> to be
643: * used to invoke a callback.
644: *
645: * @see java.util.concurrent.Executor
646: **/
647: public java.util.concurrent.Executor getExecutor() {
648: return delegate.getExecutor();
649: }
650:
651: /**
652: * Sets the executor for this <code>Service</code> instance.
653: *
654: * The executor is used for all asynchronous invocations that
655: * require callbacks.
656: *
657: * @param executor The <code>java.util.concurrent.Executor</code>
658: * to be used to invoke a callback.
659: *
660: * @throws SecurityException If the instance does not support
661: * setting an executor for security reasons (e.g. the
662: * necessary permissions are missing).
663: *
664: * @see java.util.concurrent.Executor
665: **/
666: public void setExecutor(java.util.concurrent.Executor executor) {
667: delegate.setExecutor(executor);
668: }
669:
670: /**
671: * Creates a <code>Service</code> instance.
672: *
673: * The specified WSDL document location and service qualified name MUST
674: * uniquely identify a <code>wsdl:service</code> element.
675: *
676: * @param wsdlDocumentLocation <code>URL</code> for the WSDL document location
677: * for the service
678: * @param serviceName <code>QName</code> for the service
679: * @throws WebServiceException If any error in creation of the
680: * specified service.
681: **/
682: public static Service create(java.net.URL wsdlDocumentLocation,
683: QName serviceName) {
684: return new Service(wsdlDocumentLocation, serviceName);
685: }
686:
687: /**
688: * Creates a <code>Service</code> instance.
689: *
690: * @param serviceName <code>QName</code> for the service
691: * @throws WebServiceException If any error in creation of the
692: * specified service
693: */
694: public static Service create(QName serviceName) {
695: return new Service(null, serviceName);
696: }
697: }
|