@ThreadSafe public abstract class TasksWatchDog extends java.lang.Object implements WatchDog
BackgroundWorker
.Modifier and Type | Class and Description |
---|---|
static class |
TasksWatchDog.ExecutionStatus |
Modifier and Type | Field and Description |
---|---|
protected TimeSource |
timeSource |
Constructor and Description |
---|
TasksWatchDog() |
Modifier and Type | Method and Description |
---|---|
void |
cleanupTasks()
Remove finished, canceled or hangup tasks.
|
int |
getActiveTasksCount() |
protected abstract TasksWatchDog.ExecutionStatus |
getExecutionStatus(long actualTimeMs,
TaskHandlerImpl taskHandler) |
void |
manageTask(TaskHandlerImpl taskHandler)
Add task under WatchDog control.
|
void |
removeTask(TaskHandlerImpl taskHandler)
Task completed, remove it from watches.
|
void |
stopTasks()
Stop execution of all background tasks.
|
@Inject protected TimeSource timeSource
public void cleanupTasks()
WatchDog
cleanupTasks
in interface WatchDog
protected abstract TasksWatchDog.ExecutionStatus getExecutionStatus(long actualTimeMs, TaskHandlerImpl taskHandler)
public void stopTasks()
WatchDog
public int getActiveTasksCount()
getActiveTasksCount
in interface WatchDog
public void manageTask(TaskHandlerImpl taskHandler)
manageTask
in interface WatchDog
taskHandler
- Task handlerpublic void removeTask(TaskHandlerImpl taskHandler)
WatchDog
removeTask
in interface WatchDog
taskHandler
- task handler