Class SynchronizationRegistryStandardImpl
- java.lang.Object
-
- org.hibernate.resource.transaction.internal.SynchronizationRegistryStandardImpl
-
- All Implemented Interfaces:
Serializable
,SynchronizationRegistry
,SynchronizationRegistryImplementor
public class SynchronizationRegistryStandardImpl extends Object implements SynchronizationRegistryImplementor
The standard implementation of the SynchronizationRegistry contract- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizationRegistryStandardImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearSynchronizations()
Clears all synchronizations from this registry.int
getNumberOfRegisteredSynchronizations()
Intended for test accessvoid
notifySynchronizationsAfterTransactionCompletion(int status)
Delegates theSynchronization.afterCompletion(int)
call to each registered Synchronization.void
notifySynchronizationsBeforeTransactionCompletion()
Delegates theSynchronization.beforeCompletion()
call to each registered Synchronizationvoid
registerSynchronization(jakarta.transaction.Synchronization synchronization)
Register aSynchronization
callback for this transaction.
-
-
-
Method Detail
-
getNumberOfRegisteredSynchronizations
public int getNumberOfRegisteredSynchronizations()
Intended for test access- Returns:
- The number of Synchronizations registered
-
registerSynchronization
public void registerSynchronization(jakarta.transaction.Synchronization synchronization)
Description copied from interface:SynchronizationRegistry
Register aSynchronization
callback for this transaction.- Specified by:
registerSynchronization
in interfaceSynchronizationRegistry
- Parameters:
synchronization
- The synchronization callback to register.
-
notifySynchronizationsBeforeTransactionCompletion
public void notifySynchronizationsBeforeTransactionCompletion()
Description copied from interface:SynchronizationRegistryImplementor
Delegates theSynchronization.beforeCompletion()
call to each registered Synchronization- Specified by:
notifySynchronizationsBeforeTransactionCompletion
in interfaceSynchronizationRegistryImplementor
-
notifySynchronizationsAfterTransactionCompletion
public void notifySynchronizationsAfterTransactionCompletion(int status)
Description copied from interface:SynchronizationRegistryImplementor
Delegates theSynchronization.afterCompletion(int)
call to each registered Synchronization. Will also clear the registered Synchronizations after all have been notified.- Specified by:
notifySynchronizationsAfterTransactionCompletion
in interfaceSynchronizationRegistryImplementor
- Parameters:
status
- The transaction status, perStatus
constants
-
clearSynchronizations
public void clearSynchronizations()
Description copied from interface:SynchronizationRegistryImplementor
Clears all synchronizations from this registry. Note that synchronizations are automatically cleared during after-completion handling; seeSynchronizationRegistryImplementor.notifySynchronizationsAfterTransactionCompletion(int)
- Specified by:
clearSynchronizations
in interfaceSynchronizationRegistryImplementor
-
-