Class WSService
- All Implemented Interfaces:
Component,ComponentRegistry
- Direct Known Subclasses:
WSServiceDelegate
ServiceDelegate.
This abstract class is used only to improve the static type safety of the JAX-WS internal API.
The class name intentionally doesn't include "Delegate",
because the fact that it's a delegate is a detail of
the JSR-224 API, and for the layers above us this object
nevertheless represents Service. We want them
to think of this as an internal representation of a service.
Only JAX-WS internal code may downcast this to WSServiceDelegate.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTyped parameter bag used bycreate(URL, QName, InitParams) -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final WSService.InitParamsUsed as a immutable constant so that we can avoid null check.protected static final ThreadLocal<WSService.InitParams>To create aService, we need to go through the API that doesn't let us pass parameters, so as a hack we use thread local. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WSServicecreate()Creates a service with a dummy service name.static WSServiceCreate aServiceinstance.static javax.xml.ws.Servicecreate(URL wsdlDocumentLocation, QName serviceName, WSService.InitParams properties) Creates aServiceinstance.static WSServiceCreate aServiceinstance.abstract <T> javax.xml.ws.Dispatch<T>createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, javax.xml.ws.Service.Mode mode, javax.xml.ws.WebServiceFeature... features) Works likeServiceDelegate.createDispatch(javax.xml.ws.EndpointReference, java.lang.Class, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])but it takes the port name separately, so that EPR without embedded metadata can be used.abstract javax.xml.ws.Dispatch<Object>createDispatch(QName portName, WSEndpointReference wsepr, javax.xml.bind.JAXBContext jaxbContext, javax.xml.ws.Service.Mode mode, javax.xml.ws.WebServiceFeature... features) Works likeServiceDelegate.createDispatch(javax.xml.ws.EndpointReference, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])but it takes the port name separately, so that EPR without embedded metadata can be used.Returns the set ofComponents registered with this objectabstract ContainerGets theContainerobject.abstract <T> TgetPort(WSEndpointReference epr, Class<T> portInterface, javax.xml.ws.WebServiceFeature... features) Works likeServiceDelegate.getPort(EndpointReference, Class, WebServiceFeature...)but takesWSEndpointReference.<S> SGets the specified SPI.static WSServiceunwrap(javax.xml.ws.Service svc) Obtains theWSServicethat's encapsulated inside aService.Methods inherited from class javax.xml.ws.spi.ServiceDelegate
addPort, createDispatch, createDispatch, createDispatch, createDispatch, createDispatch, createDispatch, getExecutor, getHandlerResolver, getPort, getPort, getPort, getPort, getPort, getPorts, getServiceName, getWSDLDocumentLocation, setExecutor, setHandlerResolver
-
Field Details
-
INIT_PARAMS
To create aService, we need to go through the API that doesn't let us pass parameters, so as a hack we use thread local. -
EMPTY_PARAMS
Used as a immutable constant so that we can avoid null check.
-
-
Constructor Details
-
WSService
protected WSService()
-
-
Method Details
-
getPort
public abstract <T> T getPort(WSEndpointReference epr, Class<T> portInterface, javax.xml.ws.WebServiceFeature... features) Works likeServiceDelegate.getPort(EndpointReference, Class, WebServiceFeature...)but takesWSEndpointReference. -
createDispatch
public abstract <T> javax.xml.ws.Dispatch<T> createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, javax.xml.ws.Service.Mode mode, javax.xml.ws.WebServiceFeature... features) Works likeServiceDelegate.createDispatch(javax.xml.ws.EndpointReference, java.lang.Class, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])but it takes the port name separately, so that EPR without embedded metadata can be used. -
createDispatch
public abstract javax.xml.ws.Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, javax.xml.bind.JAXBContext jaxbContext, javax.xml.ws.Service.Mode mode, javax.xml.ws.WebServiceFeature... features) Works likeServiceDelegate.createDispatch(javax.xml.ws.EndpointReference, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])but it takes the port name separately, so that EPR without embedded metadata can be used. -
getContainer
Gets theContainerobject.The components inside
WSEndpointuses this reference to communicate with the hosting environment.- Returns:
- always same object. If no "real"
Containerinstance is given,Container.NONEwill be returned.
-
getSPI
Description copied from interface:ComponentGets the specified SPI.This method works as a kind of directory service for SPIs, allowing various components to define private contract and talk to each other.
-
getComponents
Description copied from interface:ComponentRegistryReturns the set ofComponents registered with this object- Specified by:
getComponentsin interfaceComponentRegistry- Returns:
- set of registered components
-
create
Create aServiceinstance. The specified WSDL document location and service qualified name MUST uniquely identify awsdl:serviceelement.- Parameters:
wsdlDocumentLocation- URL for the WSDL document location for the serviceserviceName- QName for the service- Throws:
javax.xml.ws.WebServiceException- If any error in creation of the specified service.
-
create
Create aServiceinstance.- Parameters:
serviceName- QName for the service- Throws:
javax.xml.ws.WebServiceException- If any error in creation of the specified service
-
create
Creates a service with a dummy service name. -
create
public static javax.xml.ws.Service create(URL wsdlDocumentLocation, QName serviceName, WSService.InitParams properties) Creates aServiceinstance.This method works really like
Service.create(URL, QName)except it takes one more RI specific parameter.- Parameters:
wsdlDocumentLocation-URLfor the WSDL document location for the service. Can be null, in which case WSDL is not loaded.serviceName-QNamefor the service.properties- Additional RI specific initialization parameters. Can be null.- Throws:
javax.xml.ws.WebServiceException- If any error in creation of the specified service.
-
unwrap
Obtains theWSServicethat's encapsulated inside aService.- Throws:
IllegalArgumentException- if the given service object is not from the JAX-WS RI.
-