Package com.arjuna.ats.jbossatx
Class BaseTransactionManagerDelegate
- java.lang.Object
-
- com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate
-
- All Implemented Interfaces:
javax.transaction.TransactionManager,org.jboss.tm.listener.TransactionListenerRegistry,org.jboss.tm.TransactionLocalDelegate,org.jboss.tm.TransactionTimeoutConfiguration
- Direct Known Subclasses:
TransactionManagerDelegate,TransactionManagerDelegate
public abstract class BaseTransactionManagerDelegate extends java.lang.Object implements javax.transaction.TransactionManager, org.jboss.tm.TransactionLocalDelegate, org.jboss.tm.TransactionTimeoutConfiguration, org.jboss.tm.listener.TransactionListenerRegistryDelegate for JBoss TransactionManager/TransactionLocalDelegate.- Author:
- kevin
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseTransactionManagerDelegate(javax.transaction.TransactionManager transactionManager)Construct the delegate using the specified transaction manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(javax.transaction.Transaction transaction, org.jboss.tm.listener.TransactionListener listener, java.util.EnumSet<org.jboss.tm.listener.EventType> types)register a listener for transaction related events that effect the current threadvoidbegin()Begin a transaction and associate it with the current thread.voidcommit()Commit the current transaction and disassociate from the thread.booleancontainsValue(org.jboss.tm.TransactionLocal transactionLocal, javax.transaction.Transaction transaction)Does the specified transaction contain a value for the transaction local.intgetStatus()Get the transaction status.javax.transaction.TransactiongetTransaction()Get the transaction associated with the thread.java.lang.ObjectgetValue(org.jboss.tm.TransactionLocal transactionLocal, javax.transaction.Transaction transaction)Get value of the transaction local in the specified transaction.voidlock(org.jboss.tm.TransactionLocal local, javax.transaction.Transaction transaction)Lock the transaction local in the context of this transaction.voidresume(javax.transaction.Transaction transaction)Resume the specified transaction.voidrollback()Rollback the current transaction and disassociate from the thread.voidsetRollbackOnly()Set rollback only on the current transaction.voidsetTransactionTimeout(int timeout)Set the transaction timeout on the current thread.voidstoreValue(org.jboss.tm.TransactionLocal transactionLocal, javax.transaction.Transaction transaction, java.lang.Object value)Store the value of the transaction local in the specified transaction.javax.transaction.Transactionsuspend()Suspend the current transaction.voidunlock(org.jboss.tm.TransactionLocal local, javax.transaction.Transaction transaction)Unlock the transaction local in the context of this transaction
-
-
-
Method Detail
-
begin
public void begin() throws javax.transaction.NotSupportedException, javax.transaction.SystemExceptionBegin a transaction and associate it with the current thread.- Specified by:
beginin interfacejavax.transaction.TransactionManager- Throws:
javax.transaction.NotSupportedExceptionjavax.transaction.SystemException
-
commit
public void commit() throws javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, java.lang.IllegalStateException, javax.transaction.SystemExceptionCommit the current transaction and disassociate from the thread.- Specified by:
commitin interfacejavax.transaction.TransactionManager- Throws:
javax.transaction.RollbackExceptionjavax.transaction.HeuristicMixedExceptionjavax.transaction.HeuristicRollbackExceptionjava.lang.SecurityExceptionjava.lang.IllegalStateExceptionjavax.transaction.SystemException
-
getStatus
public int getStatus() throws javax.transaction.SystemExceptionGet the transaction status.- Specified by:
getStatusin interfacejavax.transaction.TransactionManager- Returns:
- the transaction status.
- Throws:
javax.transaction.SystemException
-
getTransaction
public javax.transaction.Transaction getTransaction() throws javax.transaction.SystemExceptionGet the transaction associated with the thread.- Specified by:
getTransactionin interfacejavax.transaction.TransactionManager- Returns:
- the transaction or null if none associated.
- Throws:
javax.transaction.SystemException
-
resume
public void resume(javax.transaction.Transaction transaction) throws javax.transaction.InvalidTransactionException, java.lang.IllegalStateException, javax.transaction.SystemExceptionResume the specified transaction.- Specified by:
resumein interfacejavax.transaction.TransactionManager- Parameters:
transaction- The transaction to resume.- Throws:
javax.transaction.InvalidTransactionExceptionjava.lang.IllegalStateExceptionjavax.transaction.SystemException
-
rollback
public void rollback() throws java.lang.IllegalStateException, java.lang.SecurityException, javax.transaction.SystemExceptionRollback the current transaction and disassociate from the thread.- Specified by:
rollbackin interfacejavax.transaction.TransactionManager- Throws:
java.lang.IllegalStateExceptionjava.lang.SecurityExceptionjavax.transaction.SystemException
-
setRollbackOnly
public void setRollbackOnly() throws java.lang.IllegalStateException, javax.transaction.SystemExceptionSet rollback only on the current transaction.- Specified by:
setRollbackOnlyin interfacejavax.transaction.TransactionManager- Throws:
java.lang.IllegalStateExceptionjavax.transaction.SystemException
-
setTransactionTimeout
public void setTransactionTimeout(int timeout) throws javax.transaction.SystemExceptionSet the transaction timeout on the current thread.- Specified by:
setTransactionTimeoutin interfacejavax.transaction.TransactionManager- Parameters:
timeout- The transaction timeout.- Throws:
javax.transaction.SystemException
-
addListener
public void addListener(javax.transaction.Transaction transaction, org.jboss.tm.listener.TransactionListener listener, java.util.EnumSet<org.jboss.tm.listener.EventType> types) throws org.jboss.tm.listener.TransactionTypeNotSupportedregister a listener for transaction related events that effect the current thread- Specified by:
addListenerin interfaceorg.jboss.tm.listener.TransactionListenerRegistry- Parameters:
listener- the callback for event notifications- Throws:
org.jboss.tm.listener.TransactionTypeNotSupported
-
suspend
public javax.transaction.Transaction suspend() throws javax.transaction.SystemExceptionSuspend the current transaction.- Specified by:
suspendin interfacejavax.transaction.TransactionManager- Returns:
- The suspended transaction.
- Throws:
javax.transaction.SystemException
-
containsValue
public boolean containsValue(org.jboss.tm.TransactionLocal transactionLocal, javax.transaction.Transaction transaction)Does the specified transaction contain a value for the transaction local.- Specified by:
containsValuein interfaceorg.jboss.tm.TransactionLocalDelegate- Parameters:
transactionLocal- The associated transaction local.transaction- The associated transaction.- Returns:
- true if a value exists within the specified transaction, false otherwise.
-
getValue
public java.lang.Object getValue(org.jboss.tm.TransactionLocal transactionLocal, javax.transaction.Transaction transaction)Get value of the transaction local in the specified transaction.- Specified by:
getValuein interfaceorg.jboss.tm.TransactionLocalDelegate- Parameters:
transactionLocal- The associated transaction local.transaction- The associated transaction.- Returns:
- The value of the transaction local.
-
storeValue
public void storeValue(org.jboss.tm.TransactionLocal transactionLocal, javax.transaction.Transaction transaction, java.lang.Object value)Store the value of the transaction local in the specified transaction.- Specified by:
storeValuein interfaceorg.jboss.tm.TransactionLocalDelegate- Parameters:
transactionLocal- The associated transaction local.transaction- The associated transaction.value- The value of the transaction local.
-
lock
public void lock(org.jboss.tm.TransactionLocal local, javax.transaction.Transaction transaction) throws java.lang.InterruptedExceptionLock the transaction local in the context of this transaction.- Specified by:
lockin interfaceorg.jboss.tm.TransactionLocalDelegate- Throws:
java.lang.IllegalStateException- if the transaction is not activejava.lang.InterruptedException- if the thread is interrupted
-
unlock
public void unlock(org.jboss.tm.TransactionLocal local, javax.transaction.Transaction transaction)Unlock the transaction local in the context of this transaction- Specified by:
unlockin interfaceorg.jboss.tm.TransactionLocalDelegate
-
-