org.openanzo.model.transaction.impl
Class LockingTransactionManager

java.lang.Object
  extended by org.openanzo.model.transaction.impl.LockingTransactionManager

public abstract class LockingTransactionManager
extends java.lang.Object

Standard implementation of the ITransactionQueueManager

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
LockingTransactionManager()
          Create new TransactionQueueManager
 
Method Summary
 void abort()
          Abort the current transaction
 void begin(boolean writeLock)
          Begin a new transaction, blocking if another transaction is already started
 void beginNonBlocking(boolean writeLock)
          Begin a new transaction
 void commit()
          Commit the current transaction
 boolean currentThreadOwnsTransaction()
          Determine if the current tread started the current transaction
 boolean isInTransaction()
          Determine if transaction has been started
abstract  void performAbort()
          Perform internal processes needed to abort the current transaction
abstract  void performBegin(boolean writeLock)
          Perform internal processes needed to begin a new transaction
abstract  void performCommit()
          Perform internal processes needed to commit the current transaction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockingTransactionManager

public LockingTransactionManager()
Create new TransactionQueueManager

Method Detail

isInTransaction

public boolean isInTransaction()
Determine if transaction has been started

Returns:
true if transaction has been started

currentThreadOwnsTransaction

public boolean currentThreadOwnsTransaction()
Determine if the current tread started the current transaction

Returns:
true if the current tread started the current transaction

performCommit

public abstract void performCommit()
                            throws AnzoException
Perform internal processes needed to commit the current transaction

Throws:
AnzoException - if there was an error committing transaction

performAbort

public abstract void performAbort()
                           throws AnzoException
Perform internal processes needed to abort the current transaction

Throws:
AnzoException - if there was an error aborting transaction

performBegin

public abstract void performBegin(boolean writeLock)
                           throws AnzoException
Perform internal processes needed to begin a new transaction

Parameters:
writeLock - true if beginning a transaction that will write data
Throws:
AnzoException - if there was an error beginning a transaction

commit

public void commit()
            throws AnzoException
Commit the current transaction

Throws:
AnzoException - if currentThread not the owner of transaction, or if no transaction has been started

abort

public void abort()
           throws AnzoException
Abort the current transaction

Throws:
AnzoException - if currentThread not the owner of transaction, or if no transaction has been started

beginNonBlocking

public void beginNonBlocking(boolean writeLock)
                      throws AnzoException
Begin a new transaction

Parameters:
writeLock - true if this transaction that will write data
Throws:
AnzoException - if there is already a transaction started, and current thread didn't start it

begin

public void begin(boolean writeLock)
           throws AnzoException
Begin a new transaction, blocking if another transaction is already started

Parameters:
writeLock - true if this transaction that will write data
Throws:
AnzoException - if there was an error beginning transaction


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.