jaxws/src/share/classes/javax/xml/ws/Service.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 8 474761f14bca
child 2678 57cf2a1c1a05
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
474761f14bca Initial load
duke
parents:
diff changeset
     1
/*
474761f14bca Initial load
duke
parents:
diff changeset
     2
 * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
474761f14bca Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
474761f14bca Initial load
duke
parents:
diff changeset
     4
 *
474761f14bca Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
474761f14bca Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
474761f14bca Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
474761f14bca Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
474761f14bca Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
474761f14bca Initial load
duke
parents:
diff changeset
    10
 *
474761f14bca Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
474761f14bca Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
474761f14bca Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
474761f14bca Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
474761f14bca Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
474761f14bca Initial load
duke
parents:
diff changeset
    16
 *
474761f14bca Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
474761f14bca Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
474761f14bca Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
474761f14bca Initial load
duke
parents:
diff changeset
    20
 *
474761f14bca Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
474761f14bca Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
474761f14bca Initial load
duke
parents:
diff changeset
    23
 * have any questions.
474761f14bca Initial load
duke
parents:
diff changeset
    24
 */
474761f14bca Initial load
duke
parents:
diff changeset
    25
474761f14bca Initial load
duke
parents:
diff changeset
    26
package javax.xml.ws;
474761f14bca Initial load
duke
parents:
diff changeset
    27
474761f14bca Initial load
duke
parents:
diff changeset
    28
import javax.xml.namespace.QName;
474761f14bca Initial load
duke
parents:
diff changeset
    29
import java.util.Iterator;
474761f14bca Initial load
duke
parents:
diff changeset
    30
import javax.xml.ws.handler.HandlerResolver;
474761f14bca Initial load
duke
parents:
diff changeset
    31
import javax.xml.bind.JAXBContext;
474761f14bca Initial load
duke
parents:
diff changeset
    32
import javax.xml.ws.spi.ServiceDelegate;
474761f14bca Initial load
duke
parents:
diff changeset
    33
import javax.xml.ws.spi.Provider;
474761f14bca Initial load
duke
parents:
diff changeset
    34
474761f14bca Initial load
duke
parents:
diff changeset
    35
/**
474761f14bca Initial load
duke
parents:
diff changeset
    36
 *  <code>Service</code> objects provide the client view of a Web service.
474761f14bca Initial load
duke
parents:
diff changeset
    37
 *  <p><code>Service</code> acts as a factory of the following:
474761f14bca Initial load
duke
parents:
diff changeset
    38
 *  <ul>
474761f14bca Initial load
duke
parents:
diff changeset
    39
 *  <li>Proxies for a target service endpoint.
474761f14bca Initial load
duke
parents:
diff changeset
    40
 *  <li>Instances of <code>javax.xml.ws.Dispatch</code> for
474761f14bca Initial load
duke
parents:
diff changeset
    41
 *      dynamic message-oriented invocation of a remote
474761f14bca Initial load
duke
parents:
diff changeset
    42
 *      operation.
474761f14bca Initial load
duke
parents:
diff changeset
    43
 *  </li>
474761f14bca Initial load
duke
parents:
diff changeset
    44
 *
474761f14bca Initial load
duke
parents:
diff changeset
    45
 * <p>The ports available on a service can be enumerated using the
474761f14bca Initial load
duke
parents:
diff changeset
    46
 * <code>getPorts</code> method. Alternatively, you can pass a
474761f14bca Initial load
duke
parents:
diff changeset
    47
 * service endpoint interface to the unary <code>getPort</code> method
474761f14bca Initial load
duke
parents:
diff changeset
    48
 * and let the runtime select a compatible port.
474761f14bca Initial load
duke
parents:
diff changeset
    49
 *
474761f14bca Initial load
duke
parents:
diff changeset
    50
 * <p>Handler chains for all the objects created by a <code>Service</code>
474761f14bca Initial load
duke
parents:
diff changeset
    51
 * can be set by means of a <code>HandlerResolver</code>.
474761f14bca Initial load
duke
parents:
diff changeset
    52
 *
474761f14bca Initial load
duke
parents:
diff changeset
    53
 * <p>An <code>Executor</code> may be set on the service in order
474761f14bca Initial load
duke
parents:
diff changeset
    54
 * to gain better control over the threads used to dispatch asynchronous
474761f14bca Initial load
duke
parents:
diff changeset
    55
 * callbacks. For instance, thread pooling with certain parameters
474761f14bca Initial load
duke
parents:
diff changeset
    56
 * can be enabled by creating a <code>ThreadPoolExecutor</code> and
474761f14bca Initial load
duke
parents:
diff changeset
    57
 * registering it with the service.
474761f14bca Initial load
duke
parents:
diff changeset
    58
 *
474761f14bca Initial load
duke
parents:
diff changeset
    59
 *  @since JAX-WS 2.0
474761f14bca Initial load
duke
parents:
diff changeset
    60
 *
474761f14bca Initial load
duke
parents:
diff changeset
    61
 *  @see javax.xml.ws.spi.Provider
474761f14bca Initial load
duke
parents:
diff changeset
    62
 *  @see javax.xml.ws.handler.HandlerResolver
474761f14bca Initial load
duke
parents:
diff changeset
    63
 *  @see java.util.concurrent.Executor
474761f14bca Initial load
duke
parents:
diff changeset
    64
**/
474761f14bca Initial load
duke
parents:
diff changeset
    65
public class Service {
474761f14bca Initial load
duke
parents:
diff changeset
    66
474761f14bca Initial load
duke
parents:
diff changeset
    67
  private ServiceDelegate delegate;
474761f14bca Initial load
duke
parents:
diff changeset
    68
  /**
474761f14bca Initial load
duke
parents:
diff changeset
    69
   * The orientation of a dynamic client or service. MESSAGE provides
474761f14bca Initial load
duke
parents:
diff changeset
    70
   * access to entire protocol message, PAYLOAD to protocol message
474761f14bca Initial load
duke
parents:
diff changeset
    71
   * payload only.
474761f14bca Initial load
duke
parents:
diff changeset
    72
  **/
474761f14bca Initial load
duke
parents:
diff changeset
    73
  public enum Mode { MESSAGE, PAYLOAD };
474761f14bca Initial load
duke
parents:
diff changeset
    74
474761f14bca Initial load
duke
parents:
diff changeset
    75
  protected Service(java.net.URL wsdlDocumentLocation, QName serviceName)
474761f14bca Initial load
duke
parents:
diff changeset
    76
  {
474761f14bca Initial load
duke
parents:
diff changeset
    77
      delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
474761f14bca Initial load
duke
parents:
diff changeset
    78
                                                           serviceName,
474761f14bca Initial load
duke
parents:
diff changeset
    79
                                                           this.getClass());
474761f14bca Initial load
duke
parents:
diff changeset
    80
  }
474761f14bca Initial load
duke
parents:
diff changeset
    81
474761f14bca Initial load
duke
parents:
diff changeset
    82
474761f14bca Initial load
duke
parents:
diff changeset
    83
  /** The getPort method returns a stub. A service client
474761f14bca Initial load
duke
parents:
diff changeset
    84
   *  uses this stub to invoke operations on the target
474761f14bca Initial load
duke
parents:
diff changeset
    85
   *  service endpoint. The <code>serviceEndpointInterface</code>
474761f14bca Initial load
duke
parents:
diff changeset
    86
   *  specifies the service endpoint interface that is supported by
474761f14bca Initial load
duke
parents:
diff changeset
    87
   *  the created dynamic proxy or stub instance.
474761f14bca Initial load
duke
parents:
diff changeset
    88
   *
474761f14bca Initial load
duke
parents:
diff changeset
    89
   *  @param portName  Qualified name of the service endpoint in
474761f14bca Initial load
duke
parents:
diff changeset
    90
   *                   the WSDL service description
474761f14bca Initial load
duke
parents:
diff changeset
    91
   *  @param serviceEndpointInterface Service endpoint interface
474761f14bca Initial load
duke
parents:
diff changeset
    92
   *                   supported by the dynamic proxy or stub
474761f14bca Initial load
duke
parents:
diff changeset
    93
   *                   instance
474761f14bca Initial load
duke
parents:
diff changeset
    94
   *  @return Object Proxy instance that
474761f14bca Initial load
duke
parents:
diff changeset
    95
   *                 supports the specified service endpoint
474761f14bca Initial load
duke
parents:
diff changeset
    96
   *                 interface
474761f14bca Initial load
duke
parents:
diff changeset
    97
   *  @throws WebServiceException This exception is thrown in the
474761f14bca Initial load
duke
parents:
diff changeset
    98
   *                   following cases:
474761f14bca Initial load
duke
parents:
diff changeset
    99
   *                   <UL>
474761f14bca Initial load
duke
parents:
diff changeset
   100
   *                   <LI>If there is an error in creation of
474761f14bca Initial load
duke
parents:
diff changeset
   101
   *                       the proxy
474761f14bca Initial load
duke
parents:
diff changeset
   102
   *                   <LI>If there is any missing WSDL metadata
474761f14bca Initial load
duke
parents:
diff changeset
   103
   *                       as required by this method
474761f14bca Initial load
duke
parents:
diff changeset
   104
   *                   <LI>Optionally, if an illegal
474761f14bca Initial load
duke
parents:
diff changeset
   105
   *                       <code>serviceEndpointInterface</code>
474761f14bca Initial load
duke
parents:
diff changeset
   106
   *                       or <code>portName</code> is specified
474761f14bca Initial load
duke
parents:
diff changeset
   107
   *                   </UL>
474761f14bca Initial load
duke
parents:
diff changeset
   108
   *  @see java.lang.reflect.Proxy
474761f14bca Initial load
duke
parents:
diff changeset
   109
   *  @see java.lang.reflect.InvocationHandler
474761f14bca Initial load
duke
parents:
diff changeset
   110
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   111
  public <T> T getPort(QName portName,
474761f14bca Initial load
duke
parents:
diff changeset
   112
                                 Class<T> serviceEndpointInterface)
474761f14bca Initial load
duke
parents:
diff changeset
   113
  {
474761f14bca Initial load
duke
parents:
diff changeset
   114
      return delegate.getPort(portName, serviceEndpointInterface);
474761f14bca Initial load
duke
parents:
diff changeset
   115
  }
474761f14bca Initial load
duke
parents:
diff changeset
   116
474761f14bca Initial load
duke
parents:
diff changeset
   117
  /** The getPort method returns a stub. The parameter
474761f14bca Initial load
duke
parents:
diff changeset
   118
   *  <code>serviceEndpointInterface</code> specifies the service
474761f14bca Initial load
duke
parents:
diff changeset
   119
   *  endpoint interface that is supported by the returned proxy.
474761f14bca Initial load
duke
parents:
diff changeset
   120
   *  In the implementation of this method, the JAX-WS
474761f14bca Initial load
duke
parents:
diff changeset
   121
   *  runtime system takes the responsibility of selecting a protocol
474761f14bca Initial load
duke
parents:
diff changeset
   122
   *  binding (and a port) and configuring the proxy accordingly.
474761f14bca Initial load
duke
parents:
diff changeset
   123
   *  The returned proxy should not be reconfigured by the client.
474761f14bca Initial load
duke
parents:
diff changeset
   124
   *
474761f14bca Initial load
duke
parents:
diff changeset
   125
   *  @param serviceEndpointInterface Service endpoint interface
474761f14bca Initial load
duke
parents:
diff changeset
   126
   *  @return Object instance that supports the
474761f14bca Initial load
duke
parents:
diff changeset
   127
   *                   specified service endpoint interface
474761f14bca Initial load
duke
parents:
diff changeset
   128
   *  @throws WebServiceException
474761f14bca Initial load
duke
parents:
diff changeset
   129
   *                   <UL>
474761f14bca Initial load
duke
parents:
diff changeset
   130
   *                   <LI>If there is an error during creation
474761f14bca Initial load
duke
parents:
diff changeset
   131
   *                       of the proxy
474761f14bca Initial load
duke
parents:
diff changeset
   132
   *                   <LI>If there is any missing WSDL metadata
474761f14bca Initial load
duke
parents:
diff changeset
   133
   *                       as required by this method
474761f14bca Initial load
duke
parents:
diff changeset
   134
   *                   <LI>Optionally, if an illegal
474761f14bca Initial load
duke
parents:
diff changeset
   135
   *                       <code>serviceEndpointInterface</code>
474761f14bca Initial load
duke
parents:
diff changeset
   136
   *                       is specified
474761f14bca Initial load
duke
parents:
diff changeset
   137
   *                   </UL>
474761f14bca Initial load
duke
parents:
diff changeset
   138
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   139
  public <T> T getPort(Class<T> serviceEndpointInterface) {
474761f14bca Initial load
duke
parents:
diff changeset
   140
      return delegate.getPort(serviceEndpointInterface);
474761f14bca Initial load
duke
parents:
diff changeset
   141
  }
474761f14bca Initial load
duke
parents:
diff changeset
   142
474761f14bca Initial load
duke
parents:
diff changeset
   143
  /** Creates a new port for the service. Ports created in this way contain
474761f14bca Initial load
duke
parents:
diff changeset
   144
   *  no WSDL port type information and can only be used for creating
474761f14bca Initial load
duke
parents:
diff changeset
   145
   *  <code>Dispatch</code>instances.
474761f14bca Initial load
duke
parents:
diff changeset
   146
   *
474761f14bca Initial load
duke
parents:
diff changeset
   147
   *  @param portName  Qualified name for the target service endpoint
474761f14bca Initial load
duke
parents:
diff changeset
   148
   *  @param bindingId A String identifier of a binding.
474761f14bca Initial load
duke
parents:
diff changeset
   149
   *  @param endpointAddress Address of the target service endpoint as a URI
474761f14bca Initial load
duke
parents:
diff changeset
   150
   *  @throws WebServiceException If any error in the creation of
474761f14bca Initial load
duke
parents:
diff changeset
   151
   *  the port
474761f14bca Initial load
duke
parents:
diff changeset
   152
   *
474761f14bca Initial load
duke
parents:
diff changeset
   153
   *  @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
474761f14bca Initial load
duke
parents:
diff changeset
   154
   *  @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
474761f14bca Initial load
duke
parents:
diff changeset
   155
   *  @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
474761f14bca Initial load
duke
parents:
diff changeset
   156
   **/
474761f14bca Initial load
duke
parents:
diff changeset
   157
  public void addPort(QName portName, String bindingId, String endpointAddress)
474761f14bca Initial load
duke
parents:
diff changeset
   158
  {
474761f14bca Initial load
duke
parents:
diff changeset
   159
      delegate.addPort(portName, bindingId, endpointAddress);
474761f14bca Initial load
duke
parents:
diff changeset
   160
  }
474761f14bca Initial load
duke
parents:
diff changeset
   161
474761f14bca Initial load
duke
parents:
diff changeset
   162
  /** Creates a <code>Dispatch</code> instance for use with objects of
474761f14bca Initial load
duke
parents:
diff changeset
   163
   *  the users choosing.
474761f14bca Initial load
duke
parents:
diff changeset
   164
   *
474761f14bca Initial load
duke
parents:
diff changeset
   165
   *  @param portName  Qualified name for the target service endpoint
474761f14bca Initial load
duke
parents:
diff changeset
   166
   *  @param type The class of object used to messages or message
474761f14bca Initial load
duke
parents:
diff changeset
   167
   *  payloads. Implementations are required to support
474761f14bca Initial load
duke
parents:
diff changeset
   168
   *  <code>javax.xml.transform.Source</code>, <code>javax.xml.soap.SOAPMessage</code>
474761f14bca Initial load
duke
parents:
diff changeset
   169
   *  and <code>javax.activation.DataSource</code>, depending on
474761f14bca Initial load
duke
parents:
diff changeset
   170
   *  the binding in use.
474761f14bca Initial load
duke
parents:
diff changeset
   171
   *  @param mode Controls whether the created dispatch instance is message
474761f14bca Initial load
duke
parents:
diff changeset
   172
   *  or payload oriented, i.e. whether the user will work with complete
474761f14bca Initial load
duke
parents:
diff changeset
   173
   *  protocol messages or message payloads. E.g. when using the SOAP
474761f14bca Initial load
duke
parents:
diff changeset
   174
   *  protocol, this parameter controls whether the user will work with
474761f14bca Initial load
duke
parents:
diff changeset
   175
   *  SOAP messages or the contents of a SOAP body. Mode must be MESSAGE
474761f14bca Initial load
duke
parents:
diff changeset
   176
   *  when type is SOAPMessage.
474761f14bca Initial load
duke
parents:
diff changeset
   177
   *
474761f14bca Initial load
duke
parents:
diff changeset
   178
   *  @return Dispatch instance
474761f14bca Initial load
duke
parents:
diff changeset
   179
   *  @throws WebServiceException If any error in the creation of
474761f14bca Initial load
duke
parents:
diff changeset
   180
   *                   the <code>Dispatch</code> object
474761f14bca Initial load
duke
parents:
diff changeset
   181
   *  @see javax.xml.transform.Source
474761f14bca Initial load
duke
parents:
diff changeset
   182
   *  @see javax.xml.soap.SOAPMessage
474761f14bca Initial load
duke
parents:
diff changeset
   183
   **/
474761f14bca Initial load
duke
parents:
diff changeset
   184
  public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode)
474761f14bca Initial load
duke
parents:
diff changeset
   185
  {
474761f14bca Initial load
duke
parents:
diff changeset
   186
      return delegate.createDispatch(portName, type, mode);
474761f14bca Initial load
duke
parents:
diff changeset
   187
  }
474761f14bca Initial load
duke
parents:
diff changeset
   188
474761f14bca Initial load
duke
parents:
diff changeset
   189
  /** Creates a <code>Dispatch</code> instance for use with JAXB
474761f14bca Initial load
duke
parents:
diff changeset
   190
   *  generated objects.
474761f14bca Initial load
duke
parents:
diff changeset
   191
   *
474761f14bca Initial load
duke
parents:
diff changeset
   192
   *  @param portName  Qualified name for the target service endpoint
474761f14bca Initial load
duke
parents:
diff changeset
   193
   *  @param context The JAXB context used to marshall and unmarshall
474761f14bca Initial load
duke
parents:
diff changeset
   194
   *  messages or message payloads.
474761f14bca Initial load
duke
parents:
diff changeset
   195
   *  @param mode Controls whether the created dispatch instance is message
474761f14bca Initial load
duke
parents:
diff changeset
   196
   *  or payload oriented, i.e. whether the user will work with complete
474761f14bca Initial load
duke
parents:
diff changeset
   197
   *  protocol messages or message payloads. E.g. when using the SOAP
474761f14bca Initial load
duke
parents:
diff changeset
   198
   *  protocol, this parameter controls whether the user will work with
474761f14bca Initial load
duke
parents:
diff changeset
   199
   *  SOAP messages or the contents of a SOAP body.
474761f14bca Initial load
duke
parents:
diff changeset
   200
   *
474761f14bca Initial load
duke
parents:
diff changeset
   201
   *  @return Dispatch instance
474761f14bca Initial load
duke
parents:
diff changeset
   202
   *  @throws ServiceException If any error in the creation of
474761f14bca Initial load
duke
parents:
diff changeset
   203
   *                   the <code>Dispatch</code> object
474761f14bca Initial load
duke
parents:
diff changeset
   204
   *
474761f14bca Initial load
duke
parents:
diff changeset
   205
   *  @see javax.xml.bind.JAXBContext
474761f14bca Initial load
duke
parents:
diff changeset
   206
   **/
474761f14bca Initial load
duke
parents:
diff changeset
   207
  public Dispatch<Object> createDispatch(QName portName, JAXBContext context,
474761f14bca Initial load
duke
parents:
diff changeset
   208
      Mode mode)
474761f14bca Initial load
duke
parents:
diff changeset
   209
  {
474761f14bca Initial load
duke
parents:
diff changeset
   210
      return delegate.createDispatch(portName, context,  mode);
474761f14bca Initial load
duke
parents:
diff changeset
   211
  }
474761f14bca Initial load
duke
parents:
diff changeset
   212
474761f14bca Initial load
duke
parents:
diff changeset
   213
474761f14bca Initial load
duke
parents:
diff changeset
   214
474761f14bca Initial load
duke
parents:
diff changeset
   215
  /** Gets the name of this service.
474761f14bca Initial load
duke
parents:
diff changeset
   216
   *  @return Qualified name of this service
474761f14bca Initial load
duke
parents:
diff changeset
   217
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   218
  public QName getServiceName() {
474761f14bca Initial load
duke
parents:
diff changeset
   219
      return delegate.getServiceName();
474761f14bca Initial load
duke
parents:
diff changeset
   220
  }
474761f14bca Initial load
duke
parents:
diff changeset
   221
474761f14bca Initial load
duke
parents:
diff changeset
   222
  /** Returns an <code>Iterator</code> for the list of
474761f14bca Initial load
duke
parents:
diff changeset
   223
   *  <code>QName</code>s of service endpoints grouped by this
474761f14bca Initial load
duke
parents:
diff changeset
   224
   *  service
474761f14bca Initial load
duke
parents:
diff changeset
   225
   *
474761f14bca Initial load
duke
parents:
diff changeset
   226
   *  @return Returns <code>java.util.Iterator</code> with elements
474761f14bca Initial load
duke
parents:
diff changeset
   227
   *          of type <code>javax.xml.namespace.QName</code>
474761f14bca Initial load
duke
parents:
diff changeset
   228
   *  @throws WebServiceException If this Service class does not
474761f14bca Initial load
duke
parents:
diff changeset
   229
   *          have access to the required WSDL metadata
474761f14bca Initial load
duke
parents:
diff changeset
   230
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   231
  public Iterator<javax.xml.namespace.QName> getPorts() {
474761f14bca Initial load
duke
parents:
diff changeset
   232
      return delegate.getPorts();
474761f14bca Initial load
duke
parents:
diff changeset
   233
  }
474761f14bca Initial load
duke
parents:
diff changeset
   234
474761f14bca Initial load
duke
parents:
diff changeset
   235
  /** Gets the location of the WSDL document for this Service.
474761f14bca Initial load
duke
parents:
diff changeset
   236
   *
474761f14bca Initial load
duke
parents:
diff changeset
   237
   *  @return URL for the location of the WSDL document for
474761f14bca Initial load
duke
parents:
diff changeset
   238
   *          this service
474761f14bca Initial load
duke
parents:
diff changeset
   239
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   240
  public java.net.URL getWSDLDocumentLocation() {
474761f14bca Initial load
duke
parents:
diff changeset
   241
      return delegate.getWSDLDocumentLocation();
474761f14bca Initial load
duke
parents:
diff changeset
   242
  }
474761f14bca Initial load
duke
parents:
diff changeset
   243
474761f14bca Initial load
duke
parents:
diff changeset
   244
  /**
474761f14bca Initial load
duke
parents:
diff changeset
   245
   * Returns the configured handler resolver.
474761f14bca Initial load
duke
parents:
diff changeset
   246
   *
474761f14bca Initial load
duke
parents:
diff changeset
   247
   *  @return HandlerResolver The <code>HandlerResolver</code> being
474761f14bca Initial load
duke
parents:
diff changeset
   248
   *          used by this <code>Service</code> instance, or <code>null</code>
474761f14bca Initial load
duke
parents:
diff changeset
   249
   *          if there isn't one.
474761f14bca Initial load
duke
parents:
diff changeset
   250
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   251
    public HandlerResolver getHandlerResolver() {
474761f14bca Initial load
duke
parents:
diff changeset
   252
        return delegate.getHandlerResolver();
474761f14bca Initial load
duke
parents:
diff changeset
   253
    }
474761f14bca Initial load
duke
parents:
diff changeset
   254
474761f14bca Initial load
duke
parents:
diff changeset
   255
  /**
474761f14bca Initial load
duke
parents:
diff changeset
   256
   *  Sets the <code>HandlerResolver</code> for this <code>Service</code>
474761f14bca Initial load
duke
parents:
diff changeset
   257
   *  instance.
474761f14bca Initial load
duke
parents:
diff changeset
   258
   *  <p>
474761f14bca Initial load
duke
parents:
diff changeset
   259
   *  The handler resolver, if present, will be called once for each
474761f14bca Initial load
duke
parents:
diff changeset
   260
   *  proxy or dispatch instance that is created, and the handler chain
474761f14bca Initial load
duke
parents:
diff changeset
   261
   *  returned by the resolver will be set on the instance.
474761f14bca Initial load
duke
parents:
diff changeset
   262
   *
474761f14bca Initial load
duke
parents:
diff changeset
   263
   *  @param handlerResolver The <code>HandlerResolver</code> to use
474761f14bca Initial load
duke
parents:
diff changeset
   264
   *         for all subsequently created proxy/dispatch objects.
474761f14bca Initial load
duke
parents:
diff changeset
   265
   *
474761f14bca Initial load
duke
parents:
diff changeset
   266
   *  @see javax.xml.ws.handler.HandlerResolver
474761f14bca Initial load
duke
parents:
diff changeset
   267
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   268
   public void setHandlerResolver(HandlerResolver handlerResolver) {
474761f14bca Initial load
duke
parents:
diff changeset
   269
       delegate.setHandlerResolver(handlerResolver);
474761f14bca Initial load
duke
parents:
diff changeset
   270
   }
474761f14bca Initial load
duke
parents:
diff changeset
   271
474761f14bca Initial load
duke
parents:
diff changeset
   272
  /**
474761f14bca Initial load
duke
parents:
diff changeset
   273
   * Returns the executor for this <code>Service</code>instance.
474761f14bca Initial load
duke
parents:
diff changeset
   274
   *
474761f14bca Initial load
duke
parents:
diff changeset
   275
   * The executor is used for all asynchronous invocations that
474761f14bca Initial load
duke
parents:
diff changeset
   276
   * require callbacks.
474761f14bca Initial load
duke
parents:
diff changeset
   277
   *
474761f14bca Initial load
duke
parents:
diff changeset
   278
   * @return The <code>java.util.concurrent.Executor</code> to be
474761f14bca Initial load
duke
parents:
diff changeset
   279
   *         used to invoke a callback.
474761f14bca Initial load
duke
parents:
diff changeset
   280
   *
474761f14bca Initial load
duke
parents:
diff changeset
   281
   * @see java.util.concurrent.Executor
474761f14bca Initial load
duke
parents:
diff changeset
   282
   **/
474761f14bca Initial load
duke
parents:
diff changeset
   283
   public java.util.concurrent.Executor getExecutor() {
474761f14bca Initial load
duke
parents:
diff changeset
   284
       return delegate.getExecutor();
474761f14bca Initial load
duke
parents:
diff changeset
   285
   }
474761f14bca Initial load
duke
parents:
diff changeset
   286
474761f14bca Initial load
duke
parents:
diff changeset
   287
  /**
474761f14bca Initial load
duke
parents:
diff changeset
   288
   * Sets the executor for this <code>Service</code> instance.
474761f14bca Initial load
duke
parents:
diff changeset
   289
   *
474761f14bca Initial load
duke
parents:
diff changeset
   290
   * The executor is used for all asynchronous invocations that
474761f14bca Initial load
duke
parents:
diff changeset
   291
   * require callbacks.
474761f14bca Initial load
duke
parents:
diff changeset
   292
   *
474761f14bca Initial load
duke
parents:
diff changeset
   293
   * @param executor The <code>java.util.concurrent.Executor</code>
474761f14bca Initial load
duke
parents:
diff changeset
   294
   *        to be used to invoke a callback.
474761f14bca Initial load
duke
parents:
diff changeset
   295
   *
474761f14bca Initial load
duke
parents:
diff changeset
   296
   * @throws SecurityException If the instance does not support
474761f14bca Initial load
duke
parents:
diff changeset
   297
   *         setting an executor for security reasons (e.g. the
474761f14bca Initial load
duke
parents:
diff changeset
   298
   *         necessary permissions are missing).
474761f14bca Initial load
duke
parents:
diff changeset
   299
   *
474761f14bca Initial load
duke
parents:
diff changeset
   300
   * @see java.util.concurrent.Executor
474761f14bca Initial load
duke
parents:
diff changeset
   301
   **/
474761f14bca Initial load
duke
parents:
diff changeset
   302
   public void setExecutor(java.util.concurrent.Executor executor) {
474761f14bca Initial load
duke
parents:
diff changeset
   303
       delegate.setExecutor(executor);
474761f14bca Initial load
duke
parents:
diff changeset
   304
   }
474761f14bca Initial load
duke
parents:
diff changeset
   305
474761f14bca Initial load
duke
parents:
diff changeset
   306
  /**
474761f14bca Initial load
duke
parents:
diff changeset
   307
   *  Create a <code>Service</code> instance.
474761f14bca Initial load
duke
parents:
diff changeset
   308
   *
474761f14bca Initial load
duke
parents:
diff changeset
   309
   *  The specified WSDL document location and service qualified name must
474761f14bca Initial load
duke
parents:
diff changeset
   310
   *  uniquely identify a <code>wsdl:service</code> element.
474761f14bca Initial load
duke
parents:
diff changeset
   311
   *
474761f14bca Initial load
duke
parents:
diff changeset
   312
   *  @param wsdlDocumentLocation URL for the WSDL document location
474761f14bca Initial load
duke
parents:
diff changeset
   313
   *                              for the service
474761f14bca Initial load
duke
parents:
diff changeset
   314
   *  @param serviceName QName for the service
474761f14bca Initial load
duke
parents:
diff changeset
   315
   *  @throws WebServiceException If any error in creation of the
474761f14bca Initial load
duke
parents:
diff changeset
   316
   *                     specified service
474761f14bca Initial load
duke
parents:
diff changeset
   317
  **/
474761f14bca Initial load
duke
parents:
diff changeset
   318
  public static Service create(
474761f14bca Initial load
duke
parents:
diff changeset
   319
                            java.net.URL wsdlDocumentLocation,
474761f14bca Initial load
duke
parents:
diff changeset
   320
                            QName serviceName)
474761f14bca Initial load
duke
parents:
diff changeset
   321
  {
474761f14bca Initial load
duke
parents:
diff changeset
   322
      return new Service(wsdlDocumentLocation, serviceName);
474761f14bca Initial load
duke
parents:
diff changeset
   323
  }
474761f14bca Initial load
duke
parents:
diff changeset
   324
474761f14bca Initial load
duke
parents:
diff changeset
   325
  /**
474761f14bca Initial load
duke
parents:
diff changeset
   326
   *  Create a <code>Service</code> instance.
474761f14bca Initial load
duke
parents:
diff changeset
   327
   *
474761f14bca Initial load
duke
parents:
diff changeset
   328
   *  @param serviceName QName for the service
474761f14bca Initial load
duke
parents:
diff changeset
   329
   *  @throws WebServiceException If any error in creation of the
474761f14bca Initial load
duke
parents:
diff changeset
   330
   *                     specified service
474761f14bca Initial load
duke
parents:
diff changeset
   331
   */
474761f14bca Initial load
duke
parents:
diff changeset
   332
  public static Service create(QName serviceName) {
474761f14bca Initial load
duke
parents:
diff changeset
   333
      return new Service(null, serviceName);
474761f14bca Initial load
duke
parents:
diff changeset
   334
  }
474761f14bca Initial load
duke
parents:
diff changeset
   335
}