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 FacesApplicationArtifactHolder
protected jakarta.enterprise.inject.spi.BeanManager
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroyAll
(FacesContext facesContext) void
destroyAll
(FacesContext context, String slotId) void
destroyAll
(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()
void
init()
boolean
protected boolean
isSkipDestroy
(Map.Entry<Object, ContextualInstanceInfo<?>> entry) protected abstract T
newContextualStorage
(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
-