Package com.atlassian.confluence.core
Interface SynchronizationManager
- All Known Implementing Classes:
ConfluenceSynchronizationManager
public interface SynchronizationManager
Manages transaction synchronizations: a list of actions to be done when
the transaction completes on the current thread. Interface is derived mostly from
TransactionSynchronizationManager
which is used by the Confluence implementation.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturn an unmodifiable snapshot list of all registered synchronizations for the current thread.boolean
void
registerSynchronization
(org.springframework.transaction.support.TransactionSynchronization synchronization) Registers a SpringTransactionSynchronization
on the current transaction.void
Register a new task to be run on successful transaction commit.
-
Method Details
-
runOnSuccessfulCommit
Register a new task to be run on successful transaction commit. If transaction is not active, the task is run immediately.To run a task with different transaction result criteria, use
registerSynchronization(TransactionSynchronization)
.- See Also:
-
registerSynchronization
void registerSynchronization(org.springframework.transaction.support.TransactionSynchronization synchronization) Registers a SpringTransactionSynchronization
on the current transaction.- Throws:
IllegalStateException
- if there is no Spring transaction available.
-
getSynchronizations
List getSynchronizations()Return an unmodifiable snapshot list of all registered synchronizations for the current thread.- Returns:
- unmodifiable List of TransactionSynchronization instances
- Throws:
IllegalStateException
- if transaction is not active- See Also:
-
isTransactionActive
boolean isTransactionActive()- Returns:
- true if there is an active Spring transaction which accepts synchronizations, otherwise false.
-