/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.xml.ws;
import javax.xml.namespace.QName;
import java.util.Iterator;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.bind.JAXBContext;
import javax.xml.ws.spi.ServiceDelegate;
import javax.xml.ws.spi.Provider;
/**
* <code>Service</code> objects provide the client view of a Web service.
* <p><code>Service</code> acts as a factory of the following:
* <ul>
* <li>Proxies for a target service endpoint.
* <li>Instances of {@link javax.xml.ws.Dispatch} for
* dynamic message-oriented invocation of a remote
* operation.
* </li>
*
* <p>The ports available on a service can be enumerated using the
* <code>getPorts</code> method. Alternatively, you can pass a
* service endpoint interface to the unary <code>getPort</code> method
* and let the runtime select a compatible port.
*
* <p>Handler chains for all the objects created by a <code>Service</code>
* can be set by means of a <code>HandlerResolver</code>.
*
* <p>An <code>Executor</code> may be set on the service in order
* to gain better control over the threads used to dispatch asynchronous
* callbacks. For instance, thread pooling with certain parameters
* can be enabled by creating a <code>ThreadPoolExecutor</code> and
* registering it with the service.
*
* @since JAX-WS 2.0
*
* @see javax.xml.ws.spi.Provider
* @see javax.xml.ws.handler.HandlerResolver
* @see java.util.concurrent.Executor
**/
public class Service {
private ServiceDelegate delegate;
/**
* The orientation of a dynamic client or service. <code>MESSAGE</code> provides
* access to entire protocol message, <code>PAYLOAD</code> to protocol message
* payload only.
**/
public enum Mode { MESSAGE, PAYLOAD };
protected Service(java.net.URL wsdlDocumentLocation, QName serviceName) {
delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
serviceName,
this.getClass());
}
/**
* The <code>getPort</code> method returns a proxy. A service client
* uses this proxy to invoke operations on the target
* service endpoint. The <code>serviceEndpointInterface</code>
* specifies the service endpoint interface that is supported by
* the created dynamic proxy instance.
*
* @param portName Qualified name of the service endpoint in
* the WSDL service description.
* @param serviceEndpointInterface Service endpoint interface
* supported by the dynamic proxy instance.
* @return Object Proxy instance that
* supports the specified service endpoint
* interface.
* @throws WebServiceException This exception is thrown in the
* following cases:
* <UL>
* <LI>If there is an error in creation of
* the proxy.
* <LI>If there is any missing WSDL metadata
* as required by this method.
* <LI>If an illegal
* <code>serviceEndpointInterface</code>
* or <code>portName</code> is specified.
* </UL>
* @see java.lang.reflect.Proxy
* @see java.lang.reflect.InvocationHandler
**/
public <T> T getPort(QName portName,
Class<T> serviceEndpointInterface) {
return delegate.getPort(portName, serviceEndpointInterface);
}
/**
* The <code>getPort</code> method returns a proxy. A service client
* uses this proxy to invoke operations on the target
* service endpoint. The <code>serviceEndpointInterface</code>
* specifies the service endpoint interface that is supported by
* the created dynamic proxy instance.
*
* @param portName Qualified name of the service endpoint in
* the WSDL service description.
* @param serviceEndpointInterface Service endpoint interface
* supported by the dynamic proxy instance.
* @param features A list of WebServiceFeatures to configure on the
* proxy. Supported features not in the <code>features
* </code> parameter will have their default values.
* @return Object Proxy instance that
* supports the specified service endpoint
* interface.
* @throws WebServiceException This exception is thrown in the
* following cases:
* <UL>
* <LI>If there is an error in creation of
* the proxy.
* <LI>If there is any missing WSDL metadata
* as required by this method.
* <LI>If an illegal
* <code>serviceEndpointInterface</code>
* or <code>portName</code> is specified.
* <LI>If a feature is enabled that is not compatible
* with this port or is unsupported.
* </UL>
* @see java.lang.reflect.Proxy
* @see java.lang.reflect.InvocationHandler
* @see WebServiceFeature
*
* @since JAX-WS 2.1
**/
public <T> T getPort(QName portName,
Class<T> serviceEndpointInterface, WebServiceFeature... features) {
return delegate.getPort(portName, serviceEndpointInterface, features);
}
/**
* The <code>getPort</code> method returns a proxy. The parameter
* <code>serviceEndpointInterface</code> specifies the service
* endpoint interface that is supported by the returned proxy.
* In the implementation of this method, the JAX-WS
* runtime system takes the responsibility of selecting a protocol
* binding (and a port) and configuring the proxy accordingly.
* The returned proxy should not be reconfigured by the client.
*
* @param serviceEndpointInterface Service endpoint interface.
* @return Object instance that supports the
* specified service endpoint interface.
* @throws WebServiceException
* <UL>
* <LI>If there is an error during creation
* of the proxy.
* <LI>If there is any missing WSDL metadata
* as required by this method.
* <LI>If an illegal.
* <code>serviceEndpointInterface</code>
* is specified.
* </UL>
**/
public <T> T getPort(Class<T> serviceEndpointInterface) {
return delegate.getPort(serviceEndpointInterface);
}
/**
* The <code>getPort</code> method returns a proxy. The parameter
* <code>serviceEndpointInterface</code> specifies the service
* endpoint interface that is supported by the returned proxy.
* In the implementation of this method, the JAX-WS
* runtime system takes the responsibility of selecting a protocol
* binding (and a port) and configuring the proxy accordingly.
* The returned proxy should not be reconfigured by the client.
*
* @param serviceEndpointInterface Service endpoint interface.
* @param features A list of WebServiceFeatures to configure on the
* proxy. Supported features not in the <code>features
* </code> parameter will have their default values.
* @return Object instance that supports the
* specified service endpoint interface.
* @throws WebServiceException
* <UL>
* <LI>If there is an error during creation
*
xylqh.rar_书籍源码
版权申诉
97 浏览量
2022-09-23
18:37:14
上传
评论
收藏 31KB RAR 举报
寒泊
- 粉丝: 75
- 资源: 1万+
最新资源
- Pytorch-pytorch深度学习教程之Tensorboard.zip
- 基于C++和Python开发yolov8-face作为人脸检测器dlib作为人脸识别器的人脸考勤系统源码+项目说明.zip
- Pytorch-pytorch深度学习教程之变分自动编码器.zip
- Pytorch-pytorch深度学习教程之神经风格迁移.zip
- Pytorch-pytorch深度学习教程之深度残差网络.zip
- Pytorch-pytorch深度学习教程之循环神经网络.zip
- Pytorch-pytorch深度学习教程之逻辑回归.zip
- Pytorch-pytorch深度学习教程之双向循环网络.zip
- Pytorch-pytorch深度学习教程之卷积神经网络.zip
- Pytorch-pytorch深度学习教程之前馈神经网络.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈