Package com.vaadin.cdi.context
Class RouteScopedContext
java.lang.Object
com.vaadin.cdi.util.AbstractContext
com.vaadin.cdi.context.RouteScopedContext
- All Implemented Interfaces:
jakarta.enterprise.context.spi.Context
Context for
@RouteScoped beans.- Since:
- 10.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classManages the contextual storages of route scoped beans within a Vaadin session. -
Constructor Summary
ConstructorsConstructorDescriptionRouteScopedContext(jakarta.enterprise.inject.spi.BeanManager beanManager) Creates a new route scoped context. -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ContextualStorage> Returns the contextual storages that are currently active for this context.protected ContextualStoragegetContextualStorage(jakarta.enterprise.context.spi.Contextual<?> contextual, boolean createIfNotExist) An implementation has to return the underlying storage which contains the items held in the Context.Class<? extends Annotation> getScope()voidInitializes the context by looking up its storage manager.booleanisActive()Methods inherited from class com.vaadin.cdi.util.AbstractContext
checkActive, destroy, destroyAllActive, destroyAllActive, destroyBean, get, get, isPassivatingScope
-
Constructor Details
-
RouteScopedContext
public RouteScopedContext(jakarta.enterprise.inject.spi.BeanManager beanManager) Creates a new route scoped context.- Parameters:
beanManager- the bean manager
-
-
Method Details
-
init
public void init(jakarta.enterprise.inject.spi.BeanManager beanManager, Supplier<Boolean> isUIContextActive) Initializes the context by looking up its storage manager.- Parameters:
beanManager- the bean managerisUIContextActive- supplier telling whether the UI context is active, used to determine whether this context is active
-
getScope
-
isActive
public boolean isActive() -
getActiveContextualStorages
Description copied from class:AbstractContextReturns the contextual storages that are currently active for this context.The default implementation returns a list containing the storage returned by
AbstractContext.getContextualStorage(Contextual, boolean)without creating it, so the only entry isnullif no storage exists yet.- Overrides:
getActiveContextualStoragesin classAbstractContext- Returns:
- a list of the active contextual storages, entries may be
null
-
getContextualStorage
protected ContextualStorage getContextualStorage(jakarta.enterprise.context.spi.Contextual<?> contextual, boolean createIfNotExist) Description copied from class:AbstractContextAn implementation has to return the underlying storage which contains the items held in the Context.- Specified by:
getContextualStoragein classAbstractContext- Parameters:
contextual- the contextual for which the storage is requested, may benullcreateIfNotExist- whether a ContextualStorage shall get created if it doesn't yet exist.- Returns:
- the underlying storage
-