Package org.apache.myfaces.cdi.util
Class AbstractContextualStorageHolder<T extends ContextualStorage>
java.lang.Object
org.apache.myfaces.cdi.util.AbstractContextualStorageHolder<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClientWindowScopeContextualStorageHolder,FlowScopeContextualStorageHolder,ViewScopeContextualStorageHolder
public abstract class AbstractContextualStorageHolder<T extends ContextualStorage>
extends Object
implements Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FacesApplicationArtifactHolderprotected jakarta.enterprise.inject.spi.BeanManagerprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroyAll(FacesContext facesContext) voiddestroyAll(FacesContext context, String slotId) voiddestroyAll(T contextualStorage, FacesContext facesContext) This method will replace the storageMap and with a new empty one.getContextualStorage(String slotId) getContextualStorage(String slotId, boolean create) protected static <T extends AbstractContextualStorageHolder>
TgetInstance(FacesContext facesContext, Class<T> contextManagerClass) protected static <T extends AbstractContextualStorageHolder>
TgetInstance(FacesContext facesContext, Class<T> contextManagerClass, boolean create) abstract Class<? extends Annotation>getScope()voidinit()booleanprotected booleanisSkipDestroy(Map.Entry<Object, ContextualInstanceInfo<?>> entry) protected abstract TnewContextualStorage(String slotId) void
-
Field Details
-
applicationContextBean
-
beanManager
@Inject protected jakarta.enterprise.inject.spi.BeanManager beanManager -
storageMap
-
passivating
protected boolean passivating
-
-
Constructor Details
-
AbstractContextualStorageHolder
public AbstractContextualStorageHolder()
-
-
Method Details
-
init
@PostConstruct public void init() -
forceNewStorage
This method will replace the storageMap and with a new empty one. This method can be used to properly destroy the BeanHolder beans without having to sync heavily. AnyContextual.destroy(Object, jakarta.enterprise.context.spi.CreationalContext)should be performed on the returned old storage map.- Returns:
- the old storageMap.
-
getStorageMap
-
getContextualStorage
-
getContextualStorage
-
newContextualStorage
-
preDestroy
@PreDestroy public void preDestroy() -
destroyAll
-
destroyAll
-
isSkipDestroy
-
destroyAll
-
getInstance
protected static <T extends AbstractContextualStorageHolder> T getInstance(FacesContext facesContext, Class<T> contextManagerClass) -
getInstance
protected static <T extends AbstractContextualStorageHolder> T getInstance(FacesContext facesContext, Class<T> contextManagerClass, boolean create) -
isPassivating
public boolean isPassivating() -
getScope
-