public class XAConsumerThread extends ConsumerThread
XAConsumerThread is a thread which will perform XA processing
of messages
| Modifier and Type | Field and Description |
|---|---|
private static org.apache.commons.logging.Log |
log
Logger
|
private javax.transaction.Transaction |
transaction |
private javax.transaction.TransactionManager |
transctionManager |
| Constructor and Description |
|---|
XAConsumerThread() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancelTransaction()
Strategy method to represent the code required to cancel
a transaction.
|
protected void |
commitTransaction()
Strategy method to represent the code required to commit
a transaction.
|
protected javax.transaction.TransactionManager |
createTransactionManager()
Factory method to create a TransactionManager via some mechanism.
|
protected void |
delist(javax.transaction.Transaction transaction,
int flag)
Delists any resources from the current transaction.
|
protected void |
enlist(javax.transaction.Transaction transaction)
Enlists any resources with the current transaction.
|
javax.transaction.TransactionManager |
getTransactionManager() |
protected XACapable |
getXACapable(Messenger messenger) |
protected void |
rollbackTransaction()
Strategy method to represent the code required to rollback
a transaction.
|
void |
setTransactionManager(javax.transaction.TransactionManager transctionManager)
Sets the transaction manager to be used
|
protected void |
startTransaction()
Strategy method to represent the code required to start
a transaction.
|
createConsumer, getConsumer, getDestination, getListener, getMessenger, getSelector, isShouldStop, processMessage, rollbackTransaction, run, setDestination, setListener, setMessenger, setSelector, setShouldStop, startConsumer, stopConsumeractiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate static final org.apache.commons.logging.Log log
private javax.transaction.TransactionManager transctionManager
private javax.transaction.Transaction transaction
public javax.transaction.TransactionManager getTransactionManager()
throws javax.transaction.SystemException
javax.transaction.SystemExceptionpublic void setTransactionManager(javax.transaction.TransactionManager transctionManager)
transctionManager - the transaction manager to be usedprotected javax.transaction.TransactionManager createTransactionManager()
throws javax.transaction.SystemException
javax.transaction.SystemExceptionprotected void enlist(javax.transaction.Transaction transaction)
throws java.lang.Exception
transaction - the transaction to enlist resources withjava.lang.Exception - if the enlistment fails for whatever reasonprotected void delist(javax.transaction.Transaction transaction,
int flag)
throws java.lang.Exception
transaction - flag - is the flag used by JTA when delisting resources.
It is either XAResource.TMSUCCESS, XAResource.TMSUSPEND, or XAResource.TMFAILjava.lang.Exceptionprotected void startTransaction()
throws java.lang.Exception
startTransaction in class ConsumerThreadjava.lang.Exceptionprotected void commitTransaction()
throws java.lang.Exception
commitTransaction in class ConsumerThreadjava.lang.Exceptionprotected void rollbackTransaction()
throws java.lang.Exception
java.lang.Exceptionprotected void cancelTransaction()
throws java.lang.Exception
cancelTransaction in class ConsumerThreadjava.lang.Exception