org.drools.concurrent
Class ExternalExecutorService.TaskManager
java.lang.Object
org.drools.concurrent.ExternalExecutorService.TaskManager
- All Implemented Interfaces:
- ExternalExecutorService.TaskObserver
- Enclosing class:
- ExternalExecutorService
protected static class ExternalExecutorService.TaskManager
- extends Object
- implements ExternalExecutorService.TaskObserver
An implementation of the TaskObserver interface that keeps a map of
submitted, but not executed tasks. Whenever one of the ObservableTasks is
executed, it is removed from the map.
|
Field Summary |
protected static org.slf4j.Logger |
logger
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static transient org.slf4j.Logger logger
ExternalExecutorService.TaskManager
public ExternalExecutorService.TaskManager()
waitUntilEmpty
public void waitUntilEmpty()
cleanUpTasks
public void cleanUpTasks()
trackTask
public Runnable trackTask(Runnable task)
- Creates an ObservableRunnable instance for the given task and tracks
the task execution
- Parameters:
task - the task to track
- Returns:
- the observable instance of the given task
trackTask
public <T> Callable<T> trackTask(Callable<T> task)
- Creates an ObservableCallable instance for the given task and
tracks the task execution
- Parameters:
task - the task to track
- Returns:
- the observable instance of the given task
trackTasks
public Collection trackTasks(Collection tasksToTrack)
- Creates an ObservableCallable instance for each of the given taks
and track their execution
- Parameters:
tasksToTrack - the collection of tasks to track
- Returns:
- the collection of ObservableCallable tasks
afterTaskFinishes
public void afterTaskFinishes(Runnable task,
Thread thread)
- Specified by:
afterTaskFinishes in interface ExternalExecutorService.TaskObserver
afterTaskFinishes
public void afterTaskFinishes(Callable<?> task,
Thread thread)
- Specified by:
afterTaskFinishes in interface ExternalExecutorService.TaskObserver
beforeTaskStarts
public void beforeTaskStarts(Runnable task,
Thread thread)
- Specified by:
beforeTaskStarts in interface ExternalExecutorService.TaskObserver
beforeTaskStarts
public void beforeTaskStarts(Callable<?> task,
Thread thread)
- Specified by:
beforeTaskStarts in interface ExternalExecutorService.TaskObserver
taskExceptionRaised
public void taskExceptionRaised(Runnable task,
Thread thread,
Throwable t)
- Specified by:
taskExceptionRaised in interface ExternalExecutorService.TaskObserver
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.