Class LazyGuiceFactory<T>

  • Type Parameters:
    T - injection type
    All Implemented Interfaces:
    java.util.function.Supplier<T>

    public class LazyGuiceFactory<T>
    extends java.lang.Object
    implements java.util.function.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 Summary

      Constructors 
      Constructor Description
      LazyGuiceFactory​(com.google.inject.Injector injector, java.lang.Class<java.util.function.Supplier<T>> type)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LazyGuiceFactory

        public LazyGuiceFactory​(com.google.inject.Injector injector,
                                java.lang.Class<java.util.function.Supplier<T>> type)
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface java.util.function.Supplier<T>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object