public class TransactionReaper extends Object
Modifier and Type | Field and Description |
---|---|
static long |
defaultCancelFailWaitPeriod |
static long |
defaultCancelWaitPeriod |
static long |
defaultCheckPeriod |
static int |
defaultZombieMax |
static String |
DYNAMIC |
static String |
NORMAL |
static String |
PERIODIC |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ReaperMonitor listener) |
void |
check()
process all entries in the timeout queue which have
expired.
|
long |
checkingPeriod() |
void |
doCancellations() |
long |
getRemainingTimeoutMills(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(Object control)
Given a Control, return the associated timeout, or 0 if we do not know
about it.
|
void |
insert(Reapable control,
int timeout)
timeout is given in seconds, but we work in milliseconds.
|
static void |
instantiate()
Currently we let the reaper thread run at same priority as other threads.
|
static boolean |
isDynamic() |
long |
numberOfTimeouts()
Return the number of timeouts registered.
|
long |
numberOfTransactions() |
void |
remove(Object control) |
boolean |
removeListener(ReaperMonitor listener) |
static void |
terminate(boolean waitForTransactions)
Terminate the transaction reaper.
|
static long |
transactionLifetime() |
static TransactionReaper |
transactionReaper()
Starting with 4.8, this method will always return an instance, will never return null.
|
void |
waitForCancellations() |
public static final String NORMAL
public static final String DYNAMIC
public static final String PERIODIC
public static final long defaultCheckPeriod
public static final long defaultCancelWaitPeriod
public static final long defaultCancelFailWaitPeriod
public static final int defaultZombieMax
public final long checkingPeriod()
public final void 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 void insert(Reapable control, int timeout)
public final void remove(Object control)
public final long getRemainingTimeoutMills(Object control)
control
- public final int getTimeout(Object control)
public static void instantiate()
public static TransactionReaper transactionReaper()
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 long transactionLifetime()
Copyright © 2016 JBoss by Red Hat. All rights reserved.