Promise.Adapter<C>
Constructor and Description |
---|
FuturePromise() |
FuturePromise(C result) |
FuturePromise(C ctx,
Throwable failed) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
void |
failed(Throwable cause)
Callback invoked when the operation fails.
|
C |
get() |
C |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
static void |
rethrow(ExecutionException e) |
void |
succeeded(C result)
Callback invoked when the operation completes.
|
String |
toString() |
public FuturePromise()
public FuturePromise(C result)
public void succeeded(C result)
Promise
Callback invoked when the operation completes.
succeeded
in interface Promise<C>
result
- the contextPromise.failed(Throwable)
public void failed(Throwable cause)
Promise
Callback invoked when the operation fails.
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<C>
public C get() throws InterruptedException, ExecutionException
get
in interface Future<C>
InterruptedException
ExecutionException
public C get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<C>
InterruptedException
ExecutionException
TimeoutException
public static void rethrow(ExecutionException e) throws IOException
IOException
Copyright © 1995-2015 Webtide. All Rights Reserved.