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:
TransactionSynchronizationManager, TransactionSynchronization, ConfluenceSynchronizationManager

Method Summary
 java.util.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(java.lang.Runnable task)
          Register a new task to be run on successful transaction commit.
 

Method Detail

runOnSuccessfulCommit

void runOnSuccessfulCommit(java.lang.Runnable task)
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:
isTransactionActive()

registerSynchronization

void registerSynchronization(org.springframework.transaction.support.TransactionSynchronization synchronization)
Registers a Spring TransactionSynchronization on the current transaction.

Throws:
java.lang.IllegalStateException - if there is no Spring transaction available.

getSynchronizations

java.util.List getSynchronizations()
Return an unmodifiable snapshot list of all registered synchronizations for the current thread.

Returns:
unmodifiable List of TransactionSynchronization instances
Throws:
java.lang.IllegalStateException - if transaction is not active
See Also:
TransactionSynchronization

isTransactionActive

boolean isTransactionActive()
Returns:
true if there is an active Spring transaction which accepts synchronizations, otherwise false.


Copyright © 2003-2010 Atlassian. All Rights Reserved.