Interface CreationalContext.Reference<T>

  • Type Parameters:
    T - the type of instance this reference holds
    Enclosing interface:
    CreationalContext<T>

    public static interface CreationalContext.Reference<T>
    A reference to an instance created by the CreationalContext with which the created instance can be released.
    • Method Detail

      • get

        T get()
        Gets the instance held by this reference. If the reference has already been released this will throw IllegalStateException.
        Returns:
        the instance held by this reference, can be null
        Throws:
        java.lang.IllegalStateException - when the reference was released
      • release

        void release()
        Releases this reference. Any dependent objects associated with it will be destroyed. This method is idempotent.