R - public abstract class AbstractFutureTask<R> extends Object implements Runnable, Future<R>
FutureTask, which is in some
cases not flexible enough.
+-------------+
| | run
| created +------------------------------+
| | #taskStarted |
+------+------+ |
| |
| |
|cancel +--------v----+
|#taskCancelled | +-------------------+
| +----------+ active +----+ |
| | | | | |
| |cancel +-------------+ | |
| | | |
| v |#taskFinished |#taskFailed
| +----------------+ |#taskFinally |#taskFinally
| | | | |
| | cancel pending | | |
| | | | |
| +-----+----------+ | |
| | v |
v |#undo +------------+ +----v-------+
+--------------+ |#taskCancelled | | | |
| | | | done | | failed |
| cancelled |<--------+ | | | |
| | +------------+ +------------+
+--------------+
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean interrupt) |
R |
get() |
R |
get(long timeout,
TimeUnit unit)
Wait for the result.
|
Throwable |
getException() |
String |
getLabel() |
ITaskListener |
getTaskListener() |
boolean |
isActive() |
boolean |
isAsynch() |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isFailed() |
void |
reset() |
void |
run() |
void |
runAsync() |
void |
setAsynch(boolean asynch) |
void |
setTaskListener(ITaskListener taskListener) |
String |
toString() |
public R get() throws InterruptedException, ExecutionException
get in interface Future<R>InterruptedExceptionExecutionExceptionpublic R get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<R>InterruptedExceptionExecutionExceptionTimeoutExceptionFuture.get(long, java.util.concurrent.TimeUnit)public Throwable getException()
public String getLabel()
public ITaskListener getTaskListener()
public boolean isActive()
public boolean isAsynch()
public boolean isCancelled()
isCancelled in interface Future<R>public boolean isFailed()
public void reset()
public final void runAsync()
public void setAsynch(boolean asynch)
public void setTaskListener(ITaskListener taskListener)
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.