|
Trull | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.luc.cs.trull.FastScheduler
class FastScheduler
An implementation of the Scheduler interface based on Doug Lea's QueuedExecutor. To allow for faster execution, this class does not support the await method.
| Nested Class Summary | |
|---|---|
protected class |
FastScheduler.WaitableRunnable
A wrapper around a Runnable that releases a latch when the Runnable has finished. |
| Field Summary | |
|---|---|
protected EDU.oswego.cs.dl.util.concurrent.QueuedExecutor |
executor
|
private static org.apache.log4j.Logger |
logger
|
| Constructor Summary | |
|---|---|
FastScheduler()
Sole constructor. |
|
| Method Summary | |
|---|---|
void |
await()
This method is not supported in the interest of faster execution. |
void |
execute(java.lang.Runnable task)
This method executes a Runnable and waits for its completion. |
protected java.lang.Runnable |
makeWaitable(java.lang.Runnable task,
EDU.oswego.cs.dl.util.concurrent.Latch done)
Factory method for a Runnable to schedule. |
void |
schedule(java.lang.Runnable task)
This method schedules a Runnable for later execution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected EDU.oswego.cs.dl.util.concurrent.QueuedExecutor executor
private static final org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public FastScheduler()
| Method Detail |
|---|
public void await()
throws java.lang.InterruptedException
await in interface Schedulerjava.lang.InterruptedException - if the current thread is interrupted while waiting.
public void execute(java.lang.Runnable task)
throws java.lang.InterruptedException
Scheduler
execute in interface Schedulertask - the Runnable to be executed.
java.lang.InterruptedException - if the current thread is interrupted while waiting.
protected java.lang.Runnable makeWaitable(java.lang.Runnable task,
EDU.oswego.cs.dl.util.concurrent.Latch done)
task - the original task to schedule.done - the latch indicating when the task has been executed.
public void schedule(java.lang.Runnable task)
Scheduler
schedule in interface Schedulertask - the Runnable to be scheduled.
|
Trull | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||