Interface CreationalContext<T>


  • public interface CreationalContext<T>

    The CreationalContext holds incomplete Bean instances and references to allDependent scoped contextual instances injected into a NormalScoped bean.

    E.g. consider we create a Contextual Instance of a SessionScoped UserInformation bean which has a dependent injection point (e.g. a field private @Inject Helper helper; ) In that case the CreationalContext of the UserInformation instance will contain the information about the helper instance. This is needed to properly destroy the helper once the UserInformation gets destroyed. In our example this will happen at the end of the Session.

    Attention: If you create a Dependent instance manually using BeanManager.getReference(javax.enterprise.inject.spi.Bean, java.lang.reflect.Type, CreationalContext) then you must store away the CreationalContext. You will need it for properly destroying the created instance via Contextual.destroy(Object, CreationalContext). This is not needed for NormalScoped beans as they maintain their lifecycle themself!

    Version:
    $Rev: 1427694 $ $Date: 2013-01-02 09:09:27 +0100 (Wed, 02 Jan 2013) $
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void push​(T incompleteInstance)
      Puts new incomplete instance into the creational context.
      void release()
      Destorys all dependent objects of the instance that is being destroyed.
    • Method Detail

      • push

        void push​(T incompleteInstance)
        Puts new incomplete instance into the creational context.
        Parameters:
        incompleteInstance - incomplete webbeans instance
      • release

        void release()
        Destorys all dependent objects of the instance that is being destroyed.