public class TimerQueue extends WorkerQueue
TimerTasks that have been
scheduled. A similar class is present in java.util package of jdk version >= 1.3; for compatibility with jdk 1.2 it is reimplemented here.
TimerTask| Modifier and Type | Class and Description |
|---|---|
protected class |
TimerQueue.TimerTaskLoop
Class that loops getting the next job to be executed and then
executing it, in the timer task thread.
|
WorkerQueue.QueueLoopm_queueThread| Constructor and Description |
|---|
TimerQueue()
Creates a new timer queue with default thread name of "TimerTask Thread"
|
TimerQueue(String threadName)
Creates a new timer queue with the specified thread name
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
clear()
Clears the running thread after the queue has been stopped.
|
protected Runnable |
createQueueLoop()
Creates the loop that will get the next job and process it.
|
protected Executable |
getJobImpl()
Never call this method, only override in subclasses to perform
job getting in a specific way, normally tied to the data structure
holding the jobs.
|
protected void |
putJobImpl(Executable task)
Never call this method, only override in subclasses to perform
job adding in a specific way, normally tied to the data structure
holding the jobs.
|
void |
schedule(TimerTask t)
Schedules the given TimerTask for immediate execution.
|
void |
schedule(TimerTask t,
long delay)
Schedule the given TimerTask to be executed after
delay
milliseconds. |
getJob, isInterrupted, putJob, start, stoppublic TimerQueue()
public TimerQueue(String threadName)
threadName - public void schedule(TimerTask t)
t - public void schedule(TimerTask t, long delay)
delay
milliseconds.t - delay - protected void putJobImpl(Executable task)
WorkerQueueputJobImpl in class WorkerQueueprotected Executable getJobImpl() throws InterruptedException
WorkerQueuegetJobImpl in class WorkerQueueInterruptedExceptionprotected Runnable createQueueLoop()
WorkerQueuecreateQueueLoop in class WorkerQueueprotected void clear()
WorkerQueueclear in class WorkerQueueCopyright © 2015 JBoss by Red Hat. All rights reserved.