@Internal
public abstract class TransactionSynchronizationUtils
extends java.lang.Object
TransactionSynchronization
callback methods on all currently registered synchronizations.TransactionSynchronization
,
TransactionSynchronizationManager.getSynchronizations()
Constructor and Description |
---|
TransactionSynchronizationUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
invokeAfterCommit(java.util.List<TransactionSynchronization> synchronizations)
Actually invoke the
afterCommit methods of the
given Spring TransactionSynchronization objects. |
static void |
invokeAfterCompletion(java.util.List<TransactionSynchronization> synchronizations,
TransactionSynchronization.Status completionStatus)
Actually invoke the
afterCompletion methods of the
given Spring TransactionSynchronization objects. |
static boolean |
sameResourceFactory(ResourceTransactionManager tm,
java.lang.Object resourceFactory)
Check whether the given resource transaction managers refers to the given
(underlying) resource factory.
|
static void |
triggerAfterCommit()
Trigger
afterCommit callbacks on all currently registered synchronizations. |
static void |
triggerAfterCompletion(TransactionSynchronization.Status completionStatus)
Trigger
afterCompletion callbacks on all currently registered synchronizations. |
static void |
triggerBeforeCommit(boolean readOnly)
Trigger
beforeCommit callbacks on all currently registered synchronizations. |
static void |
triggerBeforeCompletion()
Trigger
beforeCompletion callbacks on all currently registered synchronizations. |
static void |
triggerFlush()
Trigger
flush callbacks on all currently registered synchronizations. |
public static boolean sameResourceFactory(ResourceTransactionManager tm, java.lang.Object resourceFactory)
tm
- the resource managerresourceFactory
- The resource factoryResourceTransactionManager.getResourceFactory()
public static void triggerFlush()
flush
callbacks on all currently registered synchronizations.java.lang.RuntimeException
- if thrown by a flush
callbackTransactionSynchronization.flush()
public static void triggerBeforeCommit(boolean readOnly)
beforeCommit
callbacks on all currently registered synchronizations.readOnly
- whether the transaction is defined as read-only transactionjava.lang.RuntimeException
- if thrown by a beforeCommit
callbackTransactionSynchronization.beforeCommit(boolean)
public static void triggerBeforeCompletion()
beforeCompletion
callbacks on all currently registered synchronizations.public static void triggerAfterCommit()
afterCommit
callbacks on all currently registered synchronizations.java.lang.RuntimeException
- if thrown by a afterCommit
callbackTransactionSynchronizationManager.getSynchronizations()
,
TransactionSynchronization.afterCommit()
public static void invokeAfterCommit(@Nullable java.util.List<TransactionSynchronization> synchronizations)
afterCommit
methods of the
given Spring TransactionSynchronization objects.synchronizations
- a List of TransactionSynchronization objectsTransactionSynchronization.afterCommit()
public static void triggerAfterCompletion(@NonNull TransactionSynchronization.Status completionStatus)
afterCompletion
callbacks on all currently registered synchronizations.completionStatus
- the completion status according to the
constants in the TransactionSynchronization interfaceTransactionSynchronizationManager.getSynchronizations()
,
TransactionSynchronization.afterCompletion(TransactionSynchronization.Status)
,
TransactionSynchronization.Status.COMMITTED
,
TransactionSynchronization.Status.ROLLED_BACK
,
TransactionSynchronization.Status.UNKNOWN
public static void invokeAfterCompletion(@Nullable java.util.List<TransactionSynchronization> synchronizations, @NonNull TransactionSynchronization.Status completionStatus)
afterCompletion
methods of the
given Spring TransactionSynchronization objects.synchronizations
- a List of TransactionSynchronization objectscompletionStatus
- the completion status according to the
constants in the TransactionSynchronization interfaceTransactionSynchronization.afterCompletion(TransactionSynchronization.Status)
,
TransactionSynchronization.Status.COMMITTED
,
TransactionSynchronization.Status.ROLLED_BACK
,
TransactionSynchronization.Status.UNKNOWN