public interface Task
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Task.TaskStateModel
If a task can be suspended and resumed, this is an arbitrary state that will be used to resume.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(long timeoutMS)
When called, the task should stop as quickly as possible.
|
java.util.List<java.lang.Throwable> |
getErrors()
Returns a List of all the exceptions that occurred when running a task.
|
java.util.UUID |
getId() |
void |
resume(Task.TaskStateModel state) |
void |
run(TaskContext context)
Executes the task.
|
java.util.Optional<Task.TaskStateModel> |
suspend(long timeoutMS)
When called, the task should stop as quickly as possible.
|
java.util.UUID getId()
void run(TaskContext context) throws java.lang.Exception
java.lang.Exceptionjava.util.Optional<Task.TaskStateModel> suspend(long timeoutMS) throws java.util.concurrent.TimeoutException, java.lang.InterruptedException
java.util.concurrent.TimeoutExceptionjava.lang.InterruptedExceptionvoid resume(Task.TaskStateModel state)
void cancel(long timeoutMS)
throws java.util.concurrent.TimeoutException,
java.lang.InterruptedException
java.util.concurrent.TimeoutExceptionjava.lang.InterruptedExceptionjava.util.List<java.lang.Throwable> getErrors()