Class VaadinServiceScopedContext.ContextualStorageManager

java.lang.Object
com.vaadin.cdi.context.VaadinServiceScopedContext.ContextualStorageManager
All Implemented Interfaces:
Serializable
Enclosing class:
VaadinServiceScopedContext

@ApplicationScoped public static class VaadinServiceScopedContext.ContextualStorageManager extends Object
Manages the contextual storages of Vaadin service scoped beans, keyed by servlet name.
See Also:
  • Constructor Details

    • ContextualStorageManager

      public ContextualStorageManager()
      Creates a new storage manager.
  • Method Details

    • getContextualStorage

      protected ContextualStorage getContextualStorage(String key, boolean createIfNotExist)
      Gets the contextual storage for the given key.
      Parameters:
      key - the context key
      createIfNotExist - whether to create the storage if it does not exist yet
      Returns:
      the contextual storage, or null if it does not exist and createIfNotExist is false
    • relocate

      protected void relocate(String from, String to)
      Moves the contextual storage stored for one key to another key. Does nothing if there is no storage for the source key.
      Parameters:
      from - the current key of the storage
      to - the new key of the storage
    • newContextualStorage

      protected ContextualStorage newContextualStorage(String key)
      Creates a new contextual storage for the given key.
      Parameters:
      key - the context key
      Returns:
      the new contextual storage
    • destroyAll

      @PreDestroy protected void destroyAll()
      Destroys all active beans in all managed storages and removes the storages.
    • destroy

      protected void destroy(String key)
      Destroys all active beans in the storage of the given key and removes the storage.
      Parameters:
      key - the context key
    • getKeySet

      protected Set<String> getKeySet()
      Gets the keys of all managed storages.
      Returns:
      an unmodifiable set of the context keys