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
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove finished, canceled or hangup tasks.intprotected abstract TasksWatchDog.ExecutionStatusgetExecutionStatus(long actualTimeMs, TaskHandlerImpl taskHandler) voidmanageTask(TaskHandlerImpl taskHandler) Add task under WatchDog control.voidvoidvoidremoveTask(TaskHandlerImpl taskHandler) Task completed, remove it from watches.voidStop 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:WatchDogRemove finished, canceled or hangup tasks.- Specified by:
cleanupTasksin interfaceWatchDog
-
getExecutionStatus
protected abstract TasksWatchDog.ExecutionStatus getExecutionStatus(long actualTimeMs, TaskHandlerImpl taskHandler) -
stopTasks
public void stopTasks()Description copied from interface:WatchDogStop execution of all background tasks. -
getActiveTasksCount
public int getActiveTasksCount()- Specified by:
getActiveTasksCountin interfaceWatchDog- Returns:
- active tasks count
-
manageTask
Add task under WatchDog control.- Specified by:
manageTaskin interfaceWatchDog- Parameters:
taskHandler- Task handler
-
removeTask
Description copied from interface:WatchDogTask completed, remove it from watches.- Specified by:
removeTaskin interfaceWatchDog- Parameters:
taskHandler- task handler
-