|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arjuna.ats.arjuna.coordinator.TransactionReaper
public class TransactionReaper
Class to record transactions with non-zero timeout values, and class to implement a transaction reaper thread which terminates these transactions once their timeout elapses.
Field Summary | |
---|---|
static long |
defaultCancelFailWaitPeriod
|
static long |
defaultCancelWaitPeriod
|
static long |
defaultCheckPeriod
|
static int |
defaultZombieMax
|
static java.lang.String |
DYNAMIC
|
static java.lang.String |
NORMAL
|
static java.lang.String |
PERIODIC
|
Constructor Summary | |
---|---|
TransactionReaper(long checkPeriod)
|
Method Summary | |
---|---|
void |
addListener(ReaperMonitor listener)
|
boolean |
check()
process all entries in the timeout queue which have expired. |
long |
checkingPeriod()
|
static TransactionReaper |
create()
|
static TransactionReaper |
create(long checkPeriod)
Currently we let the reaper thread run at same priority as other threads. |
void |
doCancellations()
|
long |
getRemainingTimeoutMills(java.lang.Object control)
Given the transaction instance, this will return the time left before the transaction is automatically rolled back if it has not been terminated. |
int |
getTimeout(java.lang.Object control)
Given a Control, return the associated timeout, or 0 if we do not know about it. |
boolean |
insert(Reapable control,
int timeout)
timeout is given in seconds, but we work in milliseconds. |
static boolean |
isDynamic()
|
long |
numberOfTimeouts()
Return the number of timeouts registered. |
long |
numberOfTransactions()
|
boolean |
remove(java.lang.Object control)
|
boolean |
removeListener(ReaperMonitor listener)
|
boolean |
synchronousRemove(java.lang.Object control)
|
static void |
terminate(boolean waitForTransactions)
Terminate the transaction reaper. |
static long |
transactionLifetime()
|
static TransactionReaper |
transactionReaper()
|
static TransactionReaper |
transactionReaper(boolean createReaper)
|
void |
waitForCancellations()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NORMAL
public static final java.lang.String DYNAMIC
public static final java.lang.String PERIODIC
public static final long defaultCheckPeriod
public static final long defaultCancelWaitPeriod
public static final long defaultCancelFailWaitPeriod
public static final int defaultZombieMax
Constructor Detail |
---|
public TransactionReaper(long checkPeriod)
Method Detail |
---|
public final long checkingPeriod()
public final boolean check()
public final void waitForCancellations()
public final void doCancellations()
public final long numberOfTransactions()
public final long numberOfTimeouts()
public final void addListener(ReaperMonitor listener)
public final boolean removeListener(ReaperMonitor listener)
public final boolean insert(Reapable control, int timeout)
public final boolean remove(java.lang.Object control)
public final boolean synchronousRemove(java.lang.Object control)
public final long getRemainingTimeoutMills(java.lang.Object control)
control
-
public final int getTimeout(java.lang.Object control)
public static TransactionReaper create(long checkPeriod)
public static TransactionReaper create()
public static TransactionReaper transactionReaper()
public static TransactionReaper transactionReaper(boolean createReaper)
public static void terminate(boolean waitForTransactions)
waitForTransactions
- if true
then the reaper will
wait until all transactions have terminated (or been terminated by it).
If false
then the reaper will call setRollbackOnly on all
the transactions.public static boolean isDynamic()
public static final long transactionLifetime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |