Package org.glassfish.cdi.transaction
Class TransactionScopedContextImpl
- java.lang.Object
-
- org.glassfish.cdi.transaction.TransactionScopedContextImpl
-
- All Implemented Interfaces:
jakarta.enterprise.context.spi.Context
public class TransactionScopedContextImpl extends Object implements jakarta.enterprise.context.spi.Context
The Context implementation for obtaining contextual instances ofTransactionScoped
beans. The contextual instances are destroyed when the transaction completes. Any attempt to call a method on aTransactionScoped
bean when a transaction is not active will result in a . A CDI Event: @Initialized(TransactionScoped.class) is fired withTransactionScopedCDIEventPayload
, when the context is initialized for the first time and @Destroyed(TransactionScoped.class) is fired withTransactionScopedCDIEventPayload
, when the context is destroyed at the end. Currently this payload is empty i.e. it doesn't contain any information.- Author:
- JJ Snyder, Arjav Desai
-
-
Field Summary
Fields Modifier and Type Field Description static String
TRANSACTION_SYNCHRONIZATION_REGISTRY_JNDI_NAME
-
Constructor Summary
Constructors Constructor Description TransactionScopedContextImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
get(jakarta.enterprise.context.spi.Contextual<T> contextual)
<T> T
get(jakarta.enterprise.context.spi.Contextual<T> contextual, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
ConcurrentHashMap<jakarta.transaction.TransactionSynchronizationRegistry,Set<TransactionScopedBean>>
getBeansPerTransaction()
Class<? extends Annotation>
getScope()
boolean
isActive()
-
-
-
Field Detail
-
TRANSACTION_SYNCHRONIZATION_REGISTRY_JNDI_NAME
public static final String TRANSACTION_SYNCHRONIZATION_REGISTRY_JNDI_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBeansPerTransaction
public ConcurrentHashMap<jakarta.transaction.TransactionSynchronizationRegistry,Set<TransactionScopedBean>> getBeansPerTransaction()
-
getScope
public Class<? extends Annotation> getScope()
- Specified by:
getScope
in interfacejakarta.enterprise.context.spi.Context
-
get
public <T> T get(jakarta.enterprise.context.spi.Contextual<T> contextual, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
- Specified by:
get
in interfacejakarta.enterprise.context.spi.Context
-
get
public <T> T get(jakarta.enterprise.context.spi.Contextual<T> contextual)
- Specified by:
get
in interfacejakarta.enterprise.context.spi.Context
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfacejakarta.enterprise.context.spi.Context
-
-