Class Hk2ReferencingFactory<T>

java.lang.Object
org.glassfish.jersey.inject.hk2.Hk2ReferencingFactory<T>
Type Parameters:
T -
All Implemented Interfaces:
Factory<T>

public abstract class Hk2ReferencingFactory<T> extends Object implements Factory<T>
Factory that provides injection of the referenced instance.
Author:
Marek Potociar
  • Constructor Summary

    Constructors
    Constructor
    Description
    Hk2ReferencingFactory(jakarta.inject.Provider<org.glassfish.jersey.internal.util.collection.Ref<T>> referenceFactory)
    Create new referencing injection factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dispose(T instance)
     
     
    static <T> Factory<org.glassfish.jersey.internal.util.collection.Ref<T>>
    Get a reference factory providing an empty reference.
    static <T> Factory<org.glassfish.jersey.internal.util.collection.Ref<T>>
    referenceFactory(T initialValue)
    Get a reference factory providing an initialized reference.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Hk2ReferencingFactory

      public Hk2ReferencingFactory(jakarta.inject.Provider<org.glassfish.jersey.internal.util.collection.Ref<T>> referenceFactory)
      Create new referencing injection factory.
      Parameters:
      referenceFactory - reference provider backing the factory.
  • Method Details

    • provide

      public T provide()
      Specified by:
      provide in interface Factory<T>
    • dispose

      public void dispose(T instance)
      Specified by:
      dispose in interface Factory<T>
    • referenceFactory

      public static <T> Factory<org.glassfish.jersey.internal.util.collection.Ref<T>> referenceFactory()
      Get a reference factory providing an empty reference.
      Type Parameters:
      T - reference type.
      Returns:
      reference factory providing an empty reference.
    • referenceFactory

      public static <T> Factory<org.glassfish.jersey.internal.util.collection.Ref<T>> referenceFactory(T initialValue)
      Get a reference factory providing an initialized reference.
      Type Parameters:
      T - reference type.
      Parameters:
      initialValue - initial value stored in the reference provided by the returned factory.
      Returns:
      reference factory providing a reference initialized with an initialValue.