Package io.jmix.ui.executor.impl
Class TasksWatchDog
java.lang.Object
io.jmix.ui.executor.impl.TasksWatchDog
- All Implemented Interfaces:
WatchDog
- Direct Known Subclasses:
WebTasksWatchDog
WatchDog for
BackgroundWorker
.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Remove finished, canceled or hangup tasks.int
protected abstract TasksWatchDog.ExecutionStatus
getExecutionStatus
(long actualTimeMs, TaskHandlerImpl taskHandler) void
manageTask
(TaskHandlerImpl taskHandler) Add task under WatchDog control.void
void
void
removeTask
(TaskHandlerImpl taskHandler) Task completed, remove it from watches.void
Stop execution of all background tasks.
-
Field Details
-
timeSource
-
initialized
protected volatile boolean initialized
-
-
Constructor Details
-
TasksWatchDog
public TasksWatchDog()
-
-
Method Details
-
onContextRefreshed
@EventListener(classes={org.springframework.context.event.ContextRefreshedEvent.class,org.springframework.context.event.ContextStartedEvent.class}) public void onContextRefreshed() -
onContextStopped
@EventListener(org.springframework.context.event.ContextStoppedEvent.class) public void onContextStopped() -
cleanupTasks
public void cleanupTasks()Description copied from interface:WatchDog
Remove finished, canceled or hangup tasks.- Specified by:
cleanupTasks
in interfaceWatchDog
-
getExecutionStatus
protected abstract TasksWatchDog.ExecutionStatus getExecutionStatus(long actualTimeMs, TaskHandlerImpl taskHandler) -
stopTasks
public void stopTasks()Description copied from interface:WatchDog
Stop execution of all background tasks. -
getActiveTasksCount
public int getActiveTasksCount()- Specified by:
getActiveTasksCount
in interfaceWatchDog
- Returns:
- active tasks count
-
manageTask
Add task under WatchDog control.- Specified by:
manageTask
in interfaceWatchDog
- Parameters:
taskHandler
- Task handler
-
removeTask
Description copied from interface:WatchDog
Task completed, remove it from watches.- Specified by:
removeTask
in interfaceWatchDog
- Parameters:
taskHandler
- task handler
-