Handler.Adapter<C>
Constructor and Description |
---|
Promise() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
void |
completed(T result)
Callback invoked when the operation completes.
|
void |
failed(T context,
Throwable x)
Callback invoked when the operation fails.
|
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public void completed(T result)
Handler
Callback invoked when the operation completes.
completed
in interface Handler<T>
result
- the contextHandler.failed(Object, Throwable)
public void failed(T context, Throwable x)
Handler
Callback invoked when the operation fails.
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
public T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.