Package com.vaadin.cdi.util
Class ContextualStorage
java.lang.Object
com.vaadin.cdi.util.ContextualStorage
- All Implemented Interfaces:
Serializable
This Storage holds all information needed for storing
Contextual Instances in a Context.
It also addresses Serialisation in case of passivating scopes.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionContextualStorage(jakarta.enterprise.inject.spi.BeanManager beanManager, boolean concurrent, boolean passivationCapable) -
Method Summary
Modifier and TypeMethodDescription<T> TcreateContextualInstance(jakarta.enterprise.context.spi.Contextual<T> bean, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext) jakarta.enterprise.context.spi.Contextual<?> Restores the Bean from its beanKey.<T> ObjectgetBeanKey(jakarta.enterprise.context.spi.Contextual<T> bean) If the context is a passivating scope then we return the passivationId of the Bean.boolean
-
Constructor Details
-
ContextualStorage
public ContextualStorage(jakarta.enterprise.inject.spi.BeanManager beanManager, boolean concurrent, boolean passivationCapable) - Parameters:
beanManager- is needed for serialisationconcurrent- whether the ContextualStorage might get accessed concurrently by different threadspassivationCapable- whether the storage is for passivation capable Scopes
-
-
Method Details
-
getStorage
- Returns:
- the underlying storage map.
-
isConcurrent
public boolean isConcurrent()- Returns:
- whether the ContextualStorage might get accessed concurrently by different threads.
-
createContextualInstance
public <T> T createContextualInstance(jakarta.enterprise.context.spi.Contextual<T> bean, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext) - Type Parameters:
T-- Parameters:
bean-creationalContext-- Returns:
-
getBeanKey
If the context is a passivating scope then we return the passivationId of the Bean. Otherwise we use the Bean directly.- Returns:
- the key to use in the context map
-
getBean
Restores the Bean from its beanKey.- See Also:
-