|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.tm.TxManager
Our TransactionManager implementation.
Method Summary | |
void |
associateThread(Transaction (src) transaction)
|
void |
begin()
Begin a new transaction. |
void |
cancelWork(Work (src) work,
Xid (src) xid)
Invoked when the work fails |
void |
commit()
Commit the transaction associated with the currently running thread. |
void |
commit(Xid (src) xid,
boolean onePhase)
Commit the transaction |
boolean |
containsValue(TransactionLocal (src) local,
Transaction (src) tx)
does TransactionImpl contain object? |
Transaction (src) |
disassociateThread()
The following 2 methods are here to provide association and disassociation of the thread. |
void |
endWork(Work (src) work,
Xid (src) xid)
Invoked when transaction inflow work ends |
void |
forget(Xid (src) xid)
Forget the transaction |
long |
getCommitCount()
A count of the transactions that have been committed |
int |
getDefaultTransactionTimeout()
Get the default transaction timeout. |
boolean |
getGlobalIdsEnabled()
Getter for attribute globalIdsEnabled . |
static TxManager (src) |
getInstance()
Get a reference to the singleton instance. |
long |
getRollbackCount()
A count of the transactions that have been rolled back |
int |
getStatus()
Return the status of the transaction associated with the currently running thread, or Status.STATUS_NO_TRANSACTION if no
active transaction is currently associated. |
Transaction (src) |
getTransaction()
Return the transaction currently associated with the invoking thread, or null if no active transaction is currently associated. |
int |
getTransactionCount()
Return the number of active transactions |
java.lang.Object |
getTransactionPropagationContext()
Return a TPC for the current transaction. |
java.lang.Object |
getTransactionPropagationContext(Transaction (src) tx)
Return a TPC for the argument transaction. |
int |
getTransactionTimeout()
Get the transaction timeout. |
java.lang.Object |
getValue(TransactionLocal (src) local,
Transaction (src) tx)
get the transaction local value. |
Transaction (src) |
importTransactionPropagationContext(java.lang.Object tpc)
Import a transaction propagation context into this TM. |
boolean |
isInterruptThreads()
Is thread interruption enabled at transaction timeout |
int |
prepare(Xid (src) xid)
Prepare the transaction |
Xid (src) [] |
recover(int flag)
Retrieve xids that are recoverable |
void |
registerWork(Work (src) work,
Xid (src) xid,
long timeout)
Invoked for transaction inflow of work |
void |
resume(Transaction (src) transaction)
Resume a transaction. |
void |
rollback()
Roll back the transaction associated with the currently running thread. |
void |
rollback(Xid (src) xid)
Rollback the transaction |
void |
setDefaultTransactionTimeout(int seconds)
Set the default transaction timeout for new transactions. |
void |
setGlobalIdsEnabled(boolean newValue)
Setter for attribute globalIdsEnabled . |
void |
setInterruptThreads(boolean interruptThreads)
Enable/disable thread interruption at transaction timeout. |
void |
setRollbackOnly()
Mark the transaction associated with the currently running thread so that the only possible outcome is a rollback. |
void |
setTransactionTimeout(int seconds)
Set the transaction timeout for new transactions started by the calling thread. |
void |
startWork(Work (src) work,
Xid (src) xid)
Invoked for transaction inflow of work |
void |
storeValue(TransactionLocal (src) local,
Transaction (src) tx,
java.lang.Object value)
put the value in the TransactionImpl map |
Transaction (src) |
suspend()
Suspend the transaction currently associated with the current thread, and return it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static TxManager (src) getInstance()
public void setGlobalIdsEnabled(boolean newValue)
globalIdsEnabled
.
public boolean getGlobalIdsEnabled()
globalIdsEnabled
.
public void setInterruptThreads(boolean interruptThreads)
interruptThreads
- pass true to interrupt threads, false otherwisepublic boolean isInterruptThreads()
public void begin() throws NotSupportedException (src) , SystemException (src)
begin
in interface TransactionManager (src)
NotSupportedException (src)
- If the calling thread is already
associated with a transaction, and nested transactions are
not supported.
SystemException (src)
- If the transaction service fails in an
unexpected way.public void commit() throws RollbackException (src) , HeuristicMixedException (src) , HeuristicRollbackException (src) , java.lang.SecurityException, java.lang.IllegalStateException, SystemException (src)
commit
in interface TransactionManager (src)
java.lang.SecurityException
- If the caller is not allowed to commit this
transaction.
SystemException (src)
- If the transaction service fails in an
unexpected way.
RollbackException (src)
- If the transaction was marked for rollback
only, the transaction is rolled back and this exception is
thrown.
HeuristicMixedException (src)
- If a heuristic decision was made and
some some parts of the transaction have been committed while
other parts have been rolled back.
java.lang.IllegalStateException
- If the calling thread is not associated
with a transaction.
HeuristicRollbackException (src)
- If a heuristic decision to roll
back the transaction was made.public int getStatus() throws SystemException (src)
Status.STATUS_NO_TRANSACTION
if no
active transaction is currently associated.
getStatus
in interface TransactionManager (src)
Status
(src) constants. If no transaction is associated
with the calling thread,
Status.STATUS_NO_TRANSACTION
is returned.
SystemException (src)
- If the transaction service fails in an
unexpected way.public Transaction (src) getTransaction() throws SystemException (src)
null
if no active transaction is currently associated.
getTransaction
in interface TransactionManager (src)
null
if the calling thread is not associated
with a transaction.
SystemException (src)
- If the transaction service fails in an
unexpected way.public void resume(Transaction (src) transaction) throws InvalidTransactionException (src) , java.lang.IllegalStateException, SystemException (src)
resume
in interface TransactionManager (src)
transaction
- The transaction to be associated with the calling thread.
java.lang.IllegalStateException
- If the calling thread is already
associated with a transaction.
SystemException (src)
- If the transaction service fails in an
unexpected way.
InvalidTransactionException (src)
- If the argument does not represent
a valid transaction.public Transaction (src) suspend() throws SystemException (src)
suspend
in interface TransactionManager (src)
null
if the calling thread was not associated
with a transaction.
SystemException (src)
- If the transaction service fails in an
unexpected way.public void rollback() throws java.lang.IllegalStateException, java.lang.SecurityException, SystemException (src)
rollback
in interface TransactionManager (src)
SystemException (src)
- If the transaction service fails in an
unexpected way.
java.lang.IllegalStateException
- If the transaction is in a state
where it cannot be rolled back. This could be because the
calling thread is not associated with a transaction, or
because it is in the
prepared state
.
java.lang.SecurityException
- If the caller is not allowed to roll back
this transaction.public void setRollbackOnly() throws java.lang.IllegalStateException, SystemException (src)
setRollbackOnly
in interface TransactionManager (src)
SystemException (src)
- If the transaction service fails in an
unexpected way.
java.lang.IllegalStateException
- If the transaction is in a state
where it cannot be rolled back. This could be because the
calling thread is not associated with a transaction, or
because it is in the
prepared state
.public int getTransactionTimeout()
TransactionTimeoutConfiguration (src)
getTransactionTimeout
in interface TransactionTimeoutConfiguration (src)
public void setTransactionTimeout(int seconds) throws SystemException (src)
setTransactionTimeout
in interface TransactionManager (src)
seconds
- The new timeout value, in seconds. If this parameter
is 0
, the timeout value is reset to the default
value.
SystemException (src)
- If the transaction service fails in an
unexpected way.public void setDefaultTransactionTimeout(int seconds)
setTransactionTimeout()
was never called, or if it was called with a value of 0
.
public int getDefaultTransactionTimeout()
public Transaction (src) disassociateThread()
public void associateThread(Transaction (src) transaction)
public int getTransactionCount()
public long getCommitCount()
public long getRollbackCount()
public Transaction (src) importTransactionPropagationContext(java.lang.Object tpc)
importTransactionPropagationContext
in interface TransactionPropagationContextImporter (src)
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.
public java.lang.Object getTransactionPropagationContext()
getTransactionPropagationContext
in interface TransactionPropagationContextFactory (src)
public java.lang.Object getTransactionPropagationContext(Transaction (src) tx)
getTransactionPropagationContext
in interface TransactionPropagationContextFactory (src)
public void registerWork(Work (src) work, Xid (src) xid, long timeout) throws WorkCompletedException (src)
JBossXATerminator (src)
registerWork
in interface JBossXATerminator (src)
work
- the work startingxid
- the xid of the worktimeout
- the transaction timeout
WorkCompletedException (src)
- 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.public void startWork(Work (src) work, Xid (src) xid) throws WorkCompletedException (src)
JBossXATerminator (src)
startWork
in interface JBossXATerminator (src)
work
- the work startingxid
- the xid of the work
WorkCompletedException (src)
- with error code WorkException.TX_RECREATE_FAILED if it is unable to recreate the transaction contextpublic void endWork(Work (src) work, Xid (src) xid)
JBossXATerminator (src)
endWork
in interface JBossXATerminator (src)
work
- the work endingxid
- the xid of the workpublic void cancelWork(Work (src) work, Xid (src) xid)
JBossXATerminator (src)
cancelWork
in interface JBossXATerminator (src)
work
- the work endingxid
- the xid of the workpublic int prepare(Xid (src) xid) throws XAException (src)
XATerminator (src)
prepare
in interface XATerminator (src)
xid
- the xid
XAException (src)
- for an errorpublic void rollback(Xid (src) xid) throws XAException (src)
XATerminator (src)
rollback
in interface XATerminator (src)
xid
- the xid
XAException (src)
- for an errorpublic void commit(Xid (src) xid, boolean onePhase) throws XAException (src)
XATerminator (src)
commit
in interface XATerminator (src)
xid
- the xidonePhase
- true for one phase commit, false for two phase
XAException (src)
- for an errorpublic void forget(Xid (src) xid) throws XAException (src)
XATerminator (src)
forget
in interface XATerminator (src)
xid
- the xid
XAException (src)
- for an errorpublic Xid (src) [] recover(int flag) throws XAException (src)
XATerminator (src)
recover
in interface XATerminator (src)
flag
- the recovery option
XAException (src)
- for an errorpublic java.lang.Object getValue(TransactionLocal (src) local, Transaction (src) tx)
getValue
in interface TransactionLocalDelegate (src)
public void storeValue(TransactionLocal (src) local, Transaction (src) tx, java.lang.Object value)
storeValue
in interface TransactionLocalDelegate (src)
public boolean containsValue(TransactionLocal (src) local, Transaction (src) tx)
containsValue
in interface TransactionLocalDelegate (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |