Class AbstractLazyInitializer<T>

  • Direct Known Subclasses:
    LazySpannerInitializer

    public abstract class AbstractLazyInitializer<T>
    extends Object
    Generic AbstractLazyInitializer for any heavy-weight object that might throw an exception during initialization. The underlying object is initialized at most once.
    • Constructor Detail

      • AbstractLazyInitializer

        public AbstractLazyInitializer()
    • Method Detail

      • get

        public T get()
              throws Exception
        Returns an initialized instance of T.
        Throws:
        Exception
      • initialize

        protected abstract T initialize()
                                 throws Exception
        Initializes the actual object that should be returned. Is called once the first time an instance of T is required.
        Throws:
        Exception