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()
Callback
Callback invoked when the operation completes.
succeeded
in interface Callback
Callback.failed(Throwable)
public void failed(Throwable cause)
Callback
Callback 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>
InterruptedException
ExecutionException
public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<Void>
InterruptedException
ExecutionException
TimeoutException
public static void rethrow(ExecutionException e) throws IOException
IOException
Copyright © 1995-2015 Webtide. All Rights Reserved.