Interface ContextualLifecycle<T>

  • Type Parameters:
    T - the class of the bean instance
    All Known Implementing Classes:
    DelegatingContextualLifecycle

    public interface ContextualLifecycle<T>
    Callbacks used by BeanBuilder and ImmutableBean to allow control of the creation and destruction of a custom bean.
    Author:
    Stuart Douglas
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      T create​(javax.enterprise.inject.spi.Bean<T> bean, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
      Callback invoked by a created bean when Contextual.create(CreationalContext) is called.
      default void destroy​(javax.enterprise.inject.spi.Bean<T> bean, T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
      Callback invoked by a created bean when Contextual.destroy(Object, CreationalContext) is called.
    • Method Detail

      • create

        T create​(javax.enterprise.inject.spi.Bean<T> bean,
                 javax.enterprise.context.spi.CreationalContext<T> creationalContext)
        Callback invoked by a created bean when Contextual.create(CreationalContext) is called.
        Parameters:
        bean - the bean initiating the callback
        creationalContext - the context in which this instance was created
      • destroy

        default void destroy​(javax.enterprise.inject.spi.Bean<T> bean,
                             T instance,
                             javax.enterprise.context.spi.CreationalContext<T> creationalContext)
        Callback invoked by a created bean when Contextual.destroy(Object, CreationalContext) is called.
        Parameters:
        bean - the bean initiating the callback
        instance - the contextual instance to destroy
        creationalContext - the context in which this instance was created