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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FacesApplicationArtifactHolder
applicationContextBean
protected jakarta.enterprise.inject.spi.BeanManager
beanManager
protected Map<String,T>
storageMap
-
Constructor Summary
Constructors Constructor Description AbstractContextualStorageHolder()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
destroyAll(FacesContext facesContext)
void
destroyAll(FacesContext context, String slotId)
void
destroyAll(T contextualStorage, FacesContext facesContext)
Map<String,T>
forceNewStorage()
This method will replace the storageMap and with a new empty one.T
getContextualStorage(String slotId)
T
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)
Map<String,T>
getStorageMap()
void
init()
protected boolean
isSkipDestroy(Map.Entry<Object,ContextualInstanceInfo<?>> entry)
protected abstract T
newContextualStorage(String slotId)
void
preDestroy()
-
-
-
Field Detail
-
applicationContextBean
@Inject protected FacesApplicationArtifactHolder applicationContextBean
-
beanManager
@Inject protected jakarta.enterprise.inject.spi.BeanManager beanManager
-
storageMap
protected Map<String,T extends ContextualStorage> storageMap
-
-
Method Detail
-
init
@PostConstruct public void init()
-
forceNewStorage
public Map<String,T> 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.
-
preDestroy
@PreDestroy public void preDestroy()
-
destroyAll
public void destroyAll(FacesContext facesContext)
-
destroyAll
public void destroyAll(T contextualStorage, FacesContext facesContext)
-
isSkipDestroy
protected boolean isSkipDestroy(Map.Entry<Object,ContextualInstanceInfo<?>> entry)
-
destroyAll
public void destroyAll(FacesContext context, String slotId)
-
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)
-
-