Class FacesScopeBeanHolder


  • public class FacesScopeBeanHolder
    extends Object
    Stateless class to deal with Faces Scope. This scope depends on the current FacesContext.
    • Constructor Detail

      • FacesScopeBeanHolder

        public FacesScopeBeanHolder()
    • 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 CDI BeanManager 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. Any Contextual.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.