Package com.vaadin.cdi.context
Class RouteScopedContext.ContextualStorageManager
java.lang.Object
com.vaadin.cdi.context.RouteScopedContext.ContextualStorageManager
- All Implemented Interfaces:
Serializable
- Enclosing class:
RouteScopedContext
Manages the contextual storages of route scoped beans within a Vaadin
session.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddestroy(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey key) Destroys all active beans in the storage of the given key and removes the storage.protected voidDestroys all active beans in all managed storages and removes the storages.protected ContextualStoragegetContextualStorage(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.protected ContextualStoragenewContextualStorage(com.vaadin.cdi.context.RouteScopedContext.RouteStorageKey key) Creates a new contextual storage for the given key.protected voidrelocate(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.
-
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 keycreateIfNotExist- whether to create the storage if it does not exist yet- Returns:
- the contextual storage, or
nullif it does not exist andcreateIfNotExistisfalse
-
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 storageto- 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
Gets the keys of all managed storages.- Returns:
- an unmodifiable set of the context keys
-