Class RouteScopedContext.ContextualStorageManager

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

public static class RouteScopedContext.ContextualStorageManager extends Object
Manages the contextual storages of route scoped beans within a Vaadin session.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new storage manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    destroy(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey key)
    Destroys all active beans in the storage of the given key and removes the storage.
    protected void
    Destroys all active beans in all managed storages and removes the storages.
    getContextualStorage(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey key, boolean createIfNotExist)
    Gets the contextual storage for the given key.
    protected Set<com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey>
    Gets the keys of all managed storages.
    newContextualStorage(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey key)
    Creates a new contextual storage for the given key.
    protected void
    relocate(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey from, com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey to)
    Moves the contextual storage stored for one key to another key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ContextualStorageManager

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

    • newContextualStorage

      protected ContextualStorage newContextualStorage(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey key)
      Creates a new contextual storage for the given key.
      Parameters:
      key - the context key
      Returns:
      the new contextual storage
    • getContextualStorage

      protected ContextualStorage getContextualStorage(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey 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(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey from, com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey 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
    • destroyAll

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

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

      protected Set<com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey> getKeySet()
      Gets the keys of all managed storages.
      Returns:
      an unmodifiable set of the context keys