Interface WeldInstance.Handler<T>

  • Type Parameters:
    T - the required bean type
    All Superinterfaces:
    AutoCloseable
    Enclosing interface:
    WeldInstance<T>

    public static interface WeldInstance.Handler<T>
    extends AutoCloseable
    This interface represents a contextual reference handler.

    Allows to inspect the metadata of the relevant bean and also to destroy the underlying contextual instance.

    Author:
    Martin Kouba
    • Method Detail

      • getBean

        Bean<?> getBean()
        Returns:
        the bean metadata
      • destroy

        void destroy()
        Destroy the contextual instance. It's a no-op if:
        • called multiple times
        • if the producing WeldInstance does not exist
        • if the handler does not hold a contextual reference, i.e. get() was never called
        See Also:
        Instance.destroy(Object)