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(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, invokeMethodcreateDefault, createDefault, createFromInstanceResolverAnnotation, createInvoker, createNewInstance, createSingleton, postInvoke, startpublic SingletonResolver(@NotNull
T singleton)
@NotNull public T resolve(Packet request)
InstanceResolverThis 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)
InstanceResolverWSEndpoint 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 InstanceResolverpublic void dispose()
InstanceResolverWSEndpoint
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 (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.