Class TransactionScopedBean<T>

  • All Implemented Interfaces:
    jakarta.transaction.Synchronization

    public class TransactionScopedBean<T>
    extends Object
    implements jakarta.transaction.Synchronization
    A wrapper for contextual instances of TransactionScoped beans. We need this wrapper so that the contextual instance can be destroyed when the transaction completes.
    Author:
    JJ Snyder
    • Constructor Detail

      • TransactionScopedBean

        public TransactionScopedBean​(jakarta.enterprise.context.spi.Contextual<T> contextual,
                                     jakarta.enterprise.context.spi.CreationalContext<T> creationalContext,
                                     TransactionScopedContextImpl transactionScopedContext)
    • Method Detail

      • getContextualInstance

        public T getContextualInstance()
      • beforeCompletion

        public void beforeCompletion()
        Specified by:
        beforeCompletion in interface jakarta.transaction.Synchronization
      • afterCompletion

        public void afterCompletion​(int i)
        Destroy the contextual instance.
        Specified by:
        afterCompletion in interface jakarta.transaction.Synchronization