Package com.vaadin.cdi.context
Class VaadinSessionScopedContext.ContextualStorageManager
java.lang.Object
com.vaadin.cdi.context.VaadinSessionScopedContext.ContextualStorageManager
- Enclosing class:
VaadinSessionScopedContext
@ApplicationScoped
public static class VaadinSessionScopedContext.ContextualStorageManager
extends Object
For internal use only.
- Since:
- 16.0.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringName of the session attribute holding the contextual storage. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ContextualStoragegetContextualStorage(jakarta.enterprise.context.spi.Contextual<?> contextual, boolean createIfNotExist) Gets the contextual storage of the current session.protected booleanisActive()Checks whether the context is active, i.e. there is a current session and it is locked by the current thread.
-
Field Details
-
ATTRIBUTE_NAME
Name of the session attribute holding the contextual storage.
-
-
Constructor Details
-
ContextualStorageManager
public ContextualStorageManager()Creates a new storage manager.
-
-
Method Details
-
isActive
protected boolean isActive()Checks whether the context is active, i.e. there is a current session and it is locked by the current thread.- Returns:
trueif the context is active,falseotherwise
-
getContextualStorage
protected ContextualStorage getContextualStorage(jakarta.enterprise.context.spi.Contextual<?> contextual, boolean createIfNotExist) Gets the contextual storage of the current session.- Parameters:
contextual- the contextual the storage is requested forcreateIfNotExist- whether to create the storage if it does not exist yet- Returns:
- the contextual storage, or
nullif it does not exist andcreateIfNotExistisfalse - Throws:
IllegalStateException- if there is no current session
-