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 Details
-
shutdown
void shutdown()Close all current tasks and remove them from this task manager. -
register
Register a task with this task manager.- Parameters:
task
- a scheduling task that was started
-
remove
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
-