Interface TaskManager


@Contract public interface TaskManager
Manager of scheduled tasks.

Each task can be assigned a task manager. If none is assigned, the one in the global ServiceRegistry will be used.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(Task task)
    Register a task with this task manager.
    boolean
    remove(Task task)
    Remove a task from this task manager.
    void
    Close all current tasks and remove them from this task manager.
    A collection of tasks currently managed by this manager.
  • Method Details

    • shutdown

      void shutdown()
      Close all current tasks and remove them from this task manager.
    • register

      void register(Task task)
      Register a task with this task manager.
      Parameters:
      task - a scheduling task that was started
    • remove

      boolean remove(Task task)
      Remove a task from this task manager.
      Parameters:
      task - task to remove
      Returns:
      true if the task was managed by this manager and successfully removed
    • tasks

      Collection<Task> tasks()
      A collection of tasks currently managed by this manager. As methods on this instance can be called concurrently, the collection returned may not match the tasks managed by this instance in any point of time in the future.

      The collection returned is not mutable, and is not connected to the underlying task storage.

      Returns:
      a collection of tasks