public class SingleThreadedScheduler extends java.lang.Object implements TaskScheduler, CanSetName
Tasks execute with in-order
single-threaded semantics.
Tasks can be presented through submit(Callable). The order of execution is the
sumbission order.
This implementation does so by blocking on a ConcurrentLinkedQueue, after
the task is started in a thread (and Task.isBegun() returns true), but (of course)
before the TaskInternal.getJob() actually gets invoked.
| Constructor and Description |
|---|
SingleThreadedScheduler() |
| Modifier and Type | Method and Description |
|---|---|
void |
injectExecutor(java.util.concurrent.ExecutorService executor) |
void |
setName(java.lang.String name) |
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> c)
Called by
BasicExecutionManager to schedule tasks. |
java.lang.String |
toString() |
public void setName(java.lang.String name)
setName in interface CanSetNamepublic java.lang.String toString()
toString in class java.lang.Objectpublic void injectExecutor(java.util.concurrent.ExecutorService executor)
injectExecutor in interface TaskSchedulerpublic <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> c)
TaskSchedulerBasicExecutionManager to schedule tasks.submit in interface TaskScheduler