org.ow2.jonas.tm.jotm
Class JOTMTransactionManager

java.lang.Object
  extended by org.objectweb.jotm.Current
      extended by org.ow2.jonas.tm.jotm.JOTMTransactionManager
All Implemented Interfaces:
Serializable, Referenceable, TransactionManager, UserTransaction, org.objectweb.transaction.jta.ResourceManagerEventListener

public class JOTMTransactionManager
extends org.objectweb.jotm.Current
implements TransactionManager

Wrapper on the JOTM TransactionManager (Current) This is necessary to track the begin() calls and implement the additional methods defined in org.ow2.jonas.tm.TransactionManager.

Author:
durieuxp
See Also:
Serialized Form

Constructor Summary
JOTMTransactionManager()
          Constructor for clients (See UserTramsactionFactory)
JOTMTransactionManager(org.objectweb.jotm.TransactionFactory tmfact)
           
 
Method Summary
 void begin()
          Creates a new transaction and associate it with the current thread.
 Reference getReference()
          We want to use our UserTransactionFactory here, that will instanciate a JOTMTransactionManager.
static JOTMTransactionManager getUnique()
           
 boolean isRecoveryEnabled()
           
 boolean nonJotmTransactionContext()
           
 void notifyConnectionClose(Enlistable mce)
          A Connection has been closed.
 void notifyConnectionError(Enlistable mce)
          A Connection has been in error.
 void notifyConnectionOpen(Enlistable mce)
          A Connection has been opened.
 List popConnectionList()
           
 void pushConnectionList(List cl)
           
 void registerResourceManager(String rmName, XAResource xares, String info, Properties p, TxResourceManager trm)
           
 
Methods inherited from class org.objectweb.jotm.Current
actionXAResource, associateThreadTx, begin, begin, clearThreadTx, commit, connectionClosed, connectionErrorOccured, connectionOpened, forgetTx, getAllRcTx, getAllTx, getAllXaTx, getAllXid, getCurrent, getDefaultRecovery, getDefaultTimeout, getJTM, getPreparedHeuristicXid, getPropagationContext, getStatus, getTotalBegunTransactions, getTotalCommittedTransactions, getTotalCurrentTransactions, getTotalExpiredTransactions, getTotalRolledbackTransactions, getTransaction, getTransactionCounters, getTransactionManager, getTransactionRecovery, getTxByXid, getXATerminator, popThreadLocalRMEventList, pushThreadLocalRMEventList, resetAllTxTotalCounters, resume, rollback, setDefaultRecovery, setDefaultTimeout, setPropagationContext, setRollbackOnly, setTransactionRecovery, setTransactionTimeout, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.transaction.TransactionManager
commit, getStatus, getTransaction, resume, rollback, setRollbackOnly, setTransactionTimeout, suspend
 

Constructor Detail

JOTMTransactionManager

public JOTMTransactionManager(org.objectweb.jotm.TransactionFactory tmfact)

JOTMTransactionManager

public JOTMTransactionManager()
Constructor for clients (See UserTramsactionFactory)

Method Detail

getUnique

public static JOTMTransactionManager getUnique()

getReference

public Reference getReference()
                       throws NamingException
We want to use our UserTransactionFactory here, that will instanciate a JOTMTransactionManager.

Specified by:
getReference in interface Referenceable
Overrides:
getReference in class org.objectweb.jotm.Current
Throws:
NamingException

begin

public void begin()
           throws NotSupportedException,
                  SystemException
Creates a new transaction and associate it with the current thread.

Specified by:
begin in interface TransactionManager
Specified by:
begin in interface UserTransaction
Overrides:
begin in class org.objectweb.jotm.Current
Throws:
NotSupportedException - Thrown if the thread is already associated with a transaction. (nested transaction are not supported)
SystemException - Thrown if the transaction manager encounters an unexpected error condition

notifyConnectionOpen

public void notifyConnectionOpen(Enlistable mce)
A Connection has been opened. Must keep it in a list in case a transaction is started, in order to enlist it in the transaction. This is done here. to avoid depending on a specific TM implementation.

Parameters:
mce - The Connection to be enlisted

notifyConnectionClose

public void notifyConnectionClose(Enlistable mce)
A Connection has been closed.

Parameters:
mce - The Connection to be enlisted

notifyConnectionError

public void notifyConnectionError(Enlistable mce)
A Connection has been in error.

Parameters:
mce - The Connection to be enlisted

pushConnectionList

public void pushConnectionList(List cl)

popConnectionList

public List popConnectionList()

nonJotmTransactionContext

public boolean nonJotmTransactionContext()

registerResourceManager

public void registerResourceManager(String rmName,
                                    XAResource xares,
                                    String info,
                                    Properties p,
                                    TxResourceManager trm)
                             throws XAException
Throws:
XAException

isRecoveryEnabled

public boolean isRecoveryEnabled()


Copyright © 2010 OW2 Consortium. All Rights Reserved.