org.jboss.tm
Class TxManager

java.lang.Object
  extended by org.jboss.tm.TxManager
All Implemented Interfaces:
javax.resource.spi.XATerminator, TransactionManager, JBossXATerminator, TransactionLocalDelegate, TransactionPropagationContextFactory, TransactionPropagationContextImporter, TransactionTimeoutConfiguration

Deprecated. Do not reference directly, use org.jboss.tm.TransactionManagerLocator

public class TxManager
extends Object
implements TransactionManager, TransactionPropagationContextImporter, TransactionPropagationContextFactory, TransactionLocalDelegate, TransactionTimeoutConfiguration, JBossXATerminator

Our TransactionManager implementation.

Version:
$Revision: 57208 $
Author:
Rickard Öberg, Marc Fleury, Ole Husgaard, Jason Dillon, Francisco Reverbel, Adrian Brock, Dimitris Andreadis

Method Summary
 void associateThread(Transaction transaction)
          Deprecated.  
 void begin()
          Deprecated. Begin a new transaction.
 void cancelWork(javax.resource.spi.work.Work work, Xid xid)
          Deprecated. Invoked when the work fails
 void commit()
          Deprecated. Commit the transaction associated with the currently running thread.
 void commit(Xid xid, boolean onePhase)
          Deprecated.  
 boolean containsValue(TransactionLocal local, Transaction tx)
          Deprecated. does Transaction contain object?
 Transaction disassociateThread()
          Deprecated. The following 2 methods are here to provide association and disassociation of the thread.
 void endWork(javax.resource.spi.work.Work work, Xid xid)
          Deprecated. Invoked when transaction inflow work ends
 void forget(Xid xid)
          Deprecated.  
 long getCommitCount()
          Deprecated. A count of the transactions that have been committed
 int getDefaultTransactionTimeout()
          Deprecated. Get the default transaction timeout.
 boolean getGlobalIdsEnabled()
          Deprecated. Getter for attribute globalIdsEnabled.
static TxManager getInstance()
          Deprecated. Get a reference to the singleton instance.
 long getRollbackCount()
          Deprecated. A count of the transactions that have been rolled back
 int getStatus()
          Deprecated. Return the status of the transaction associated with the currently running thread, or Status.STATUS_NO_TRANSACTION if no active transaction is currently associated.
 long getTimeLeftBeforeTransactionTimeout(boolean errorRollback)
          Deprecated. Get the time left before transaction timeout
 Transaction getTransaction()
          Deprecated. Return the transaction currently associated with the invoking thread, or null if no active transaction is currently associated.
 int getTransactionCount()
          Deprecated. Return the number of active transactions
 TransactionIntegrity getTransactionIntegrity()
          Deprecated. Get the transaction integrity policy
 Object getTransactionPropagationContext()
          Deprecated. Return a TPC for the current transaction.
 Object getTransactionPropagationContext(Transaction tx)
          Deprecated. Return a TPC for the argument transaction.
 int getTransactionTimeout()
          Deprecated. Get the transaction timeout.
 Object getValue(TransactionLocal local, Transaction tx)
          Deprecated. get the transaction local value.
 Transaction importTransactionPropagationContext(Object tpc)
          Deprecated. Import a transaction propagation context into this TM.
 boolean isInterruptThreads()
          Deprecated. Is thread interruption enabled at transaction timeout
 void lock(TransactionLocal local, Transaction tx)
          Deprecated. Lock the transaction local in the context of this transaction
 int prepare(Xid xid)
          Deprecated.  
 Xid[] recover(int flag)
          Deprecated.  
 void registerWork(javax.resource.spi.work.Work work, Xid xid, long timeout)
          Deprecated. Invoked for transaction inflow of work
 void resume(Transaction transaction)
          Deprecated. Resume a transaction.
 void rollback()
          Deprecated. Roll back the transaction associated with the currently running thread.
 void rollback(Xid xid)
          Deprecated.  
 void setDefaultTransactionTimeout(int seconds)
          Deprecated. Set the default transaction timeout for new transactions.
 void setGlobalIdsEnabled(boolean newValue)
          Deprecated. Setter for attribute globalIdsEnabled.
 void setInterruptThreads(boolean interruptThreads)
          Deprecated. Enable/disable thread interruption at transaction timeout.
 void setRollbackOnly()
          Deprecated. Mark the transaction associated with the currently running thread so that the only possible outcome is a rollback.
 void setTransactionIntegrity(TransactionIntegrity integrity)
          Deprecated. Set the transaction integrity policy
 void setTransactionTimeout(int seconds)
          Deprecated. Set the transaction timeout for new transactions started by the calling thread.
 void startWork(javax.resource.spi.work.Work work, Xid xid)
          Deprecated. Invoked for transaction inflow of work
 void storeValue(TransactionLocal local, Transaction tx, Object value)
          Deprecated. put the value in the transaction local
 Transaction suspend()
          Deprecated. Suspend the transaction currently associated with the current thread, and return it.
 void unlock(TransactionLocal local, Transaction tx)
          Deprecated. Unlock the transaction local in the context of this transaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TxManager getInstance()
Deprecated. 
Get a reference to the singleton instance.


setGlobalIdsEnabled

public void setGlobalIdsEnabled(boolean newValue)
Deprecated. 
Setter for attribute globalIdsEnabled.


getGlobalIdsEnabled

public boolean getGlobalIdsEnabled()
Deprecated. 
Getter for attribute globalIdsEnabled.


setInterruptThreads

public void setInterruptThreads(boolean interruptThreads)
Deprecated. 
Enable/disable thread interruption at transaction timeout.

Parameters:
interruptThreads - pass true to interrupt threads, false otherwise

isInterruptThreads

public boolean isInterruptThreads()
Deprecated. 
Is thread interruption enabled at transaction timeout

Returns:
true for interrupt threads, false otherwise

setTransactionIntegrity

public void setTransactionIntegrity(TransactionIntegrity integrity)
Deprecated. 
Set the transaction integrity policy

Parameters:
integrity - the transaction integrity policy

getTransactionIntegrity

public TransactionIntegrity getTransactionIntegrity()
Deprecated. 
Get the transaction integrity policy

Returns:
the transaction integrity policy

begin

public void begin()
           throws NotSupportedException,
                  SystemException
Deprecated. 
Begin a new transaction. The new transaction will be associated with the calling thread.

Specified by:
begin in interface TransactionManager
Throws:
NotSupportedException
SystemException

commit

public void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   IllegalStateException,
                   SystemException
Deprecated. 
Commit the transaction associated with the currently running thread.

Specified by:
commit in interface TransactionManager
Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
IllegalStateException
SystemException

getStatus

public int getStatus()
              throws SystemException
Deprecated. 
Return the status of the transaction associated with the currently running thread, or Status.STATUS_NO_TRANSACTION if no active transaction is currently associated.

Specified by:
getStatus in interface TransactionManager
Throws:
SystemException

getTransaction

public Transaction getTransaction()
                           throws SystemException
Deprecated. 
Return the transaction currently associated with the invoking thread, or null if no active transaction is currently associated.

Specified by:
getTransaction in interface TransactionManager
Throws:
SystemException

resume

public void resume(Transaction transaction)
            throws InvalidTransactionException,
                   IllegalStateException,
                   SystemException
Deprecated. 
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.

Specified by:
resume in interface TransactionManager
Throws:
InvalidTransactionException
IllegalStateException
SystemException

suspend

public Transaction suspend()
                    throws SystemException
Deprecated. 
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.

Specified by:
suspend in interface TransactionManager
Throws:
SystemException

rollback

public void rollback()
              throws IllegalStateException,
                     SecurityException,
                     SystemException
Deprecated. 
Roll back the transaction associated with the currently running thread.

Specified by:
rollback in interface TransactionManager
Throws:
IllegalStateException
SecurityException
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws IllegalStateException,
                            SystemException
Deprecated. 
Mark the transaction associated with the currently running thread so that the only possible outcome is a rollback.

Specified by:
setRollbackOnly in interface TransactionManager
Throws:
IllegalStateException
SystemException

getTransactionTimeout

public int getTransactionTimeout()
Deprecated. 
Description copied from interface: TransactionTimeoutConfiguration
Get the transaction timeout.

Specified by:
getTransactionTimeout in interface TransactionTimeoutConfiguration
Returns:
the timeout in seconds associated with this thread

setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws SystemException
Deprecated. 
Set the transaction timeout for new transactions started by the calling thread.

Specified by:
setTransactionTimeout in interface TransactionManager
Throws:
SystemException

setDefaultTransactionTimeout

public void setDefaultTransactionTimeout(int seconds)
Deprecated. 
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.


getDefaultTransactionTimeout

public int getDefaultTransactionTimeout()
Deprecated. 
Get the default transaction timeout.

Returns:
Default transaction timeout in seconds.

getTimeLeftBeforeTransactionTimeout

public long getTimeLeftBeforeTransactionTimeout(boolean errorRollback)
                                         throws RollbackException
Deprecated. 
Description copied from interface: TransactionTimeoutConfiguration
Get the time left before transaction timeout

Specified by:
getTimeLeftBeforeTransactionTimeout in interface TransactionTimeoutConfiguration
Parameters:
errorRollback - throw an error if the transaction is marked for rollback
Returns:
the remaining in the current transaction or -1 if there is no transaction
Throws:
RollbackException - if the transaction is marked for rollback and errorRollback is true

disassociateThread

public Transaction disassociateThread()
Deprecated. 
The following 2 methods are here to provide association and disassociation of the thread.


associateThread

public void associateThread(Transaction transaction)
Deprecated. 

getTransactionCount

public int getTransactionCount()
Deprecated. 
Return the number of active transactions


getCommitCount

public long getCommitCount()
Deprecated. 
A count of the transactions that have been committed


getRollbackCount

public long getRollbackCount()
Deprecated. 
A count of the transactions that have been rolled back


importTransactionPropagationContext

public Transaction importTransactionPropagationContext(Object tpc)
Deprecated. 
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.

Specified by:
importTransactionPropagationContext in interface TransactionPropagationContextImporter
Parameters:
tpc - The transaction propagation context that we want to import into this TM. Currently this is an instance of LocalId. At some later time this may be an instance of a transaction propagation context from another transaction domain like org.omg.CosTransactions.PropagationContext.
Returns:
A transaction representing this transaction propagation context, or null if this TPC cannot be imported.

getTransactionPropagationContext

public Object getTransactionPropagationContext()
Deprecated. 
Return a TPC for the current transaction.

Specified by:
getTransactionPropagationContext in interface TransactionPropagationContextFactory

getTransactionPropagationContext

public Object getTransactionPropagationContext(Transaction tx)
Deprecated. 
Return a TPC for the argument transaction.

Specified by:
getTransactionPropagationContext in interface TransactionPropagationContextFactory

registerWork

public void registerWork(javax.resource.spi.work.Work work,
                         Xid xid,
                         long timeout)
                  throws javax.resource.spi.work.WorkCompletedException
Deprecated. 
Description copied from interface: JBossXATerminator
Invoked for transaction inflow of work

Specified by:
registerWork in interface JBossXATerminator
Parameters:
work - the work starting
xid - the xid of the work
timeout - the transaction timeout
Throws:
javax.resource.spi.work.WorkCompletedException - with error code WorkException.TX_CONCURRENT_WORK_DISALLOWED when work is already present for the xid or whose completion is in progress, only the global part of the xid must be used for this check.

startWork

public void startWork(javax.resource.spi.work.Work work,
                      Xid xid)
               throws javax.resource.spi.work.WorkCompletedException
Deprecated. 
Description copied from interface: JBossXATerminator
Invoked for transaction inflow of work

Specified by:
startWork in interface JBossXATerminator
Parameters:
work - the work starting
xid - the xid of the work
Throws:
javax.resource.spi.work.WorkCompletedException - with error code WorkException.TX_RECREATE_FAILED if it is unable to recreate the transaction context

endWork

public void endWork(javax.resource.spi.work.Work work,
                    Xid xid)
Deprecated. 
Description copied from interface: JBossXATerminator
Invoked when transaction inflow work ends

Specified by:
endWork in interface JBossXATerminator
Parameters:
work - the work ending
xid - the xid of the work

cancelWork

public void cancelWork(javax.resource.spi.work.Work work,
                       Xid xid)
Deprecated. 
Description copied from interface: JBossXATerminator
Invoked when the work fails

Specified by:
cancelWork in interface JBossXATerminator
Parameters:
work - the work ending
xid - the xid of the work

prepare

public int prepare(Xid xid)
            throws XAException
Deprecated. 
Specified by:
prepare in interface javax.resource.spi.XATerminator
Throws:
XAException

rollback

public void rollback(Xid xid)
              throws XAException
Deprecated. 
Specified by:
rollback in interface javax.resource.spi.XATerminator
Throws:
XAException

commit

public void commit(Xid xid,
                   boolean onePhase)
            throws XAException
Deprecated. 
Specified by:
commit in interface javax.resource.spi.XATerminator
Throws:
XAException

forget

public void forget(Xid xid)
            throws XAException
Deprecated. 
Specified by:
forget in interface javax.resource.spi.XATerminator
Throws:
XAException

recover

public Xid[] recover(int flag)
              throws XAException
Deprecated. 
Specified by:
recover in interface javax.resource.spi.XATerminator
Throws:
XAException

lock

public void lock(TransactionLocal local,
                 Transaction tx)
          throws InterruptedException
Deprecated. 
Description copied from interface: TransactionLocalDelegate
Lock the transaction local in the context of this transaction

Specified by:
lock in interface TransactionLocalDelegate
Throws:
InterruptedException - if the thread is interrupted

unlock

public void unlock(TransactionLocal local,
                   Transaction tx)
Deprecated. 
Description copied from interface: TransactionLocalDelegate
Unlock the transaction local in the context of this transaction

Specified by:
unlock in interface TransactionLocalDelegate

getValue

public Object getValue(TransactionLocal local,
                       Transaction tx)
Deprecated. 
Description copied from interface: TransactionLocalDelegate
get the transaction local value.

Specified by:
getValue in interface TransactionLocalDelegate

storeValue

public void storeValue(TransactionLocal local,
                       Transaction tx,
                       Object value)
Deprecated. 
Description copied from interface: TransactionLocalDelegate
put the value in the transaction local

Specified by:
storeValue in interface TransactionLocalDelegate

containsValue

public boolean containsValue(TransactionLocal local,
                             Transaction tx)
Deprecated. 
Description copied from interface: TransactionLocalDelegate
does Transaction contain object?

Specified by:
containsValue in interface TransactionLocalDelegate


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.