Class InstanceSupplierFactoryBridge<T>

Type Parameters:
T - type which could be handled by Supplier and this bridge.
All Implemented Interfaces:

public class InstanceSupplierFactoryBridge<T> extends Object implements Factory<T>
This class is used as a bridge between HK2 Factory and JDK Supplier. Using this class Supplier is able to behave as a factory in service locator. The bridge just delegates all invocations to provided ServiceLocator and therefore all operation should be in proper scope and context.

This bridge is dedicated to instance binding therefore underlying supplier is always only single instance.

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