org.springframework.transaction.compensating.support

## Class AbstractCompensatingTransactionManagerDelegate

- java.lang.Object
- - org.springframework.transaction.compensating.support.AbstractCompensatingTransactionManagerDelegate

- Direct Known Subclasses:
    ContextSourceTransactionManagerDelegate

      public abstract class AbstractCompensatingTransactionManagerDelegate
      extends Object

  Abstract superclass for Compensating TransactionManager delegates. The actual transaction work is extracted to a delegate to enable composite Transaction Managers.
  Since:
    1.2
  Author:
    Mattias Hellborg Arthursson

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractCompensatingTransactionManagerDelegate()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `closeTargetResource(CompensatingTransactionHolderSupport transactionHolderSupport)` Close the target resource - the implementation specific resource held in the specified `CompensatingTransactionHolderSupport`.
    `void` | `doBegin(Object transaction, TransactionDefinition definition)`
    `void` | `doCleanupAfterCompletion(Object transaction)`
    `void` | `doCommit(DefaultTransactionStatus status)`
    `Object` | `doGetTransaction()`
    `void` | `doRollback(DefaultTransactionStatus status)`
    `protected abstract CompensatingTransactionHolderSupport` | `getNewHolder()` Get a new implementation specific `CompensatingTransactionHolderSupport` instance.
    `protected abstract Object` | `getTransactionSynchronizationKey()` Get the key (normally, a DataSource or similar) that should be used for transaction synchronization.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractCompensatingTransactionManagerDelegate

          public AbstractCompensatingTransactionManagerDelegate()

  - ### Method Detail

    - #### closeTargetResource

          protected abstract void closeTargetResource(CompensatingTransactionHolderSupport transactionHolderSupport)

      Close the target resource - the implementation specific resource held in the specified `CompensatingTransactionHolderSupport`.
      Parameters:
        `transactionHolderSupport` - the `CompensatingTransactionHolderSupport` that holds the transaction specific target resource.

    - #### getNewHolder

          protected abstract CompensatingTransactionHolderSupport getNewHolder()

      Get a new implementation specific `CompensatingTransactionHolderSupport` instance.
      Returns:
        a new `CompensatingTransactionHolderSupport` instance.

    - #### getTransactionSynchronizationKey

          protected abstract Object getTransactionSynchronizationKey()

      Get the key (normally, a DataSource or similar) that should be used for transaction synchronization.
      Returns:
        the transaction synchronization key

    - #### doGetTransaction

          public Object doGetTransaction()
                                  throws TransactionException

      Throws:
        `TransactionException`

    - #### doBegin

          public void doBegin(Object transaction,
                              TransactionDefinition definition)
                       throws TransactionException

      Throws:
        `TransactionException`

    - #### doCommit

          public void doCommit(DefaultTransactionStatus status)
                        throws TransactionException

      Throws:
        `TransactionException`

    - #### doRollback

          public void doRollback(DefaultTransactionStatus status)
                          throws TransactionException

      Throws:
        `TransactionException`

    - #### doCleanupAfterCompletion

          public void doCleanupAfterCompletion(Object transaction)