org.apache.commons.transaction
Interface ManageableResourceManager

All Superinterfaces:
TransactionalResourceManager
All Known Subinterfaces:
TxMap<K,V>
All Known Implementing Classes:
AbstractTransactionalResourceManager, BasicTxMap, OptimisticTxMap, PessimisticTxMap, TxFileResourceManager

public interface ManageableResourceManager
extends TransactionalResourceManager

Needs to be implemented by all resource managers that want to take part in a combined transaction. This interface is not meant for user interaction.


Method Summary
 boolean commitCanFail()
          Checks whether a tried commit could possibly fail because of logical reasons.
 void forgetTransaction()
          Instructs the resource manager to forget about the current transaction.
 boolean isReadOnly()
          Checks if there had been any write operations on this resource manager since the start of the transaction.
 boolean isRollbackOnly()
          Checks whether this resource manager allows a rollback as the only valid outcome.
 void joinTransaction(LockManager<Object,Object> lm)
          Lets this resource manager join a transaction that is protected by a common lock manager.
 boolean prepareTransaction()
          Checks whether this resource manager is willing and able to commit its part of the complex transaction.
 
Methods inherited from interface org.apache.commons.transaction.TransactionalResourceManager
commitTransaction, rollbackTransaction, startTransaction
 

Method Detail

prepareTransaction

boolean prepareTransaction()
Checks whether this resource manager is willing and able to commit its part of the complex transaction.

Returns:
true if this resource manager can commit its part of the transaction

forgetTransaction

void forgetTransaction()
Instructs the resource manager to forget about the current transaction.


joinTransaction

void joinTransaction(LockManager<Object,Object> lm)
Lets this resource manager join a transaction that is protected by a common lock manager. An implementation is required to perform all locking operations on the given lock manager as long as it takes part in the complex transaction.

Parameters:
lm - the common lock maanger

isRollbackOnly

boolean isRollbackOnly()
Checks whether this resource manager allows a rollback as the only valid outcome. Once a transaction is marked for rollback there is no way to undo this. A transaction that is marked for rollback can not be committed.

Returns:
true if this resource manager can only roll back

isReadOnly

boolean isReadOnly()
Checks if there had been any write operations on this resource manager since the start of the transaction. If not the transaction is not required to call either TransactionalResourceManager.commitTransaction() or TransactionalResourceManager.rollbackTransaction(), but only forgetTransaction().

Returns:
true if there had been read operations only

commitCanFail

boolean commitCanFail()
Checks whether a tried commit could possibly fail because of logical reasons.

Returns:
true if a commit could fail


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.