com.atlassian.confluence.core
Class ConfluenceSynchronizationManager

java.lang.Object
  extended by 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
ConfluenceSynchronizationManager()
           
 
Method Summary
static ConfluenceSynchronizationManager getInstance()
           
 List getSynchronizations()
          Return an unmodifiable snapshot list of all registered synchronizations for the current thread.
 boolean isTransactionActive()
           
 void registerSynchronization(org.springframework.transaction.support.TransactionSynchronization synchronization)
          Registers a Spring TransactionSynchronization on the current transaction.
 void runOnSuccessfulCommit(Runnable task)
          Register a task to be run once the current transaction is successfully committed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceSynchronizationManager

public ConfluenceSynchronizationManager()
Method Detail

getInstance

public static ConfluenceSynchronizationManager getInstance()
Returns:
the default SynchronizationManager -- an instance of this class.

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:
runOnSuccessfulCommit in interface SynchronizationManager
See Also:
SynchronizationManager.isTransactionActive()

isTransactionActive

public boolean isTransactionActive()
Specified by:
isTransactionActive in interface SynchronizationManager
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: SynchronizationManager
Registers a Spring TransactionSynchronization on the current transaction.

Specified by:
registerSynchronization in interface SynchronizationManager

getSynchronizations

public List getSynchronizations()
Description copied from interface: SynchronizationManager
Return an unmodifiable snapshot list of all registered synchronizations for the current thread.

Specified by:
getSynchronizations in interface SynchronizationManager
Returns:
unmodifiable List of TransactionSynchronization instances
See Also:
TransactionSynchronization


Copyright © 2003-2011 Atlassian. All Rights Reserved.