Interface TaskManager

All Known Implementing Classes:
BlockingTaskManager

public interface TaskManager
Defines the operations of a service that can run tasks in the background. The task manager will generate events when tasks are run, paused, canceled, or complete.
  • Method Summary

    Modifier and Type Method Description
    void cancel​(Task task)
    Requests to cancel the task.
    Task.Status getStatus​(Task task)
    Gets the task status.
    void remove​(Task task)
    Removes a task from the task manager.
    void submit​(Task task)
    Submits a task to run in the background.
  • Method Details

    • submit

      void submit​(Task task)
      Submits a task to run in the background.
      Parameters:
      task - the task to run
    • remove

      void remove​(Task task)
      Removes a task from the task manager. The task manager will attempt to cancel the task if it is running. Once a task is removed, further operations on the task using this task manager may result in exceptions.
      Parameters:
      task - the task to remove
    • getStatus

      Task.Status getStatus​(Task task)
      Gets the task status.
      Parameters:
      task - the task
      Returns:
      the task status
    • cancel

      void cancel​(Task task)
      Requests to cancel the task.
      Parameters:
      task - the task to cancel