Class SingletonResolver<T>


public final class SingletonResolver<T> extends AbstractInstanceResolver<T>
InstanceResolver that always returns a single instance.
Author:
Kohsuke Kawaguchi
  • Constructor Details

    • SingletonResolver

      public SingletonResolver(@NotNull T singleton)
  • Method Details

    • 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>