Class WSEndpointImpl<T>
- java.lang.Object
-
- com.sun.xml.ws.api.server.WSEndpoint<T>
-
- com.sun.xml.ws.server.WSEndpointImpl<T>
-
- All Implemented Interfaces:
Component
,ComponentRegistry
,LazyMOMProvider.ScopeChangeListener
,LazyMOMProvider.WSEndpointScopeChangeListener
public class WSEndpointImpl<T> extends WSEndpoint<T> implements LazyMOMProvider.WSEndpointScopeChangeListener
WSEndpoint
implementation.- Author:
- Kohsuke Kawaguchi, Jitendra Kotamraju
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.sun.xml.ws.api.server.WSEndpoint
WSEndpoint.CompletionCallback, WSEndpoint.PipeHead
-
-
Field Summary
Fields Modifier and Type Field Description protected WSBinding
binding
protected Tube
masterTubeline
-
Constructor Summary
Constructors Modifier Constructor Description protected
WSEndpointImpl(QName serviceName, QName portName, WSBinding binding, Container container, SEIModel seiModel, WSDLPort port, Tube masterTubeline)
protected
WSEndpointImpl(QName serviceName, QName portName, WSBinding binding, Container container, SEIModel seiModel, WSDLPort port, Class<T> implementationClass, ServiceDefinitionImpl serviceDef, EndpointAwareTube terminalTube, boolean isSynchronous, PolicyMap endpointPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeManagedObjectManager()
Close the ManagedObjectManager for this endpoint.Codec
createCodec()
Gets the Endpoint's codec that is used to encode/decodeMessage
s.WSEndpoint.PipeHead
createPipeHead()
Creates a newWSEndpoint.PipeHead
to process incoming requests.protected ServerTubeAssemblerContext
createServerTubeAssemblerContext(EndpointAwareTube terminalTube, boolean isSynchronous)
Packet
createServiceResponseForException(ThrowableContainerPropertySet tc, Packet responsePacket, SOAPVersion soapVersion, WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding)
This is used by WsaServerTube and WSEndpointImpl to create a Packet with SOAPFault message from a Java exception.void
dispose()
Indicates that theWSEndpoint
is about to be turned off, and will no longer serve any packet anymore.ServerTubeAssemblerContext
getAssemblerContext()
This is only needed to expose info for monitoring.WSBinding
getBinding()
Represents the binding for which thisWSEndpoint
is created for.Set<EndpointComponent>
getComponentRegistry()
Gets the list ofEndpointComponent
that are associated with this endpoint.Set<Component>
getComponents()
Returns the set ofComponent
s registered with this objectContainer
getContainer()
Gets theContainer
object.<T extends jakarta.xml.ws.EndpointReference>
TgetEndpointReference(Class<T> clazz, String address, String wsdlAddress, List<Element> metadata, List<Element> referenceParameters)
<T extends jakarta.xml.ws.EndpointReference>
TgetEndpointReference(Class<T> clazz, String address, String wsdlAddress, Element... referenceParameters)
Return EndpointReference instance, based on passed parameters and spec version represented by clazzCollection<WSEndpointReference.EPRExtension>
getEndpointReferenceExtensions()
Engine
getEngine()
ReturnsEngine
for this endpointClass<T>
getImplementationClass()
Gets the application endpointClass
that eventually serves the request.org.glassfish.gmbal.ManagedObjectManager
getManagedObjectManager()
Get the ManagedObjectManager for this endpoint.OperationDispatcher
getOperationDispatcher()
Nullable when there is no associated WSDL ModelPolicyMap
getPolicyMap()
Gives the PolicMap that captures the Policy for the endpointWSDLPort
getPort()
Gets the port that this endpoint is serving.QName
getPortName()
Gets the application endpoint's portName.SEIModel
getSEIModel()
Gets theSEIModel
that represents the relationship between WSDL and Java SEI.ServiceDefinitionImpl
getServiceDefinition()
Gets the description of the service.QName
getServiceName()
Gets the application endpoint's serviceName.void
process(Packet request, WSEndpoint.CompletionCallback callback, FiberContextSwitchInterceptor interceptor)
void
schedule(Packet request, WSEndpoint.CompletionCallback callback, FiberContextSwitchInterceptor interceptor)
Schedule invocation of web service asynchronously.void
scopeChanged(LazyMOMProvider.Scope scope)
void
setExecutor(Executor exec)
Set thisExecutor
to run asynchronous requests using this executor.-
Methods inherited from class com.sun.xml.ws.api.server.WSEndpoint
create, create, create, create, equalsProxiedInstance, getBoundEndpoints, getDefaultPortName, getDefaultPortName, getDefaultPortName, getDefaultPortName, getDefaultServiceName, getDefaultServiceName, getDefaultServiceName, getDefaultServiceName, getSPI, schedule
-
-
-
-
Constructor Detail
-
WSEndpointImpl
protected WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding, Container container, SEIModel seiModel, WSDLPort port, Class<T> implementationClass, @Nullable ServiceDefinitionImpl serviceDef, EndpointAwareTube terminalTube, boolean isSynchronous, PolicyMap endpointPolicy)
-
-
Method Detail
-
createServerTubeAssemblerContext
protected ServerTubeAssemblerContext createServerTubeAssemblerContext(EndpointAwareTube terminalTube, boolean isSynchronous)
-
getEndpointReferenceExtensions
public Collection<WSEndpointReference.EPRExtension> getEndpointReferenceExtensions()
-
getOperationDispatcher
@Nullable public OperationDispatcher getOperationDispatcher()
Nullable when there is no associated WSDL Model- Specified by:
getOperationDispatcher
in classWSEndpoint<T>
- Returns:
-
getPolicyMap
public PolicyMap getPolicyMap()
Description copied from class:WSEndpoint
Gives the PolicMap that captures the Policy for the endpoint- Specified by:
getPolicyMap
in classWSEndpoint<T>
- Returns:
- PolicyMap
-
getImplementationClass
@NotNull public Class<T> getImplementationClass()
Description copied from class:WSEndpoint
Gets the application endpointClass
that eventually serves the request.This is the same value given to the
WSEndpoint.create(java.lang.Class<T>, boolean, com.sun.xml.ws.api.server.Invoker, javax.xml.namespace.QName, javax.xml.namespace.QName, com.sun.xml.ws.api.server.Container, com.sun.xml.ws.api.WSBinding, com.sun.xml.ws.api.server.SDDocumentSource, java.util.Collection<? extends com.sun.xml.ws.api.server.SDDocumentSource>, org.xml.sax.EntityResolver, boolean)
method.- Specified by:
getImplementationClass
in classWSEndpoint<T>
-
getBinding
@NotNull public WSBinding getBinding()
Description copied from class:WSEndpoint
Represents the binding for which thisWSEndpoint
is created for.- Specified by:
getBinding
in classWSEndpoint<T>
- Returns:
- always same object.
-
getContainer
@NotNull public Container getContainer()
Description copied from class:WSEndpoint
Gets theContainer
object.The components inside
WSEndpoint
uses this reference to communicate with the hosting environment.- Specified by:
getContainer
in classWSEndpoint<T>
- Returns:
- always same object. If no "real"
Container
instance is given,Container.NONE
will be returned.
-
getPort
public WSDLPort getPort()
Description copied from class:WSEndpoint
Gets the port that this endpoint is serving.A service is not required to have a WSDL, and when it doesn't, this method returns null. Otherwise it returns an object that describes the port that this
WSEndpoint
is serving.- Specified by:
getPort
in classWSEndpoint<T>
- Returns:
- Possibly null, but always the same value.
-
getSEIModel
@Nullable public SEIModel getSEIModel()
Description copied from class:WSEndpoint
Gets theSEIModel
that represents the relationship between WSDL and Java SEI.This method returns a non-null value if and only if this endpoint is ultimately serving an application through an SEI.
- Specified by:
getSEIModel
in classWSEndpoint<T>
- Returns:
- maybe null. See above for more discussion. Always the same value.
-
setExecutor
public void setExecutor(Executor exec)
Description copied from class:WSEndpoint
Set thisExecutor
to run asynchronous requests using this executor. This executor is set onEngine
and must be set before callingWSEndpoint.schedule(Packet,CompletionCallback)
andWSEndpoint.schedule(Packet,CompletionCallback,FiberContextSwitchInterceptor)
methods.- Specified by:
setExecutor
in classWSEndpoint<T>
- Parameters:
exec
- Executor to run async requests
-
getEngine
public Engine getEngine()
Description copied from class:WSEndpoint
ReturnsEngine
for this endpoint- Overrides:
getEngine
in classWSEndpoint<T>
- Returns:
- Engine
-
schedule
public void schedule(Packet request, WSEndpoint.CompletionCallback callback, FiberContextSwitchInterceptor interceptor)
Description copied from class:WSEndpoint
Schedule invocation of web service asynchronously.- Specified by:
schedule
in classWSEndpoint<T>
- Parameters:
request
- web service requestcallback
- callback to get response packet(exception if there is one)interceptor
- caller's interceptor to impose a context of execution- See Also:
WSEndpoint.schedule(Packet, CompletionCallback)
-
createServiceResponseForException
public Packet createServiceResponseForException(ThrowableContainerPropertySet tc, Packet responsePacket, SOAPVersion soapVersion, WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding)
Description copied from class:WSEndpoint
This is used by WsaServerTube and WSEndpointImpl to create a Packet with SOAPFault message from a Java exception.- Specified by:
createServiceResponseForException
in classWSEndpoint<T>
-
process
public void process(Packet request, WSEndpoint.CompletionCallback callback, FiberContextSwitchInterceptor interceptor)
- Overrides:
process
in classWSEndpoint<T>
-
createPipeHead
@NotNull public WSEndpoint.PipeHead createPipeHead()
Description copied from class:WSEndpoint
Creates a newWSEndpoint.PipeHead
to process incoming requests.This is not a cheap operation. The caller is expected to reuse the returned
WSEndpoint.PipeHead
. Seeclass javadoc
for details.- Specified by:
createPipeHead
in classWSEndpoint<T>
- Returns:
- A newly created
WSEndpoint.PipeHead
that's ready to serve.
-
dispose
public void dispose()
Description copied from class:WSEndpoint
Indicates that theWSEndpoint
is about to be turned off, and will no longer serve any packet anymore.This method needs to be invoked for the JAX-WS RI to correctly implement some of the spec semantics (TODO: pointer.) It's the responsibility of the code that hosts a
WSEndpoint
to invoke this method.Once this method is called, the behavior is undefed for all in-progress
WSEndpoint.PipeHead.process(com.sun.xml.ws.api.message.Packet, com.sun.xml.ws.api.server.WebServiceContextDelegate, com.sun.xml.ws.api.server.TransportBackChannel)
methods (by other threads) and futureWSEndpoint.PipeHead.process(com.sun.xml.ws.api.message.Packet, com.sun.xml.ws.api.server.WebServiceContextDelegate, com.sun.xml.ws.api.server.TransportBackChannel)
method invocations.- Specified by:
dispose
in classWSEndpoint<T>
-
getServiceDefinition
public ServiceDefinitionImpl getServiceDefinition()
Description copied from class:WSEndpoint
Gets the description of the service.A description is a set of WSDL/schema and other documents that together describes a service. A service is not required to have a description, and when it doesn't, this method returns null.
- Specified by:
getServiceDefinition
in classWSEndpoint<T>
- Returns:
- Possibly null, always the same value under ordinary circumstances but may change if the endpoint is managed.
-
getComponentRegistry
public Set<EndpointComponent> getComponentRegistry()
Description copied from class:WSEndpoint
Gets the list ofEndpointComponent
that are associated with this endpoint.Components (such as codec, tube, handler, etc) who wish to provide some service to other components in the endpoint can iterate the registry and call its
EndpointComponent.getSPI(Class)
to establish a private contract between components.Components who wish to subscribe to such a service can add itself to this set.
- Specified by:
getComponentRegistry
in classWSEndpoint<T>
- Returns:
- always return the same set.
-
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
- Overrides:
getComponents
in classWSEndpoint<T>
- Returns:
- set of registered components
-
getEndpointReference
public <T extends jakarta.xml.ws.EndpointReference> T getEndpointReference(Class<T> clazz, String address, String wsdlAddress, Element... referenceParameters)
Description copied from class:WSEndpoint
Return EndpointReference instance, based on passed parameters and spec version represented by clazz- Specified by:
getEndpointReference
in classWSEndpoint<T>
- Parameters:
clazz
- represents spec versionaddress
- endpoint addresswsdlAddress
- wsdl addressreferenceParameters
- any reference parameters to be added to the instance- Returns:
- EndpointReference instance based on passed parameters and values obtained from current instance
-
getEndpointReference
public <T extends jakarta.xml.ws.EndpointReference> T getEndpointReference(Class<T> clazz, String address, String wsdlAddress, List<Element> metadata, List<Element> referenceParameters)
- Specified by:
getEndpointReference
in classWSEndpoint<T>
- Returns:
- EndpointReference instance based on passed parameters and values obtained from current instance
-
getPortName
@NotNull public QName getPortName()
Description copied from class:WSEndpoint
Gets the application endpoint's portName. It could be got from DD or annotations- Specified by:
getPortName
in classWSEndpoint<T>
- Returns:
- same as wsdl:port QName if WSDL exists or generated
-
createCodec
@NotNull public Codec createCodec()
Description copied from class:WSEndpoint
Gets the Endpoint's codec that is used to encode/decodeMessage
s. This is a copy of the master codec and it shouldn't be shared across two requests running concurrently(unless it is stateless).- Specified by:
createCodec
in classWSEndpoint<T>
- Returns:
- codec to encode/decode
-
getServiceName
@NotNull public QName getServiceName()
Description copied from class:WSEndpoint
Gets the application endpoint's serviceName. It could be got from DD or annotations- Specified by:
getServiceName
in classWSEndpoint<T>
- Returns:
- same as wsdl:service QName if WSDL exists or generated
-
getManagedObjectManager
@NotNull public org.glassfish.gmbal.ManagedObjectManager getManagedObjectManager()
Description copied from class:WSEndpoint
Get the ManagedObjectManager for this endpoint.- Specified by:
getManagedObjectManager
in classWSEndpoint<T>
-
scopeChanged
public void scopeChanged(LazyMOMProvider.Scope scope)
- Specified by:
scopeChanged
in interfaceLazyMOMProvider.ScopeChangeListener
-
closeManagedObjectManager
public void closeManagedObjectManager()
Description copied from class:WSEndpoint
Close the ManagedObjectManager for this endpoint. This is used by the Web Service Configuration Management system so that it closes the MOM before it creates a new WSEndpoint. Then it calls dispose on the existing endpoint and then installs the new endpoint. The call to dispose also calls closeManagedObjectManager, but is a noop if that method has already been called.- Specified by:
closeManagedObjectManager
in classWSEndpoint<T>
-
getAssemblerContext
@NotNull public ServerTubeAssemblerContext getAssemblerContext()
Description copied from class:WSEndpoint
This is only needed to expose info for monitoring.- Specified by:
getAssemblerContext
in classWSEndpoint<T>
-
-