Package org.apache.myfaces.cdi.util
Class AbstractContext
- java.lang.Object
- 
- org.apache.myfaces.cdi.util.AbstractContext
 
- 
- All Implemented Interfaces:
- jakarta.enterprise.context.spi.Context
 
 public abstract class AbstractContext extends Object implements jakarta.enterprise.context.spi.Context A skeleton containing the most important parts of a custom CDI Context. An implementing Context needs to implement the missing methods from theContextinterface andgetContextualStorage(boolean). NOTE: Taken from Apache DeltaSpike
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractContext(jakarta.enterprise.inject.spi.BeanManager beanManager)
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckActive()Make sure that the Context is really active.booleandestroy(jakarta.enterprise.context.spi.Contextual bean)Destroy the Contextual Instance of the given Bean.voiddestroyAllActive()destroys all the Contextual Instances in the Storage returned bygetContextualStorage(boolean).static voiddestroyAllActive(ContextualStorage storage)Destroys all the Contextual Instances in the specified ContextualStorage.<T> Tget(jakarta.enterprise.context.spi.Contextual<T> bean)<T> Tget(jakarta.enterprise.context.spi.Contextual<T> bean, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)protected abstract ContextualStoragegetContextualStorage(boolean createIfNotExist)An implementation has to return the underlying storage which contains the items held in the Context.booleanisPassivatingScope()
 
- 
- 
- 
Method Detail- 
getContextualStorageprotected abstract ContextualStorage getContextualStorage(boolean createIfNotExist) An implementation has to return the underlying storage which contains the items held in the Context.- Parameters:
- createIfNotExist- whether a ContextualStorage shall get created if it doesn't yet exist.
- Returns:
- the underlying storage
 
 - 
isPassivatingScopepublic boolean isPassivatingScope() - Returns:
- whether the served scope is a passivating scope
 
 - 
getpublic <T> T get(jakarta.enterprise.context.spi.Contextual<T> bean) - Specified by:
- getin interface- jakarta.enterprise.context.spi.Context
 
 - 
getpublic <T> T get(jakarta.enterprise.context.spi.Contextual<T> bean, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)- Specified by:
- getin interface- jakarta.enterprise.context.spi.Context
 
 - 
destroypublic boolean destroy(jakarta.enterprise.context.spi.Contextual bean) Destroy the Contextual Instance of the given Bean.- Parameters:
- bean- dictates which bean shall get cleaned up
- Returns:
- trueif the bean was destroyed,- falseif there was no such bean.
 
 - 
destroyAllActivepublic void destroyAllActive() destroys all the Contextual Instances in the Storage returned bygetContextualStorage(boolean).
 - 
destroyAllActivepublic static void destroyAllActive(ContextualStorage storage) Destroys all the Contextual Instances in the specified ContextualStorage. This is a static method to allow various holder objects to cleanup properly in @PreDestroy.
 - 
checkActiveprotected void checkActive() Make sure that the Context is really active.- Throws:
- jakarta.enterprise.context.ContextNotActiveException- if there is no active Context for the current Thread.
 
 
- 
 
-