Package com.vaadin.quarkus.context
Class RouteScopedContext.ContextualStorageManager
java.lang.Object
com.vaadin.quarkus.context.RouteScopedContext.ContextualStorageManager
- All Implemented Interfaces:
Serializable
- Enclosing class:
RouteScopedContext
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddestroy(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey key) Destroys the contextual storage associated with the given context key.protected voidDestroys all existing contextual storages.protected ContextualStoragegetContextualStorage(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey key, boolean createIfNotExist) Gets theContextualStorageassociated with the given contextkey, possibly creating a new instance, if requested and not already existing.protected Set<com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey> Gets context keys of all registered contextual storages.protected ContextualStoragenewContextualStorage(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey key) Creates a newContextualStoragefor the given context key.protected voidrelocate(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey from, com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey to) Changes the context key for a contextual storage.
-
Constructor Details
-
ContextualStorageManager
public ContextualStorageManager()
-
-
Method Details
-
newContextualStorage
protected ContextualStorage newContextualStorage(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey key) Creates a newContextualStoragefor the given context key.- Parameters:
key- the context key- Returns:
- a new
ContextualStorageinstance.
-
getContextualStorage
protected ContextualStorage getContextualStorage(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey key, boolean createIfNotExist) Gets theContextualStorageassociated with the given contextkey, possibly creating a new instance, if requested and not already existing.- Parameters:
key- context keycreateIfNotExist- whether a ContextualStorage shall get created if it doesn't yet exist.- Returns:
- a
ContextualStorageinstance.
-
relocate
protected void relocate(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey from, com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey to) Changes the context key for a contextual storage.- Parameters:
from- the contextual storage context keyto- the new context for the contextual storage
-
destroyAll
@PreDestroy protected void destroyAll()Destroys all existing contextual storages. -
destroy
protected void destroy(com.vaadin.quarkus.context.RouteScopedContext.RouteStorageKey key) Destroys the contextual storage associated with the given context key.- Parameters:
key- the context key
-
getKeySet
Gets context keys of all registered contextual storages.- Returns:
- immutable set of context keys.
-