Class WSService
- java.lang.Object
-
- jakarta.xml.ws.spi.ServiceDelegate
-
- com.sun.xml.ws.api.WSService
-
- All Implemented Interfaces:
Component
,ComponentRegistry
- Direct Known Subclasses:
WSServiceDelegate
public abstract class WSService extends jakarta.xml.ws.spi.ServiceDelegate implements ComponentRegistry
JAX-WS implementation ofServiceDelegate
.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 Classes Modifier and Type Class Description static class
WSService.InitParams
Typed parameter bag used bycreate(URL, QName, InitParams)
-
Field Summary
Fields Modifier and Type Field Description protected static WSService.InitParams
EMPTY_PARAMS
Used as a immutable constant so that we can avoid null check.protected static ThreadLocal<WSService.InitParams>
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.
-
Constructor Summary
Constructors Modifier Constructor Description protected
WSService()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static WSService
create()
Creates a service with a dummy service name.static WSService
create(URL wsdlDocumentLocation, QName serviceName)
Create aService
instance.static jakarta.xml.ws.Service
create(URL wsdlDocumentLocation, QName serviceName, WSService.InitParams properties)
Creates aService
instance.static WSService
create(QName serviceName)
Create aService
instance.abstract jakarta.xml.ws.Dispatch<Object>
createDispatch(QName portName, WSEndpointReference wsepr, jakarta.xml.bind.JAXBContext jaxbContext, jakarta.xml.ws.Service.Mode mode, jakarta.xml.ws.WebServiceFeature... features)
Works likeServiceDelegate.createDispatch(jakarta.xml.ws.EndpointReference, jakarta.xml.bind.JAXBContext, jakarta.xml.ws.Service.Mode, jakarta.xml.ws.WebServiceFeature[])
but it takes the port name separately, so that EPR without embedded metadata can be used.abstract <T> jakarta.xml.ws.Dispatch<T>
createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, jakarta.xml.ws.Service.Mode mode, jakarta.xml.ws.WebServiceFeature... features)
Works likeServiceDelegate.createDispatch(jakarta.xml.ws.EndpointReference, java.lang.Class, jakarta.xml.ws.Service.Mode, jakarta.xml.ws.WebServiceFeature[])
but it takes the port name separately, so that EPR without embedded metadata can be used.Set<Component>
getComponents()
Returns the set ofComponent
s registered with this objectabstract Container
getContainer()
Gets theContainer
object.abstract <T> T
getPort(WSEndpointReference epr, Class<T> portInterface, jakarta.xml.ws.WebServiceFeature... features)
Works likeServiceDelegate.getPort(EndpointReference, Class, WebServiceFeature...)
but takesWSEndpointReference
.<S> S
getSPI(Class<S> spiType)
Gets the specified SPI.static WSService
unwrap(jakarta.xml.ws.Service svc)
Obtains theWSService
that's encapsulated inside aService
.-
Methods inherited from class jakarta.xml.ws.spi.ServiceDelegate
addPort, createDispatch, createDispatch, createDispatch, createDispatch, createDispatch, createDispatch, getExecutor, getHandlerResolver, getPort, getPort, getPort, getPort, getPort, getPorts, getServiceName, getWSDLDocumentLocation, setExecutor, setHandlerResolver
-
-
-
-
Field Detail
-
INIT_PARAMS
protected static final ThreadLocal<WSService.InitParams> 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
protected static final WSService.InitParams EMPTY_PARAMS
Used as a immutable constant so that we can avoid null check.
-
-
Method Detail
-
getPort
public abstract <T> T getPort(WSEndpointReference epr, Class<T> portInterface, jakarta.xml.ws.WebServiceFeature... features)
Works likeServiceDelegate.getPort(EndpointReference, Class, WebServiceFeature...)
but takesWSEndpointReference
.
-
createDispatch
public abstract <T> jakarta.xml.ws.Dispatch<T> createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, jakarta.xml.ws.Service.Mode mode, jakarta.xml.ws.WebServiceFeature... features)
Works likeServiceDelegate.createDispatch(jakarta.xml.ws.EndpointReference, java.lang.Class, jakarta.xml.ws.Service.Mode, jakarta.xml.ws.WebServiceFeature[])
but it takes the port name separately, so that EPR without embedded metadata can be used.
-
createDispatch
public abstract jakarta.xml.ws.Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, jakarta.xml.bind.JAXBContext jaxbContext, jakarta.xml.ws.Service.Mode mode, jakarta.xml.ws.WebServiceFeature... features)
Works likeServiceDelegate.createDispatch(jakarta.xml.ws.EndpointReference, jakarta.xml.bind.JAXBContext, jakarta.xml.ws.Service.Mode, jakarta.xml.ws.WebServiceFeature[])
but it takes the port name separately, so that EPR without embedded metadata can be used.
-
getContainer
@NotNull public abstract Container getContainer()
Gets theContainer
object.The components inside
WSEndpoint
uses this reference to communicate with the hosting environment.- Returns:
- always same object. If no "real"
Container
instance is given,Container.NONE
will be returned.
-
getSPI
@Nullable public <S> S getSPI(@NotNull Class<S> spiType)
Description copied from interface:Component
Gets 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
@NotNull public Set<Component> getComponents()
Description copied from interface:ComponentRegistry
Returns the set ofComponent
s registered with this object- Specified by:
getComponents
in interfaceComponentRegistry
- Returns:
- set of registered components
-
create
public static WSService create(URL wsdlDocumentLocation, QName serviceName)
Create aService
instance. The specified WSDL document location and service qualified name MUST uniquely identify awsdl:service
element.- Parameters:
wsdlDocumentLocation
- URL for the WSDL document location for the serviceserviceName
- QName for the service- Throws:
jakarta.xml.ws.WebServiceException
- If any error in creation of the specified service.
-
create
public static WSService create(QName serviceName)
Create aService
instance.- Parameters:
serviceName
- QName for the service- Throws:
jakarta.xml.ws.WebServiceException
- If any error in creation of the specified service
-
create
public static WSService create()
Creates a service with a dummy service name.
-
create
public static jakarta.xml.ws.Service create(URL wsdlDocumentLocation, QName serviceName, WSService.InitParams properties)
Creates aService
instance.This method works really like
Service.create(URL, QName)
except it takes one more RI specific parameter.- Parameters:
wsdlDocumentLocation
-URL
for the WSDL document location for the service. Can be null, in which case WSDL is not loaded.serviceName
-QName
for the service.properties
- Additional RI specific initialization parameters. Can be null.- Throws:
jakarta.xml.ws.WebServiceException
- If any error in creation of the specified service.
-
unwrap
public static WSService unwrap(jakarta.xml.ws.Service svc)
Obtains theWSService
that's encapsulated inside aService
.- Throws:
IllegalArgumentException
- if the given service object is not from the JAX-WS RI.
-
-