org.compass.core.transaction
Class AbstractJTATransaction

java.lang.Object
  extended by org.compass.core.transaction.AbstractTransaction
      extended by org.compass.core.transaction.AbstractJTATransaction
All Implemented Interfaces:
CompassTransaction, InternalCompassTransaction
Direct Known Subclasses:
JTASyncTransaction, XATransaction

public abstract class AbstractJTATransaction
extends AbstractTransaction

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.core.transaction.AbstractTransaction
transactionFactory
 
Constructor Summary
AbstractJTATransaction(UserTransaction ut, TransactionFactory transactionFactory)
           
 
Method Summary
 void begin(InternalCompassSession session, TransactionManager transactionManager)
           
protected abstract  void doBindToTransaction(Transaction tx, InternalCompassSession session, boolean newTransaction)
           
protected  void doCommit()
           
protected  void doRollback()
           
 CompassSession getSession()
          Returns the current Compass transaction associated with this transaction.
 void join(InternalCompassSession session)
          Called by the factory when joining an already running compass transaction
 boolean wasCommitted()
          Check if this transaction was successfully committed.
 boolean wasRolledBack()
          Was this transaction rolled back or set to rollback only?
 
Methods inherited from class org.compass.core.transaction.AbstractTransaction
commit, getSearchEngine, isBegun, rollback, setBegun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJTATransaction

public AbstractJTATransaction(UserTransaction ut,
                              TransactionFactory transactionFactory)
Method Detail

begin

public void begin(InternalCompassSession session,
                  TransactionManager transactionManager)
           throws CompassException
Throws:
CompassException

doBindToTransaction

protected abstract void doBindToTransaction(Transaction tx,
                                            InternalCompassSession session,
                                            boolean newTransaction)
                                     throws Exception
Throws:
Exception

join

public void join(InternalCompassSession session)
          throws CompassException
Called by the factory when joining an already running compass transaction

Throws:
CompassException

doCommit

protected void doCommit()
                 throws CompassException
Specified by:
doCommit in class AbstractTransaction
Throws:
CompassException

doRollback

protected void doRollback()
                   throws CompassException
Specified by:
doRollback in class AbstractTransaction
Throws:
CompassException

wasRolledBack

public boolean wasRolledBack()
                      throws TransactionException
Description copied from interface: CompassTransaction
Was this transaction rolled back or set to rollback only?

Returns:
If the transaction was rolled backed
Throws:
TransactionException

wasCommitted

public boolean wasCommitted()
                     throws TransactionException
Description copied from interface: CompassTransaction
Check if this transaction was successfully committed. This method could return false even after successful invocation of commit().

Returns:
If the transaction was committed
Throws:
TransactionException

getSession

public CompassSession getSession()
Description copied from interface: CompassTransaction
Returns the current Compass transaction associated with this transaction.



Copyright (c) 2004-2009 The Compass Project.