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
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected FlowuiBackgroundTaskProperties
protected TimeSource
-
Constructor Summary
ConstructorDescriptionBackgroundTaskWatchDogImpl
(FlowuiBackgroundTaskProperties properties, TimeSource timeSource) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Removes finished, canceled or hangup tasks.int
getExecutionStatus
(long actualTimeMs, TaskHandlerImpl taskHandler) void
manageTask
(TaskHandlerImpl taskHandler) Adds task underBackgroundTaskWatchDog
control.void
void
void
removeTask
(TaskHandlerImpl taskHandler) Task completed, remove it from watches.void
Stops 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:BackgroundTaskWatchDog
Removes finished, canceled or hangup tasks.- Specified by:
cleanupTasks
in interfaceBackgroundTaskWatchDog
-
stopTasks
public void stopTasks()Description copied from interface:BackgroundTaskWatchDog
Stops execution of all background tasks.- Specified by:
stopTasks
in interfaceBackgroundTaskWatchDog
-
getActiveTasksCount
public int getActiveTasksCount()- Specified by:
getActiveTasksCount
in interfaceBackgroundTaskWatchDog
- Returns:
- active tasks count
-
manageTask
Description copied from interface:BackgroundTaskWatchDog
Adds task underBackgroundTaskWatchDog
control.- Specified by:
manageTask
in interfaceBackgroundTaskWatchDog
- Parameters:
taskHandler
- task handler
-
removeTask
Description copied from interface:BackgroundTaskWatchDog
Task completed, remove it from watches.- Specified by:
removeTask
in interfaceBackgroundTaskWatchDog
- Parameters:
taskHandler
- task handler
-
getExecutionStatus
protected BackgroundTaskWatchDogImpl.ExecutionStatus getExecutionStatus(long actualTimeMs, TaskHandlerImpl taskHandler)
-