Class BackgroundTaskWatchDogImpl
java.lang.Object
io.jmix.flowui.backgroundtask.impl.BackgroundTaskWatchDogImpl
- All Implemented Interfaces:
BackgroundTaskWatchDog
@ThreadSafe
public class BackgroundTaskWatchDogImpl
extends Object
implements BackgroundTaskWatchDog
Implementation of
BackgroundTaskWatchDog for BackgroundWorker.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected UiBackgroundTaskPropertiesprotected TimeSource -
Constructor Summary
ConstructorsConstructorDescriptionBackgroundTaskWatchDogImpl(UiBackgroundTaskProperties properties, TimeSource timeSource) -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves finished, canceled or hangup tasks.intgetExecutionStatus(long actualTimeMs, TaskHandlerImpl taskHandler) voidmanageTask(TaskHandlerImpl taskHandler) Adds task underBackgroundTaskWatchDogcontrol.voidvoidvoidremoveTask(TaskHandlerImpl taskHandler) Task completed, remove it from watches.voidStops execution of all background tasks.
-
Field Details
-
timeSource
-
properties
-
initialized
protected volatile boolean initialized
-
-
Constructor Details
-
BackgroundTaskWatchDogImpl
-
-
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:BackgroundTaskWatchDogRemoves finished, canceled or hangup tasks.- Specified by:
cleanupTasksin interfaceBackgroundTaskWatchDog
-
stopTasks
public void stopTasks()Description copied from interface:BackgroundTaskWatchDogStops execution of all background tasks.- Specified by:
stopTasksin interfaceBackgroundTaskWatchDog
-
getActiveTasksCount
public int getActiveTasksCount()- Specified by:
getActiveTasksCountin interfaceBackgroundTaskWatchDog- Returns:
- active tasks count
-
manageTask
Description copied from interface:BackgroundTaskWatchDogAdds task underBackgroundTaskWatchDogcontrol.- Specified by:
manageTaskin interfaceBackgroundTaskWatchDog- Parameters:
taskHandler- task handler
-
removeTask
Description copied from interface:BackgroundTaskWatchDogTask completed, remove it from watches.- Specified by:
removeTaskin interfaceBackgroundTaskWatchDog- Parameters:
taskHandler- task handler
-
getExecutionStatus
protected BackgroundTaskWatchDogImpl.ExecutionStatus getExecutionStatus(long actualTimeMs, TaskHandlerImpl taskHandler)
-