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 Details

    • applicationContextBean

      @Inject protected FacesApplicationArtifactHolder applicationContextBean
    • beanManager

      @Inject protected jakarta.enterprise.inject.spi.BeanManager beanManager
    • storageMap

      protected Map<String,T extends ContextualStorage> storageMap
    • passivating

      protected boolean passivating
  • Constructor Details

    • AbstractContextualStorageHolder

      public AbstractContextualStorageHolder()
  • Method Details

    • init

      @PostConstruct public void init()
    • forceNewStorage

      public Map<String,T> 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, jakarta.enterprise.context.spi.CreationalContext) should be performed on the returned old storage map.
      Returns:
      the old storageMap.
    • getStorageMap

      public Map<String,T> getStorageMap()
    • getContextualStorage

      public T getContextualStorage(String slotId)
    • getContextualStorage

      public T getContextualStorage(String slotId, boolean create)
    • newContextualStorage

      protected abstract T newContextualStorage(String slotId)
    • preDestroy

      @PreDestroy public void preDestroy()
    • destroyAll

      public void destroyAll(FacesContext facesContext)
    • destroyAll

      public void destroyAll(T contextualStorage, FacesContext facesContext)
    • isSkipDestroy

      protected boolean isSkipDestroy(Map.Entry<Object,ContextualInstanceInfo<?>> entry)
    • destroyAll

      public void destroyAll(FacesContext context, String slotId)
    • 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

      public abstract Class<? extends Annotation> getScope()