Interface CreationalContext<T>
-
public interface CreationalContext<T>
The
CreationalContext
holds incomplete Bean instances and references to allDependent
scoped contextual instances injected into aNormalScope
d bean.E.g. consider we create a Contextual Instance of a
SessionScoped
UserInformation
bean which has a dependent injection point (e.g. a fieldprivate @Inject Helper helper;
) In that case the CreationalContext of theUserInformation
instance will contain the information about thehelper
instance. This is needed to properly destroy thehelper
once theUserInformation
gets destroyed. In our example this will happen at the end of the Session.Attention: If you create a
Dependent
instance manually usingBeanManager.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 viaContextual.destroy(Object, CreationalContext)
. This is not needed forNormalScope
d 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.
-
-