Class NotifyingTransactionManager

  • All Implemented Interfaces:
    jakarta.transaction.TransactionManager, Serializable

    public class NotifyingTransactionManager
    extends TransactionScopedNotifier
    implements jakarta.transaction.TransactionManager, Serializable
    A delegating transaction manager which receives an instance of Narayana transaction manager and delegates all calls to it. On top of it the implementation adds the CDI events processing for TransactionScoped.
    See Also:
    Serialized Form
    • Constructor Detail

      • NotifyingTransactionManager

        NotifyingTransactionManager()
    • Method Detail

      • begin

        public void begin()
                   throws jakarta.transaction.NotSupportedException,
                          jakarta.transaction.SystemException
        Overrides TransactionManager.begin() to additionally fire an Object representing the initialization of the transaction scope.
        Specified by:
        begin in interface jakarta.transaction.TransactionManager
        Throws:
        jakarta.transaction.NotSupportedException
        jakarta.transaction.SystemException
        See Also:
        TransactionManager.begin()
      • commit

        public void commit()
                    throws jakarta.transaction.RollbackException,
                           jakarta.transaction.HeuristicMixedException,
                           jakarta.transaction.HeuristicRollbackException,
                           SecurityException,
                           IllegalStateException,
                           jakarta.transaction.SystemException
        Overrides TransactionManager.commit() to additionally fire an Object representing the before destruction and the destruction of the transaction scope.
        Specified by:
        commit in interface jakarta.transaction.TransactionManager
        Throws:
        jakarta.transaction.RollbackException
        jakarta.transaction.HeuristicMixedException
        jakarta.transaction.HeuristicRollbackException
        SecurityException
        IllegalStateException
        jakarta.transaction.SystemException
        See Also:
        TransactionManager.commit()
      • rollback

        public void rollback()
                      throws IllegalStateException,
                             SecurityException,
                             jakarta.transaction.SystemException
        Overrides TransactionManager.rollback() to additionally fire an Object representing the before destruction and the destruction of the transaction scope.
        Specified by:
        rollback in interface jakarta.transaction.TransactionManager
        Throws:
        IllegalStateException
        SecurityException
        jakarta.transaction.SystemException
        See Also:
        TransactionManager.rollback()
      • getStatus

        public int getStatus()
                      throws jakarta.transaction.SystemException
        Specified by:
        getStatus in interface jakarta.transaction.TransactionManager
        Throws:
        jakarta.transaction.SystemException
      • getTransaction

        public jakarta.transaction.Transaction getTransaction()
                                                       throws jakarta.transaction.SystemException
        Specified by:
        getTransaction in interface jakarta.transaction.TransactionManager
        Throws:
        jakarta.transaction.SystemException
      • resume

        public void resume​(jakarta.transaction.Transaction transaction)
                    throws jakarta.transaction.InvalidTransactionException,
                           IllegalStateException,
                           jakarta.transaction.SystemException
        Specified by:
        resume in interface jakarta.transaction.TransactionManager
        Throws:
        jakarta.transaction.InvalidTransactionException
        IllegalStateException
        jakarta.transaction.SystemException
      • setRollbackOnly

        public void setRollbackOnly()
                             throws IllegalStateException,
                                    jakarta.transaction.SystemException
        Specified by:
        setRollbackOnly in interface jakarta.transaction.TransactionManager
        Throws:
        IllegalStateException
        jakarta.transaction.SystemException
      • setTransactionTimeout

        public void setTransactionTimeout​(int seconds)
                                   throws jakarta.transaction.SystemException
        Specified by:
        setTransactionTimeout in interface jakarta.transaction.TransactionManager
        Throws:
        jakarta.transaction.SystemException
      • getTransactionTimeout

        public int getTransactionTimeout()
                                  throws jakarta.transaction.SystemException
        Returns transaction timeout in seconds.
        Returns:
        transaction timeout set currently
        Throws:
        jakarta.transaction.SystemException - on an undefined error
      • suspend

        public jakarta.transaction.Transaction suspend()
                                                throws jakarta.transaction.SystemException
        Specified by:
        suspend in interface jakarta.transaction.TransactionManager
        Throws:
        jakarta.transaction.SystemException