Class FlowScopeBeanHolder

  • All Implemented Interfaces:
    Serializable

    @SessionScoped
    public class FlowScopeBeanHolder
    extends Object
    implements Serializable
    This holder will store the flow scope active ids and it's beans for the current HTTP Session. We use standard SessionScoped bean to not need to treat async-supported and similar headache.
    Author:
    lu4242
    See Also:
    Serialized Form
    • Constructor Detail

      • FlowScopeBeanHolder

        public FlowScopeBeanHolder()
    • Method Detail

      • getContextualStorage

        public ContextualStorage getContextualStorage​(javax.enterprise.inject.spi.BeanManager beanManager,
                                                      String flowClientWindowId)
        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.
        flowClientWindowId - the flowClientWindowId for the current flow.
      • getContextualStorageNoCreate

        public ContextualStorage getContextualStorageNoCreate​(javax.enterprise.inject.spi.BeanManager beanManager,
                                                              String flowClientWindowId)
      • getFlowScopeMap

        public Map<Object,​Object> getFlowScopeMap​(javax.enterprise.inject.spi.BeanManager beanManager,
                                                        String flowClientWindowId,
                                                        boolean create)
      • forceNewStorage

        public Map<String,​ContextualStorage> 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. 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()
        This method properly destroys all current @WindowScoped 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 @WindowScoped beans.
      • destroyBeansOnPreDestroy

        @PreDestroy
        public void destroyBeansOnPreDestroy()
        See description on ViewScopeBeanHolder for details about how this works
      • refreshClientWindow

        public void refreshClientWindow​(FacesContext facesContext)
      • clearFlowMap

        public void clearFlowMap​(String clientWindowId)
      • createCurrentFlowScope

        public void createCurrentFlowScope​(FacesContext facesContext)
      • destroyCurrentFlowScope

        public void destroyCurrentFlowScope​(FacesContext facesContext)