1 package jalview.ws2.actions.api;
5 import jalview.ws2.api.JobStatus;
8 * {@code TaskI} objects represent running services. Tasks are created by
9 * concrete implementations of {@link ActionI} and provide a view of the state
10 * of the underlying job(s).
17 public interface TaskI<T>
20 * Get the universal identifier of this task.
27 * Get the current status of the task. The resultant status should be a
28 * combination of individual sub-job statuses.
30 * @return global status of
32 JobStatus getStatus();
35 * Get the current list of sub-jobs of that task.
39 List<? extends JobI> getSubJobs();
42 * Get the last result of the task or {@code null} if not present. Note that
43 * the result is subject to change for restartable tasks.
45 * @return last task result
50 * Cancel the task, stop all sub-jobs running on a server and stop all threads