Callback.Completable, Callback.Nested, Callback.NonBlocking| 构造器和说明 |
|---|
FutureCallback() |
FutureCallback(boolean completed) |
FutureCallback(Throwable failed) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
void |
failed(Throwable cause)
Callback invoked when the operation fails.
|
Void |
get() |
Void |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
static void |
rethrow(ExecutionException e) |
void |
succeeded()
Callback invoked when the operation completes.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfrom, from, isNonBlockingpublic FutureCallback()
public FutureCallback(boolean completed)
public FutureCallback(Throwable failed)
public void succeeded()
CallbackCallback invoked when the operation completes.
succeeded 在接口中 CallbackCallback.failed(Throwable)public void failed(Throwable cause)
CallbackCallback invoked when the operation fails.
public boolean isCancelled()
isCancelled 在接口中 Future<Void>public Void get() throws InterruptedException, ExecutionException
get 在接口中 Future<Void>InterruptedExceptionExecutionExceptionpublic Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get 在接口中 Future<Void>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic static void rethrow(ExecutionException e) throws IOException
IOExceptionCopyright © 2016. All rights reserved.