Class 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 of TransactionScoped beans.

    The contextual instances are destroyed when the transaction completes.

    Any attempt to call a method on a TransactionScoped bean when a transaction is not active will result in a . A CDI Event: @Initialized(TransactionScoped.class) is fired with TransactionScopedCDIEventPayload, when the context is initialized for the first time and @Destroyed(TransactionScoped.class) is fired with TransactionScopedCDIEventPayload, 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 Detail

      • TRANSACTION_SYNCHRONIZATION_REGISTRY_JNDI_NAME

        public static final String TRANSACTION_SYNCHRONIZATION_REGISTRY_JNDI_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • TransactionScopedContextImpl

        public TransactionScopedContextImpl()
    • Method Detail

      • getScope

        public Class<? extends Annotation> getScope()
        Specified by:
        getScope in interface jakarta.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 interface jakarta.enterprise.context.spi.Context
      • get

        public <T> T get​(jakarta.enterprise.context.spi.Contextual<T> contextual)
        Specified by:
        get in interface jakarta.enterprise.context.spi.Context
      • isActive

        public boolean isActive()
        Specified by:
        isActive in interface jakarta.enterprise.context.spi.Context