Public Member Functions | |
BACITimer (ThreadFactory threadFactory) | |
Object | executeAt (Date date, TimerRunnable command) |
Object | executeAfterDelay (long millisecondsToDelay, TimerRunnable command) |
Object | executePeriodically (long period, TimerRunnable command, long firstTime) |
synchronized Thread | getThread () |
synchronized void | shutDown () |
Static Public Member Functions | |
void | cancel (Object taskID) |
Protected Member Functions | |
synchronized void | clearThread () |
synchronized void | restart () |
synchronized TaskNode | nextTask () |
Protected Attributes | |
final Heap | heap_ = new Heap(64) |
final ThreadFactory | threadFactory_ |
volatile boolean | shutdown_ = false |
Thread | thread_ |
final RunLoop | runLoop_ |
EDU.oswego.cs.dl.util.concurrent
(it was not approriate for BACI usage). Timer tasks should complete quickly. If a timer task takes excessive time to complete, it "hogs" the timer's task execution thread. This can, in turn, delay the execution of subsequent tasks, which may "bunch up" and execute in rapid succession when (and if) the offending task finally completes.
|
Constructor.
|
|
Cancel a scheduled task that has not yet been run. The task will be cancelled upon the next opportunity to run it. This has no effect if this is a one-shot task that has already executed. Also, if an execution is in progress, it will complete normally. (It may however be interrupted via getThread().interrupt()). But if it is a periodic task, future iterations are cancelled.
|
|
set thread_ to null to indicate termination * |
|
Excecute the given command after waiting for the given delay.
|
|
Execute the given command at the given time.
|
|
Execute the given command every
|
|
Return the thread being used to process commands, or null if there is no such thread. You can use this to invoke any special methods on the thread, for example, to interrupt it. |
|
Return the next task to execute, or null if thread is interrupted * |
|
Start (or restart) a thread to process commands, or wake up an existing thread if one is already running. This method can be invoked if the background thread crashed due to an unrecoverable exception in an executed command. |
|
Cancel all tasks and interrupt the background thread executing the current task, if any. A new background thread will be started if new execution requests are encountered. If the currently executing task does not repsond to interrupts, the current thread may persist, even if a new thread is started via restart(). |
|
tasks are maintained in a standard priority queue * |
|
|
|
shutdown status flag * |
|
The thread used to process commands * |
|
thread factory, can be null * |