Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » tm » [javadoc | source]
org.jboss.tm
public class: TxManager [javadoc | source]
java.lang.Object
   org.jboss.tm.TxManager

All Implemented Interfaces:
    TransactionPropagationContextImporter, javax.transaction.TransactionManager, TransactionPropagationContextFactory, TransactionLocalDelegate

Our TransactionManager implementation.
Nested Class Summary:
static class  TxManager.ThreadInfo  A simple aggregate of a thread-associated timeout value and a thread-associated transaction. 
Method from org.jboss.tm.TxManager Summary:
associateThread,   begin,   commit,   containsValue,   disassociateThread,   getCommitCount,   getDefaultTransactionTimeout,   getInstance,   getRollbackCount,   getStatus,   getTransaction,   getTransactionCount,   getTransactionPropagationContext,   getTransactionPropagationContext,   getValue,   importTransactionPropagationContext,   incCommitCount,   incRollbackCount,   releaseTransactionImpl,   resume,   rollback,   setDefaultTransactionTimeout,   setRollbackOnly,   setTransactionTimeout,   storeValue,   suspend
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.tm.TxManager Detail:
 public  void associateThread(Transaction transaction) 
 public  void begin() throws SystemException, NotSupportedException 
    Begin a new transaction. The new transaction will be associated with the calling thread.
 public  void commit() throws SystemException, SecurityException, RollbackException, IllegalStateException, HeuristicRollbackException, HeuristicMixedException 
    Commit the transaction associated with the currently running thread.
 public boolean containsValue(TransactionLocal local,
    Transaction tx) 
    does TransactionImpl contain object?
 public Transaction disassociateThread() 
    The following 2 methods are here to provide association and disassociation of the thread.
 public long getCommitCount() 
    A count of the transactions that have been committed
 public int getDefaultTransactionTimeout() 
    Get the default transaction timeout.
 public static TxManager getInstance() 
    Get a reference to the singleton instance.
 public long getRollbackCount() 
    A count of the transactions that have been rolled back
 public int getStatus() throws SystemException 
    Return the status of the transaction associated with the currently running thread, or Status.STATUS_NO_TRANSACTION if no active transaction is currently associated.
 public Transaction getTransaction() throws SystemException 
    Return the transaction currently associated with the invoking thread, or null if no active transaction is currently associated.
 public int getTransactionCount() 
    Return the number of active transactions
 public Object getTransactionPropagationContext() 
    Return a TPC for the current transaction.
 public Object getTransactionPropagationContext(Transaction tx) 
    Return a TPC for the argument transaction.
 public Object getValue(TransactionLocal local,
    Transaction tx) 
    get the transaction local value. Pull it from the TransactionImpl object
 public Transaction importTransactionPropagationContext(Object tpc) 
    Import a transaction propagation context into this TM. The TPC is loosely typed, as we may (at a later time) want to import TPCs that come from other transaction domains without offloading the conversion to the client.
  void incCommitCount() 
    Increment the commit count
  void incRollbackCount() 
    Increment the rollback count
  void releaseTransactionImpl(TransactionImpl tx) 
    Release the given TransactionImpl.
 public  void resume(Transaction transaction) throws SystemException, InvalidTransactionException, IllegalStateException 
    Resume a transaction. Note: This will not enlist any resources involved in this transaction. According to JTA1.0.1 specification section 3.2.3, that is the responsibility of the application server.
 public  void rollback() throws SystemException, SecurityException, IllegalStateException 
    Roll back the transaction associated with the currently running thread.
 public  void setDefaultTransactionTimeout(int seconds) 
    Set the default transaction timeout for new transactions. This default value is used if setTransactionTimeout() was never called, or if it was called with a value of 0.
 public  void setRollbackOnly() throws SystemException, IllegalStateException 
    Mark the transaction associated with the currently running thread so that the only possible outcome is a rollback.
 public  void setTransactionTimeout(int seconds) throws SystemException 
    Set the transaction timeout for new transactions started by the calling thread.
 public  void storeValue(TransactionLocal local,
    Transaction tx,
    Object value) 
    put the value in the TransactionImpl map
 public Transaction suspend() throws SystemException 
    Suspend the transaction currently associated with the current thread, and return it. Note: This will not delist any resources involved in this transaction. According to JTA1.0.1 specification section 3.2.3, that is the responsibility of the application server.