public class NotifyingFutureTask extends FutureTask<Void>
Future that accepts completion listener. The listener is invoked
once the future's computation is complete.
If the computation has already completed when the listener is added, the
listener will execute immediately.
Listener is invoked synchronously on the same thread which is used to executed the Future
| Constructor and Description |
|---|
NotifyingFutureTask(Callable<Void> callable) |
NotifyingFutureTask(Runnable task) |
| Modifier and Type | Method and Description |
|---|---|
static NotifyingFutureTask |
completed() |
protected void |
done() |
void |
onComplete(Runnable onComplete)
Set the on complete handler.
|
cancel, get, get, isCancelled, isDone, run, runAndReset, set, setExceptionpublic NotifyingFutureTask(Runnable task)
public void onComplete(Runnable onComplete)
onComplete - listener to invoke upon completionprotected void done()
done in class FutureTask<Void>public static NotifyingFutureTask completed()
Copyright © 2012-2018 The Apache Software Foundation. All Rights Reserved.