Class ViewScopeBeanHolder

    • Field Detail

      • CREATED

        public static final String CREATED
    • Constructor Detail

      • ViewScopeBeanHolder

        public ViewScopeBeanHolder()
    • Method Detail

      • getContextualStorage

        public ViewScopeContextualStorage getContextualStorage​(javax.enterprise.inject.spi.BeanManager beanManager,
                                                               String viewScopeId)
        This method will return the ViewScopeContextualStorage or create a new one if no one is yet assigned to the current windowId.
        Parameters:
        beanManager -
        viewScopeId -
        Returns:
      • forceNewStorage

        public Map<String,​ViewScopeContextualStorage> 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 @ViewScoped beans.
      • destroyBeans

        public void destroyBeans​(String viewScopeId)
      • destroyBeansOnPreDestroy

        @PreDestroy
        public void destroyBeansOnPreDestroy()
      • generateUniqueViewScopeId

        public String generateUniqueViewScopeId()
      • removeStorage

        public void removeStorage​(String viewScopeId)