com.atlassian.confluence.util.transaction
Class ReadOnlyTransactionExecutor<K>

java.lang.Object
  extended by com.atlassian.confluence.util.transaction.ReadOnlyTransactionExecutor<K>
All Implemented Interfaces:
TransactionExecutor<K>, org.springframework.beans.factory.DisposableBean

public class ReadOnlyTransactionExecutor<K>
extends java.lang.Object
implements TransactionExecutor<K>, org.springframework.beans.factory.DisposableBean

TransactionExecutor that wraps all TransactionCallback calls within a read only transaction. Only one callback will be executed at a time (subsequent calls to wrapTransactionCallback will result in the queueing of the provided actions). This implementation will perform the transaction in a separate thread, and return a {Future representing the result of the operation.


Constructor Summary
ReadOnlyTransactionExecutor(org.springframework.transaction.PlatformTransactionManager transactionManager)
           
 
Method Summary
 void destroy()
           
 java.util.concurrent.Future<K> performTransactionAction(org.springframework.transaction.support.TransactionCallback action)
          Invokes the provided action within its own transaction context, and returns a Future representing the results of the invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyTransactionExecutor

public ReadOnlyTransactionExecutor(org.springframework.transaction.PlatformTransactionManager transactionManager)
Method Detail

performTransactionAction

public java.util.concurrent.Future<K> performTransactionAction(org.springframework.transaction.support.TransactionCallback action)
Description copied from interface: TransactionExecutor
Invokes the provided action within its own transaction context, and returns a Future representing the results of the invocation.

Specified by:
performTransactionAction in interface TransactionExecutor<K>
Parameters:
action - to perform
Returns:
the result of the action

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
java.lang.Exception


Copyright © 2003-2014 Atlassian. All Rights Reserved.