Package com.atlassian.confluence.core
Class ConfluenceSynchronizationManager
- java.lang.Object
-
- com.atlassian.confluence.core.ConfluenceSynchronizationManager
-
- All Implemented Interfaces:
SynchronizationManager
public class ConfluenceSynchronizationManager extends Object implements SynchronizationManager
Confluence transaction sycnhronization manager. Uses Spring for transaction management.
-
-
Constructor Summary
Constructors Constructor Description ConfluenceSynchronizationManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListgetSynchronizations()Return an unmodifiable snapshot list of all registered synchronizations for the current thread.booleanisTransactionActive()voidregisterSynchronization(org.springframework.transaction.support.TransactionSynchronization synchronization)Registers a SpringTransactionSynchronizationon the current transaction.voidrunOnSuccessfulCommit(Runnable task)Register a task to be run once the current transaction is successfully committed.
-
-
-
Method Detail
-
runOnSuccessfulCommit
public void runOnSuccessfulCommit(Runnable task)
Register a task to be run once the current transaction is successfully committed. If no transaction exists the task is run immediately. All tasks are run on the thread which registered them.
If a task produces an exception it is logged and swallowed.
- Specified by:
runOnSuccessfulCommitin interfaceSynchronizationManager- See Also:
SynchronizationManager.isTransactionActive()
-
isTransactionActive
public boolean isTransactionActive()
- Specified by:
isTransactionActivein interfaceSynchronizationManager- Returns:
- true if there is an active Spring transaction which accepts synchronizations, otherwise false.
-
registerSynchronization
public void registerSynchronization(org.springframework.transaction.support.TransactionSynchronization synchronization)
Description copied from interface:SynchronizationManagerRegisters a SpringTransactionSynchronizationon the current transaction.- Specified by:
registerSynchronizationin interfaceSynchronizationManager
-
getSynchronizations
public List getSynchronizations()
Description copied from interface:SynchronizationManagerReturn an unmodifiable snapshot list of all registered synchronizations for the current thread.- Specified by:
getSynchronizationsin interfaceSynchronizationManager- Returns:
- unmodifiable List of TransactionSynchronization instances
- See Also:
TransactionSynchronization
-
-