Class DelegatingTransactionManager

  • All Implemented Interfaces:
    javax.transaction.TransactionManager

    @Deprecated(forRemoval=true)
    public abstract class DelegatingTransactionManager
    extends Object
    implements javax.transaction.TransactionManager
    Deprecated, for removal: This API element is subject to removal in a future version.
    An equivalent class now exists in Narayana itself.
    An abstract TransactionManager implementation that delegates all method invocations to another TransactionManager.

    Design Notes

    This class is public for convenience. It is extended by other non-public internal classes.

    See Also:
    TransactionManager
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DelegatingTransactionManager​(javax.transaction.TransactionManager delegate)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void begin()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new transaction and associates it with the current thread.
      void commit()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Completes the transaction associated with the current thread.
      int getStatus()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the status of the transaction associated with the current thread.
      javax.transaction.Transaction getTransaction()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the Transaction object that represents the transaction context of the calling thread.
      void resume​(javax.transaction.Transaction transaction)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resumes the transaction context association of the calling thread with the transaction represented by the supplied Transaction object.
      void rollback()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Rolls back the transaction associated with the current thread.
      void setRollbackOnly()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Irrevocably modifies the transaction associated with the current thread such that the only possible outcome is for it to roll back.
      void setTransactionTimeout​(int seconds)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the timeout value that is associated with transactions started by the current thread with the begin() method.
      javax.transaction.Transaction suspend()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Suspends the transaction currently associated with the calling thread and returns a Transaction that represents the transaction context being suspended, or null if the calling thread is not associated with a transaction.
    • Constructor Detail

      • DelegatingTransactionManager

        protected DelegatingTransactionManager​(javax.transaction.TransactionManager delegate)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Parameters:
        delegate - the TransactionManager to which all method invocations will be delegated; may be null, but then a SystemException will be thrown by every method in this class when invoked
    • Method Detail

      • begin

        public void begin()
                   throws javax.transaction.NotSupportedException,
                          javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a new transaction and associates it with the current thread.
        Specified by:
        begin in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.NotSupportedException - if the thread is already associated with a transaction and this TransactionManager implementation does not support nested transactions
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition
      • commit

        public void commit()
                    throws javax.transaction.RollbackException,
                           javax.transaction.HeuristicMixedException,
                           javax.transaction.HeuristicRollbackException,
                           javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Completes the transaction associated with the current thread.

        When this method completes, the thread is no longer associated with a transaction.

        Specified by:
        commit in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.RollbackException - if the transaction has been rolled back rather than committed
        javax.transaction.HeuristicMixedException - if a heuristic decision was made and that some relevant updates have been committed while others have been rolled back
        javax.transaction.HeuristicRollbackException - if a heuristic decision was made and all relevant updates have been rolled back
        SecurityException - if the thread is not allowed to commit the transaction
        IllegalStateException - if the current thread is not associated with a transaction
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition
      • getStatus

        public int getStatus()
                      throws javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns the status of the transaction associated with the current thread.
        Specified by:
        getStatus in interface javax.transaction.TransactionManager
        Returns:
        the transaction status expressed as the value of one of the int constants in the Status class; if no transaction is associated with the current thread, this method returns Status.STATUS_NO_TRANSACTION
        Throws:
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition
        See Also:
        Status
      • getTransaction

        public javax.transaction.Transaction getTransaction()
                                                     throws javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns the Transaction object that represents the transaction context of the calling thread.

        This method never returns null.

        Specified by:
        getTransaction in interface javax.transaction.TransactionManager
        Returns:
        the Transaction object representing the transaction associated with the calling thread; never null
        Throws:
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition
      • resume

        public void resume​(javax.transaction.Transaction transaction)
                    throws javax.transaction.InvalidTransactionException,
                           javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Resumes the transaction context association of the calling thread with the transaction represented by the supplied Transaction object.

        When this method returns, the calling thread is associated with the transaction context specified.

        Specified by:
        resume in interface javax.transaction.TransactionManager
        Parameters:
        transaction - the Transaction representing the transaction to be resumed; must not be null
        Throws:
        javax.transaction.InvalidTransactionException - if transaction is invalid
        IllegalStateException - if the thread is already associated with another transaction
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition
      • rollback

        public void rollback()
                      throws javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Rolls back the transaction associated with the current thread.

        When this method completes, the thread is no longer associated with a transaction.

        Specified by:
        rollback in interface javax.transaction.TransactionManager
        Throws:
        SecurityException - if the thread is not allowed to roll back the transaction
        IllegalStateException - if the current thread is not associated with a transaction
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition
      • setRollbackOnly

        public void setRollbackOnly()
                             throws javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Irrevocably modifies the transaction associated with the current thread such that the only possible outcome is for it to roll back.
        Specified by:
        setRollbackOnly in interface javax.transaction.TransactionManager
        Throws:
        IllegalStateException - if the current thread is not associated with a transaction
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition
      • setTransactionTimeout

        public void setTransactionTimeout​(int seconds)
                                   throws javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets the timeout value that is associated with transactions started by the current thread with the begin() method.

        If an application has not called this method, the transaction service uses some default value for the transaction timeout.

        Specified by:
        setTransactionTimeout in interface javax.transaction.TransactionManager
        Parameters:
        seconds - the timeout in seconds; if the value is zero, the transaction service restores the default value; if the value is negative a SystemException is thrown
        Throws:
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition or if seconds is less than zero
      • suspend

        public javax.transaction.Transaction suspend()
                                              throws javax.transaction.SystemException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Suspends the transaction currently associated with the calling thread and returns a Transaction that represents the transaction context being suspended, or null if the calling thread is not associated with a transaction.

        This method may return null.

        When this method returns, the calling thread is no longer associated with a transaction.

        Specified by:
        suspend in interface javax.transaction.TransactionManager
        Returns:
        a Transaction representing the suspended transaction, or null
        Throws:
        javax.transaction.SystemException - if this TransactionManager encounters an unexpected error condition