Package org.apache.myfaces.cdi
Class FacesScopeBeanHolder
- java.lang.Object
-
- org.apache.myfaces.cdi.FacesScopeBeanHolder
-
public class FacesScopeBeanHolder extends Object
Stateless class to deal with Faces Scope. This scope depends on the current FacesContext.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FACES_SCOPE_MAP
static String
FACES_SCOPE_MAP_INFO
-
Constructor Summary
Constructors Constructor Description FacesScopeBeanHolder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroyBeans(FacesContext facesContext)
This method properly destroys all current @FacesScoped beans of the active session and also prepares the storage for new beans.ContextualStorage
forceNewStorage(FacesContext facesContext)
This method will replace the storageMap and with a new empty one.ContextualStorage
getContextualStorage(javax.enterprise.inject.spi.BeanManager beanManager, FacesContext facesContext)
This method will return the ContextualStorage or create a new one if no one is yet assigned to the current flowClientWindowId.ContextualStorage
getContextualStorageNoCreate(javax.enterprise.inject.spi.BeanManager beanManager, FacesContext facesContext)
Map<Object,Object>
getFacesScopeMap(javax.enterprise.inject.spi.BeanManager beanManager, FacesContext facesContext, boolean create)
void
init()
-
-
-
Field Detail
-
FACES_SCOPE_MAP
public static final String FACES_SCOPE_MAP
- See Also:
- Constant Field Values
-
FACES_SCOPE_MAP_INFO
public static final String FACES_SCOPE_MAP_INFO
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
-
getContextualStorage
public ContextualStorage getContextualStorage(javax.enterprise.inject.spi.BeanManager beanManager, FacesContext facesContext)
This method will return the ContextualStorage or create a new one if no one is yet assigned to the current flowClientWindowId.- Parameters:
beanManager
- we need the CDIBeanManager
for serialisation.facesContext
- the current FacesContext instance
-
getContextualStorageNoCreate
public ContextualStorage getContextualStorageNoCreate(javax.enterprise.inject.spi.BeanManager beanManager, FacesContext facesContext)
-
getFacesScopeMap
public Map<Object,Object> getFacesScopeMap(javax.enterprise.inject.spi.BeanManager beanManager, FacesContext facesContext, boolean create)
-
forceNewStorage
public ContextualStorage forceNewStorage(FacesContext facesContext)
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, javax.enterprise.context.spi.CreationalContext)
should be performed on the returned old storage map.- Returns:
- the old storageMap.
-
destroyBeans
public void destroyBeans(FacesContext facesContext)
This method properly destroys all current @FacesScoped beans of the active session and also prepares the storage for new beans. It will automatically get called when the session context closes but can also get invoked manually, e.g. if a user likes to get rid of all it's @FacesScoped beans.
-
-