Class LazyGuiceFactory<T>

java.lang.Object
ru.vyarus.dropwizard.guice.module.jersey.support.LazyGuiceFactory<T>
Type Parameters:
T - injection type
All Implemented Interfaces:
Supplier<T>

public class LazyGuiceFactory<T> extends Object implements Supplier<T>
Transitive factory helps "bridge" lazily real factories. For example, if HK2 context is just starting and referenced guice bean depends on some HK2 bean, we can't instantiate guice bean. This moves guice bean creation into HK2 init phase (when HK2 pre-init some factories) or even further (first usage).
  • Constructor Details

    • LazyGuiceFactory

      public LazyGuiceFactory(com.google.inject.Injector injector, Class<Supplier<T>> type)
      Create factory.
      Parameters:
      injector - injector
      type - original factory
  • Method Details