![]() |
Quadcap Embeddable Server |
Inheritance diagram for com.quadcap.util.threads.PeriodicScheduler:

Each task is a Command object, as used by e.g., StreamWorker.
Two flavors of this class are expressed here -- the first class takes a Stream parameter. When each task becomes ready, the Command object is written to the Stream, and it is presumed that a StreamWorker task will be sitting at the other end of the Stream, executing the Commands that come down the pipe.
The other flavor of this class takes a context argument, which can be any Java object (i.e., this class doesn't ever look at the context.) When each task becomes ready, it is simply executed within the PeriodicScheduler thread.
Definition at line 76 of file PeriodicScheduler.java.
Public Member Functions | |
| PeriodicScheduler (ThreadGroup group, String name, Object obj) | |
| Construct a new PeriodicScheduler which will write Commands to the specified Stream. | |
| void | add (String name, Command c, long interval) |
| Add a new task, with the specified name, action, and interval. | |
| void | add (String name, Runnable r, long interval) |
| Add a new task, with the specified name, action, and interval. | |
| void | run () |
| Thread method, runs the main scheduler event loop: Get the next task to execute (the active list is sorted by execution time) and wait that long. | |
| int | handleInteractiveCommand (String cmd, Vector args) |
| Handle a debug monitor command directed at this instance. | |
| String | toString () |
| void | terminate () |
| Terminate this scheduler. | |
Package Functions | |
| void | remove (ScheduleItem item) |
| void | schedule (ScheduleItem item) |
| Add the specified schedule item to the queue. | |
| long | msUntil (Date d) |
| How many ms between now and then (d)? | |
Package Attributes | |
| DList | active = new DList() |
| Stream | stream = null |
| Object | context = null |
| boolean | terminate = false |
| Hashtable | schedule = new Hashtable() |
|
||||||||||||||||
|
Construct a new PeriodicScheduler which will write Commands to the specified Stream.
Definition at line 90 of file PeriodicScheduler.java. |
|
||||||||||||||||
|
Add a new task, with the specified name, action, and interval. The task will NOT be executed 'now'; rather its first execution will be scheduled at time 'now + interval'.
Definition at line 138 of file PeriodicScheduler.java. References com.quadcap.util.threads.PeriodicScheduler.active, com.quadcap.util.threads.ScheduleItem.interval, com.quadcap.util.threads.PeriodicScheduler.remove(), com.quadcap.util.threads.ScheduleItem.runnable, and com.quadcap.util.threads.PeriodicScheduler.schedule. |
|
||||||||||||||||
|
Add a new task, with the specified name, action, and interval. The task will NOT be executed 'now'; rather its first execution will be scheduled at time 'now + interval'.
Definition at line 111 of file PeriodicScheduler.java. References com.quadcap.util.threads.PeriodicScheduler.active, com.quadcap.util.threads.PeriodicScheduler.add(), com.quadcap.util.threads.ScheduleItem.command, com.quadcap.util.threads.ScheduleItem.interval, com.quadcap.util.threads.PeriodicScheduler.remove(), and com.quadcap.util.threads.PeriodicScheduler.schedule. Referenced by com.quadcap.util.threads.PeriodicScheduler.add(). |
|
||||||||||||
|
Handle a debug monitor command directed at this instance.
Implements com.quadcap.util.threads.DebugMonitor. Definition at line 279 of file PeriodicScheduler.java. References com.quadcap.util.threads.PeriodicScheduler.active, com.quadcap.util.threads.ScheduleItem.date, com.quadcap.util.threads.PeriodicScheduler.handleInteractiveCommand(), com.quadcap.util.DList.head, com.quadcap.util.threads.ScheduleItem.interval, com.quadcap.util.threads.ScheduleItem.name, com.quadcap.util.DListItem.next, and com.quadcap.util.DListItem.obj. Referenced by com.quadcap.util.threads.PeriodicScheduler.handleInteractiveCommand(). |
|
|
How many ms between now and then (d)?
Definition at line 347 of file PeriodicScheduler.java. References com.quadcap.util.threads.PeriodicScheduler.msUntil(). Referenced by com.quadcap.util.threads.PeriodicScheduler.msUntil(), and com.quadcap.util.threads.PeriodicScheduler.run(). |
|
|
|
|
Add the specified schedule item to the queue.
Definition at line 180 of file PeriodicScheduler.java. References com.quadcap.util.threads.PeriodicScheduler.active, com.quadcap.util.DList.addBefore(), com.quadcap.util.DList.addFront(), com.quadcap.util.threads.ScheduleItem.checkDate(), com.quadcap.util.threads.ScheduleItem.date, com.quadcap.util.DList.head, com.quadcap.util.DListItem.next, com.quadcap.util.DListItem.obj, and com.quadcap.util.threads.PeriodicScheduler.schedule. |
|
|
Terminate this scheduler.
Definition at line 356 of file PeriodicScheduler.java. References com.quadcap.util.threads.PeriodicScheduler.active. |
|
|
|
|
Definition at line 79 of file PeriodicScheduler.java. Referenced by com.quadcap.util.threads.PeriodicScheduler.run(). |
|
|
Definition at line 81 of file PeriodicScheduler.java. Referenced by com.quadcap.util.threads.PeriodicScheduler.add(), and com.quadcap.util.threads.PeriodicScheduler.schedule(). |
|
|
Definition at line 78 of file PeriodicScheduler.java. Referenced by com.quadcap.util.threads.PeriodicScheduler.run(). |
|
|
Definition at line 80 of file PeriodicScheduler.java. Referenced by com.quadcap.util.threads.PeriodicScheduler.run(). |