Class MemoizingComponentReference


  • public class MemoizingComponentReference
    extends Object
    Lazily loads the component from the ContainerManager and memoize the result. TODO add the equivalent of this to atlassian spring, to replace LazyComponentReference.
    • Constructor Detail

      • MemoizingComponentReference

        public MemoizingComponentReference()
    • Method Detail

      • containerComponent

        public static <T> Supplier<T> containerComponent​(String name)
        Static factory that takes the component name and the type.

        Note this is unsafe as it doesn't actually cast until the usage site due to erasure.

        Type Parameters:
        T - the component type
        Parameters:
        name - the name of the component
        Returns:
        the accessed component or any exception encountered when trying to retrieve it