com.sun.xml.ws.server
Class SingletonResolver<T>

java.lang.Object
  extended by com.sun.xml.ws.api.server.InstanceResolver<T>
      extended by com.sun.xml.ws.server.AbstractInstanceResolver<T>
          extended by com.sun.xml.ws.server.SingletonResolver<T>

public final class SingletonResolver<T>
extends AbstractInstanceResolver<T>

InstanceResolver that always returns a single instance.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.xml.ws.server.AbstractInstanceResolver
AbstractInstanceResolver.FieldInjectionPlan<T,R>, AbstractInstanceResolver.InjectionPlan<T,R>, AbstractInstanceResolver.MethodInjectionPlan<T,R>
 
Constructor Summary
SingletonResolver(T singleton)
           
 
Method Summary
 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.
 
Methods inherited from class com.sun.xml.ws.server.AbstractInstanceResolver
buildInjectionPlan, findAnnotatedMethod, getResourceInjector, invokeMethod
 
Methods inherited from class com.sun.xml.ws.api.server.InstanceResolver
createDefault, createDefault, createInvoker, createNewInstance, createSingleton, postInvoke, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonResolver

public SingletonResolver(@NotNull
                         T singleton)
Method Detail

resolve

@NotNull
public T resolve(Packet request)
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 class InstanceResolver<T>
Parameters:
request - Always non-null. Represents the request message to be served. The caller may not consume the Message.

start

public void start(WSWebServiceContext wsc,
                  WSEndpoint endpoint)
Description copied from class: InstanceResolver
Called by WSEndpoint when it's set up.

This is an opportunity for InstanceResolver to do a endpoint-specific initialization process.

Overrides:
start in class InstanceResolver<T>
Parameters:
wsc - The WebServiceContext instance to be injected to the user instances (assuming InstanceResolver

dispose

public void dispose()
Description copied from class: InstanceResolver
Called by 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.

Overrides:
dispose in class InstanceResolver<T>