public interface AsyncTask
Modifier and Type | Method and Description |
---|---|
void |
cancel(boolean interrupt)
Prevents this task from being scheduled again, optionally interrupting the
task if it is currently running.
|
boolean |
isCancelled()
Returns true if
cancel(boolean) has been called on this task,
whether it was called from user code or from within the framework because
the task threw an exception. |
boolean |
isFinished()
Returns true if this task is no longer scheduled to run, either because it executed
(successfully or with an error) or
cancel(boolean) was called. |
void |
setExitHandler(Runnable runnable)
Sets the task that should be run after all executions of this task have
completed.
|
void cancel(boolean interrupt)
interrupt
- if true, and this task is presently being executed,
Thread.interrupt()
will be called on the thread currently
executing this task.void setExitHandler(Runnable runnable)
runnable
- the logic to execute when this task has completed all of its
executions, either because it completed normally, by throwing an
exception, or because it was cancelled by a call to
cancel(boolean)
.boolean isCancelled()
cancel(boolean)
has been called on this task,
whether it was called from user code or from within the framework because
the task threw an exception.boolean isFinished()
cancel(boolean)
was called.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.