org.compass.core.transaction
Class LocalTransactionFactory

java.lang.Object
  extended by org.compass.core.transaction.AbstractTransactionFactory
      extended by org.compass.core.transaction.LocalTransactionFactory
All Implemented Interfaces:
TransactionFactory

public class LocalTransactionFactory
extends AbstractTransactionFactory

Local transaction factory provides Compass level transaction managment.

By default, when a transaction begins, the CompassSession is bounded to a thread local. It will be unbinded from the thread local when the transaction commits/rollsback.

Author:
kimchy

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

Constructor Detail

LocalTransactionFactory

public LocalTransactionFactory()
Method Detail

doConfigure

protected void doConfigure(CompassSettings settings)
Overrides:
doConfigure in class AbstractTransactionFactory

isWithinExistingTransaction

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

doBeginTransaction

protected InternalCompassTransaction doBeginTransaction(InternalCompassSession session)
                                                 throws CompassException
Specified by:
doBeginTransaction in class AbstractTransactionFactory
Throws:
CompassException

doContinueTransaction

protected InternalCompassTransaction doContinueTransaction(InternalCompassSession session)
                                                    throws CompassException
Specified by:
doContinueTransaction 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

unbindSessionFromTransaction

public void unbindSessionFromTransaction(LocalTransaction tr,
                                         CompassSession session)

doBindSessionToTransaction

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


Copyright (c) 2004-2009 The Compass Project.