T
- the type held by the future.public interface FutureListener<T>
Modifier and Type | Method and Description |
---|---|
void |
onComplete(java.util.concurrent.Future<T> f)
Invoked when a Future has reached the completed termination state.
|
void onComplete(java.util.concurrent.Future<T> f) throws java.lang.InterruptedException
The catching of a ExecutionException
when
Future.get
is invoked may be utilized to determine if the
future terminated with an exception. The exception can be obtained
by invoking Throwable.getCause()
.
The catching of a CancellationException
when
Future.get
is invoked may be utilized to determine if the
future terminated with a cancellation.
f
- the completed Future. Invocation of Future.isDone()
will return true. Since the future is complete invocation of
Future.get()
and Future.get(long, java.util.concurrent.TimeUnit)
will not result in the throwing of an InterruptedException
.java.lang.InterruptedException
- this exception is declared so that the
developer does not need to catch it when invoking
Future.get
.Copyright © 2016 Oracle Corporation. All Rights Reserved.