Package bitronix.tm.timer
Class TaskScheduler
java.lang.Object
java.lang.Thread
bitronix.tm.timer.TaskScheduler
Timed tasks service.
- Author:
- lorban
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelPoolShrinking(XAPool xaPool) Cancel the task that will tell a XA pool to close idle connections.voidcancelRecovery(Recoverer recoverer) Cancel the task that will run background recovery at the specified date.voidcancelTransactionTimeout(BitronixTransaction transaction) Cancel the task that will mark the transaction as timed out at the specified date.intGet the amount of tasks currently queued.voidrun()voidschedulePoolShrinking(XAPool xaPool) Schedule a task that will tell a XA pool to close idle connections.voidscheduleRecovery(Recoverer recoverer, Date executionTime) Schedule a task that will run background recovery at the specified date.voidscheduleTransactionTimeout(BitronixTransaction transaction, Date executionTime) Schedule a task that will mark the transaction as timed out at the specified date.voidshutdown()Shutdown the service and free all held resources.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
TaskScheduler
public TaskScheduler()
-
-
Method Details
-
countTasksQueued
public int countTasksQueued()Get the amount of tasks currently queued.- Returns:
- the amount of tasks currently queued.
-
shutdown
public void shutdown()Description copied from interface:ServiceShutdown the service and free all held resources. -
scheduleTransactionTimeout
Schedule a task that will mark the transaction as timed out at the specified date. If this method is called with the same transaction multiple times, the previous timeout date is dropped and replaced by the new one.- Parameters:
transaction- the transaction to mark as timeout.executionTime- the date at which the transaction must be marked.
-
cancelTransactionTimeout
Cancel the task that will mark the transaction as timed out at the specified date.- Parameters:
transaction- the transaction to mark as timeout.
-
scheduleRecovery
Schedule a task that will run background recovery at the specified date.- Parameters:
recoverer- the recovery implementation to use.executionTime- the date at which the transaction must be marked.
-
cancelRecovery
Cancel the task that will run background recovery at the specified date.- Parameters:
recoverer- the recovery implementation to use.
-
schedulePoolShrinking
Schedule a task that will tell a XA pool to close idle connections. The execution time will be provided by the XA pool itself via theXAPool.getNextShrinkDate().- Parameters:
xaPool- the XA pool to notify.
-
cancelPoolShrinking
Cancel the task that will tell a XA pool to close idle connections.- Parameters:
xaPool- the XA pool to notify.
-
run
public void run()
-