Package com.sun.xml.ws.server
Class SingletonResolver<T>
java.lang.Object
com.sun.xml.ws.api.server.InstanceResolver<T>
com.sun.xml.ws.api.server.AbstractInstanceResolver<T>
com.sun.xml.ws.server.SingletonResolver<T>
InstanceResolver
that always returns a single instance.- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Called byWSEndpoint
whenWSEndpoint.dispose()
is called.Decides which instance of 'T' serves the given request message.void
start
(WSWebServiceContext wsc, WSEndpoint endpoint) Called byWSEndpoint
when it's set up.Methods inherited from class com.sun.xml.ws.api.server.AbstractInstanceResolver
findAnnotatedMethod, getResourceInjector, invokeMethod
Methods inherited from class com.sun.xml.ws.api.server.InstanceResolver
createDefault, createDefault, createFromInstanceResolverAnnotation, createInvoker, createNewInstance, createSingleton, postInvoke, start
-
Constructor Details
-
SingletonResolver
-
-
Method Details
-
resolve
Description copied from class:InstanceResolver
Decides which instance of 'T' serves the given request message.This method is called concurrently by multiple threads. It is also on a criticail path that affects the performance. A good implementation should try to avoid any synchronization, and should minimize the amount of work as much as possible.
- Specified by:
resolve
in classInstanceResolver<T>
- Parameters:
request
- Always non-null. Represents the request message to be served. The caller may not consume theMessage
.
-
start
Description copied from class:InstanceResolver
Called byWSEndpoint
when it's set up.This is an opportunity for
InstanceResolver
to do a endpoint-specific initialization process.- Overrides:
start
in classInstanceResolver<T>
- Parameters:
wsc
- TheWebServiceContext
instance to be injected to the user instances (assumingInstanceResolver
-
dispose
public void dispose()Description copied from class:InstanceResolver
Called byWSEndpoint
whenWSEndpoint.dispose()
is called. This allowsInstanceResolver
to do final clean up.This method is guaranteed to be only called once by
WSEndpoint
.- Overrides:
dispose
in classInstanceResolver<T>
-