Class TasksWatchDog

java.lang.Object
io.jmix.ui.executor.impl.TasksWatchDog
All Implemented Interfaces:
WatchDog
Direct Known Subclasses:
WebTasksWatchDog

@ThreadSafe public abstract class TasksWatchDog extends Object implements WatchDog
WatchDog for BackgroundWorker.
  • Field Details

    • timeSource

      @Autowired protected TimeSource 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 interface WatchDog
    • 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.
      Specified by:
      stopTasks in interface WatchDog
    • getActiveTasksCount

      public int getActiveTasksCount()
      Specified by:
      getActiveTasksCount in interface WatchDog
      Returns:
      active tasks count
    • manageTask

      public void manageTask(TaskHandlerImpl taskHandler)
      Add task under WatchDog control.
      Specified by:
      manageTask in interface WatchDog
      Parameters:
      taskHandler - Task handler
    • removeTask

      public void removeTask(TaskHandlerImpl taskHandler)
      Description copied from interface: WatchDog
      Task completed, remove it from watches.
      Specified by:
      removeTask in interface WatchDog
      Parameters:
      taskHandler - task handler