Class SupplierFactoryBridge<T>

java.lang.Object
org.glassfish.jersey.inject.hk2.SupplierFactoryBridge<T>
Type Parameters:
T - type which could be handled by Supplier and this bridge.
All Implemented Interfaces:
Factory<T>

public class SupplierFactoryBridge<T> extends Object implements Factory<T>
This class is able to find the Supplier of the particular type and use this Supplier to create a new instance. If the Supplier is not found then null is returned. If the found Supplier is a type of DisposableSupplier then this bridge can delegate Factory.dispose(Object) invocation to DisposableSupplier.dispose(Object).

It's recommended to register the instance of this class as a singleton and then the provide() is called according to a provided scope (for the created instance) during the binding process.

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