public abstract class BaseTransactionManagerDelegate extends Object implements TransactionManager, org.jboss.tm.TransactionLocalDelegate, org.jboss.tm.TransactionTimeoutConfiguration, org.jboss.tm.listener.TransactionListenerRegistry
Modifier | Constructor and Description |
---|---|
protected |
BaseTransactionManagerDelegate(TransactionManager transactionManager)
Construct the delegate using the specified transaction manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(Transaction transaction,
org.jboss.tm.listener.TransactionListener listener,
EnumSet<org.jboss.tm.listener.EventType> types)
register a listener for transaction related events that effect the current thread
|
void |
begin()
Begin a transaction and associate it with the current thread.
|
void |
commit()
Commit the current transaction and disassociate from the thread.
|
boolean |
containsValue(org.jboss.tm.TransactionLocal transactionLocal,
Transaction transaction)
Does the specified transaction contain a value for the transaction local.
|
int |
getStatus()
Get the transaction status.
|
Transaction |
getTransaction()
Get the transaction associated with the thread.
|
Object |
getValue(org.jboss.tm.TransactionLocal transactionLocal,
Transaction transaction)
Get value of the transaction local in the specified transaction.
|
void |
lock(org.jboss.tm.TransactionLocal local,
Transaction transaction)
Lock the transaction local in the context of this transaction.
|
void |
resume(Transaction transaction)
Resume the specified transaction.
|
void |
rollback()
Rollback the current transaction and disassociate from the thread.
|
void |
setRollbackOnly()
Set rollback only on the current transaction.
|
void |
setTransactionTimeout(int timeout)
Set the transaction timeout on the current thread.
|
void |
storeValue(org.jboss.tm.TransactionLocal transactionLocal,
Transaction transaction,
Object value)
Store the value of the transaction local in the specified transaction.
|
Transaction |
suspend()
Suspend the current transaction.
|
void |
unlock(org.jboss.tm.TransactionLocal local,
Transaction transaction)
Unlock the transaction local in the context of this transaction
|
protected BaseTransactionManagerDelegate(TransactionManager transactionManager)
transactionManager
- The delegate transaction manager.public void begin() throws NotSupportedException, SystemException
begin
in interface TransactionManager
NotSupportedException
SystemException
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
commit
in interface TransactionManager
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
IllegalStateException
SystemException
public int getStatus() throws SystemException
getStatus
in interface TransactionManager
SystemException
public Transaction getTransaction() throws SystemException
getTransaction
in interface TransactionManager
SystemException
public void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemException
resume
in interface TransactionManager
transaction
- The transaction to resume.InvalidTransactionException
IllegalStateException
SystemException
public void rollback() throws IllegalStateException, SecurityException, SystemException
rollback
in interface TransactionManager
IllegalStateException
SecurityException
SystemException
public void setRollbackOnly() throws IllegalStateException, SystemException
setRollbackOnly
in interface TransactionManager
IllegalStateException
SystemException
public void setTransactionTimeout(int timeout) throws SystemException
setTransactionTimeout
in interface TransactionManager
timeout
- The transaction timeout.SystemException
public void addListener(Transaction transaction, org.jboss.tm.listener.TransactionListener listener, EnumSet<org.jboss.tm.listener.EventType> types) throws org.jboss.tm.listener.TransactionTypeNotSupported
addListener
in interface org.jboss.tm.listener.TransactionListenerRegistry
listener
- the callback for event notificationsorg.jboss.tm.listener.TransactionTypeNotSupported
public Transaction suspend() throws SystemException
suspend
in interface TransactionManager
SystemException
public boolean containsValue(org.jboss.tm.TransactionLocal transactionLocal, Transaction transaction)
containsValue
in interface org.jboss.tm.TransactionLocalDelegate
transactionLocal
- The associated transaction local.transaction
- The associated transaction.public Object getValue(org.jboss.tm.TransactionLocal transactionLocal, Transaction transaction)
getValue
in interface org.jboss.tm.TransactionLocalDelegate
transactionLocal
- The associated transaction local.transaction
- The associated transaction.public void storeValue(org.jboss.tm.TransactionLocal transactionLocal, Transaction transaction, Object value)
storeValue
in interface org.jboss.tm.TransactionLocalDelegate
transactionLocal
- The associated transaction local.transaction
- The associated transaction.value
- The value of the transaction local.public void lock(org.jboss.tm.TransactionLocal local, Transaction transaction) throws InterruptedException
lock
in interface org.jboss.tm.TransactionLocalDelegate
IllegalStateException
- if the transaction is not activeInterruptedException
- if the thread is interruptedpublic void unlock(org.jboss.tm.TransactionLocal local, Transaction transaction)
unlock
in interface org.jboss.tm.TransactionLocalDelegate
Copyright © 2021 JBoss by Red Hat. All rights reserved.