public final class SingletonResolver<T> extends AbstractInstanceResolver<T>
InstanceResolver
that always returns a single instance.Constructor and Description |
---|
SingletonResolver(T singleton) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Called by
WSEndpoint
when WSEndpoint.dispose() is called. |
T |
resolve(com.sun.xml.ws.api.message.Packet request)
Decides which instance of 'T' serves the given request message.
|
void |
start(WSWebServiceContext wsc,
WSEndpoint endpoint)
Called by
WSEndpoint when it's set up. |
findAnnotatedMethod, getResourceInjector, invokeMethod
createDefault, createDefault, createFromInstanceResolverAnnotation, createInvoker, createNewInstance, createSingleton, postInvoke, start
public SingletonResolver(@NotNull T singleton)
@NotNull public T resolve(com.sun.xml.ws.api.message.Packet request)
InstanceResolver
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.
resolve
in class InstanceResolver<T>
request
- Always non-null. Represents the request message to be served.
The caller may not consume the Message
.public void start(WSWebServiceContext wsc, WSEndpoint endpoint)
InstanceResolver
WSEndpoint
when it's set up.
This is an opportunity for InstanceResolver
to do a endpoint-specific initialization process.
start
in class InstanceResolver<T>
wsc
- The WebServiceContext
instance to be injected
to the user instances (assuming InstanceResolver
public void dispose()
InstanceResolver
WSEndpoint
when WSEndpoint.dispose()
is called.
This allows InstanceResolver
to do final clean up.
This method is guaranteed to be only called once by WSEndpoint
.
dispose
in class InstanceResolver<T>
Copyright © 2015 Oracle Corporation. All rights reserved.