public class FutureCallback extends Object implements Future<Void>, Callback
Callback.Adapter| Constructor and Description |
|---|
FutureCallback() |
FutureCallback(boolean completed) |
FutureCallback(Throwable failed) |
| Modifier and Type | Method and Description |
|---|---|
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() |
public FutureCallback()
public FutureCallback(boolean completed)
public FutureCallback(Throwable failed)
public void succeeded()
CallbackCallback invoked when the operation completes.
succeeded in interface CallbackCallback.failed(Throwable)public void failed(Throwable cause)
CallbackCallback invoked when the operation fails.
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<Void>public Void get() throws InterruptedException, ExecutionException
get in interface Future<Void>InterruptedExceptionExecutionExceptionpublic Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<Void>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic static void rethrow(ExecutionException e) throws IOException
IOExceptionCopyright © 1995-2015 Webtide. All Rights Reserved.