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 theSynchronizationRegistrycontract.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SynchronizationRegistryStandardImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSynchronizations()Clears all synchronizations from this registry.intgetNumberOfRegisteredSynchronizations()Intended for test accessvoidnotifySynchronizationsAfterTransactionCompletion(int status)Delegates theSynchronization.afterCompletion(int)call to each registered Synchronization.voidnotifySynchronizationsBeforeTransactionCompletion()Delegates theSynchronization.beforeCompletion()call to each registered SynchronizationvoidregisterSynchronization(Synchronization synchronization)Register aSynchronizationcallback for this transaction.
-
-
-
Method Detail
-
getNumberOfRegisteredSynchronizations
public int getNumberOfRegisteredSynchronizations()
Intended for test access- Returns:
- The number of Synchronizations registered
-
registerSynchronization
public void registerSynchronization(Synchronization synchronization)
Description copied from interface:SynchronizationRegistryRegister aSynchronizationcallback for this transaction.- Specified by:
registerSynchronizationin interfaceSynchronizationRegistry- Parameters:
synchronization- The synchronization callback to register.
-
notifySynchronizationsBeforeTransactionCompletion
public void notifySynchronizationsBeforeTransactionCompletion()
Description copied from interface:SynchronizationRegistryImplementorDelegates theSynchronization.beforeCompletion()call to each registered Synchronization- Specified by:
notifySynchronizationsBeforeTransactionCompletionin interfaceSynchronizationRegistryImplementor
-
notifySynchronizationsAfterTransactionCompletion
public void notifySynchronizationsAfterTransactionCompletion(int status)
Description copied from interface:SynchronizationRegistryImplementorDelegates theSynchronization.afterCompletion(int)call to each registered Synchronization. Will also clear the registeredSynchronizations after all have been notified.- Specified by:
notifySynchronizationsAfterTransactionCompletionin interfaceSynchronizationRegistryImplementor- Parameters:
status- The transaction status, perStatusconstants
-
clearSynchronizations
public void clearSynchronizations()
Description copied from interface:SynchronizationRegistryImplementorClears all synchronizations from this registry. Note that synchronizations are automatically cleared during after-completion handling; seeSynchronizationRegistryImplementor.notifySynchronizationsAfterTransactionCompletion(int)- Specified by:
clearSynchronizationsin interfaceSynchronizationRegistryImplementor
-
-