Interface CreationalContext<T>
-
public interface CreationalContext<T>The
CreationalContextholds incomplete Bean instances and references to allDependentscoped contextual instances injected into aNormalScoped bean.E.g. consider we create a Contextual Instance of a
SessionScopedUserInformationbean which has a dependent injection point (e.g. a fieldprivate @Inject Helper helper;) In that case the CreationalContext of theUserInformationinstance will contain the information about thehelperinstance. This is needed to properly destroy thehelperonce theUserInformationgets destroyed. In our example this will happen at the end of the Session.Attention: If you create a
Dependentinstance 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 forNormalScoped 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 voidpush(T incompleteInstance)Puts new incomplete instance into the creational context.voidrelease()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.
-
-