org.openanzo.model.transaction.impl
Class TransactionManager

java.lang.Object
  extended by org.openanzo.model.transaction.impl.TransactionManager
All Implemented Interfaces:
ITransactionManager
Direct Known Subclasses:
TransactionQueueManager

public abstract class TransactionManager
extends java.lang.Object
implements ITransactionManager

Standard implementation of the ITransactionQueueManager

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
TransactionManager()
          Create new TransactionQueueManager
 
Method Summary
 void abort()
          Abort the current transaction
 void begin()
          Begin a transaction, blocking if another thread already started a transaction
 void beginNonBlocking()
          Begin a transaction
 void commit()
          Commit the current transaction
 boolean currentThreadOwnsTransaction()
          Return whether the current thread owns the TransactionQueue lock
 boolean isInTransaction()
          Get whether or not a transaction has begun.
abstract  void performAbort()
          Perform internal processes needed to abort the current transaction
abstract  void performBegin()
          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

TransactionManager

public TransactionManager()
Create new TransactionQueueManager

Method Detail

isInTransaction

public boolean isInTransaction()
Description copied from interface: ITransactionManager
Get whether or not a transaction has begun.

Specified by:
isInTransaction in interface ITransactionManager
Returns:
true if a transaction has begun

currentThreadOwnsTransaction

public boolean currentThreadOwnsTransaction()
Description copied from interface: ITransactionManager
Return whether the current thread owns the TransactionQueue lock

Specified by:
currentThreadOwnsTransaction in interface ITransactionManager
Returns:
true if within a transaction and current thread started it

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()
                           throws AnzoException
Perform internal processes needed to begin a new transaction

Throws:
AnzoException - if there was an error beginning a transaction

commit

public void commit()
            throws AnzoException
Description copied from interface: ITransactionManager
Commit the current transaction

Specified by:
commit in interface ITransactionManager
Throws:
AnzoException - if another thread started the transaction or if no transaction is in started

abort

public void abort()
           throws AnzoException
Description copied from interface: ITransactionManager
Abort the current transaction

Specified by:
abort in interface ITransactionManager
Throws:
AnzoException - if another thread started the transaction or if no transaction is in started

beginNonBlocking

public void beginNonBlocking()
                      throws AnzoException
Description copied from interface: ITransactionManager
Begin a transaction

Specified by:
beginNonBlocking in interface ITransactionManager
Throws:
AnzoException - if another thread already started a transaction

begin

public void begin()
           throws AnzoException
Description copied from interface: ITransactionManager
Begin a transaction, blocking if another thread already started a transaction

Specified by:
begin in interface ITransactionManager
Throws:
AnzoException


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