org.compass.core.transaction
Class AbstractJTATransactionFactory

java.lang.Object
  extended by org.compass.core.transaction.AbstractTransactionFactory
      extended by org.compass.core.transaction.AbstractJTATransactionFactory
All Implemented Interfaces:
TransactionFactory
Direct Known Subclasses:
JTASyncTransactionFactory, XATransactionFactory

public abstract class AbstractJTATransactionFactory
extends AbstractTransactionFactory

A base class for JTA transaction strategies. Associates a CompassSession with the JTA Transaction and uses it as the basis for begin / continue a transaction and for transaction boudn session management.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.core.transaction.AbstractTransactionFactory
commitBeforeCompletion, compass, log
 
Constructor Summary
AbstractJTATransactionFactory()
           
 
Method Summary
protected  void doBindSessionToTransaction(CompassTransaction tr, CompassSession session)
           
 void doConfigure(CompassSettings settings)
           
 CompassSession getTransactionBoundSession()
          Retuns a transaction bound session, or null if none is found.
 TransactionManager getTransactionManager()
           
 UserTransaction getUserTransaction()
           
protected  boolean isWithinExistingTransaction(InternalCompassSession session)
           
 void unbindSessionFromTransaction(Transaction tx)
           
 
Methods inherited from class org.compass.core.transaction.AbstractTransactionFactory
beginTransaction, configure, doBeginTransaction, doContinueTransaction, tryJoinExistingTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJTATransactionFactory

public AbstractJTATransactionFactory()
Method Detail

doConfigure

public void doConfigure(CompassSettings settings)
                 throws CompassException
Overrides:
doConfigure in class AbstractTransactionFactory
Throws:
CompassException

isWithinExistingTransaction

protected boolean isWithinExistingTransaction(InternalCompassSession session)
                                       throws CompassException
Specified by:
isWithinExistingTransaction in class AbstractTransactionFactory
Throws:
CompassException

getTransactionBoundSession

public CompassSession getTransactionBoundSession()
                                          throws CompassException
Description copied from interface: TransactionFactory
Retuns a transaction bound session, or null if none is found.

Throws:
CompassException

doBindSessionToTransaction

protected void doBindSessionToTransaction(CompassTransaction tr,
                                          CompassSession session)
                                   throws CompassException
Specified by:
doBindSessionToTransaction in class AbstractTransactionFactory
Throws:
CompassException

unbindSessionFromTransaction

public void unbindSessionFromTransaction(Transaction tx)

getTransactionManager

public TransactionManager getTransactionManager()

getUserTransaction

public UserTransaction getUserTransaction()
                                   throws TransactionException
Throws:
TransactionException


Copyright (c) 2004-2008 The Compass Project.