Monitor tasks execution for completion notifying their results
Constructor and description |
---|
TaskDispatcher
(Session session) Dispatcher constructor |
protected TaskDispatcher
() |
Type Params | Return Type | Name and description |
---|---|---|
|
TaskMonitor |
getMonitor(java.lang.Object executor) Get the monitor associated to the executor type or instance |
|
TaskMonitor |
getOrCreateMonitor(java.lang.Class<? extends Executor> type, groovy.lang.Closure<TaskMonitor> create) Get an instance of TaskMonitor in the #monitors map,
when the map contains no value for the specified executor invoke the
closure in order to create a new TaskMonitor object,
add it to the map and return it. |
|
void |
signal() |
|
void |
start() Flag the dispatcher as started |
|
void |
submit(TaskRun task, boolean awaitTermination) Submit the specified task for execution to the underlying system and add it to the queue of tasks to be monitored. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Dispatcher constructor
Get the monitor associated to the executor type or instance
Get an instance of TaskMonitor
in the #monitors
map,
when the map contains no value for the specified executor invoke the
closure in order to create a new TaskMonitor
object,
add it to the map and return it.
NOTE: this method is not thread-safe by design since it is invoked
only by the script interpreter.
Flag the dispatcher as started
Submit the specified task for execution to the underlying system and add it to the queue of tasks to be monitored.
task
- A TaskRun
instance