Class ServiceHandleImpl<T>

java.lang.Object
org.jvnet.hk2.internal.ServiceHandleImpl<T>
Type Parameters:
T - The type of service to create
All Implemented Interfaces:
Closeable, AutoCloseable, org.glassfish.hk2.api.ServiceHandle<T>

public class ServiceHandleImpl<T> extends Object implements org.glassfish.hk2.api.ServiceHandle<T>
This handle does the underlying work of getting the service. Only at the time that the getService call is made is the service gotten from the context. Once a service has been gotten, it is not looked up again.
Author:
jwells
  • Method Details

    • getService

      public T getService()
      Specified by:
      getService in interface org.glassfish.hk2.api.ServiceHandle<T>
    • getActiveDescriptor

      public org.glassfish.hk2.api.ActiveDescriptor<T> getActiveDescriptor()
      Specified by:
      getActiveDescriptor in interface org.glassfish.hk2.api.ServiceHandle<T>
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface org.glassfish.hk2.api.ServiceHandle<T>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.glassfish.hk2.api.ServiceHandle<T>
    • setServiceData

      public void setServiceData(Object serviceData)
      Specified by:
      setServiceData in interface org.glassfish.hk2.api.ServiceHandle<T>
    • getServiceData

      public Object getServiceData()
      Specified by:
      getServiceData in interface org.glassfish.hk2.api.ServiceHandle<T>
    • getSubHandles

      public List<org.glassfish.hk2.api.ServiceHandle<?>> getSubHandles()
      Specified by:
      getSubHandles in interface org.glassfish.hk2.api.ServiceHandle<T>
    • pushInjectee

      public void pushInjectee(org.glassfish.hk2.api.Injectee push)
    • popInjectee

      public void popInjectee()
    • addSubHandle

      public void addSubHandle(ServiceHandleImpl<?> subHandle)
      Add a sub handle to this for proper destruction
      Parameters:
      subHandle - A handle to add for proper destruction
    • getOriginalRequest

      public org.glassfish.hk2.api.Injectee getOriginalRequest()
    • toString

      public String toString()
      Overrides:
      toString in class Object