public abstract class MiniDnsFuture<V,E extends Exception> extends Object implements Future<V>, CallbackRecipient<V,E>
Modifier and Type | Class and Description |
---|---|
static class |
MiniDnsFuture.InternalMiniDnsFuture<V,E extends Exception> |
Modifier and Type | Field and Description |
---|---|
protected E |
exception |
protected V |
result |
Constructor and Description |
---|
MiniDnsFuture() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
static <V,E extends Exception> |
from(V result) |
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
V |
getOrThrow() |
boolean |
isCancelled() |
boolean |
isDone() |
protected void |
maybeInvokeCallbacks() |
CallbackRecipient<V,E> |
onError(ExceptionCallback<E> exceptionCallback) |
CallbackRecipient<V,E> |
onSuccess(SuccessCallback<V> successCallback) |
public MiniDnsFuture()
public boolean cancel(boolean mayInterruptIfRunning)
public final boolean isCancelled()
isCancelled
in interface Future<V>
public CallbackRecipient<V,E> onSuccess(SuccessCallback<V> successCallback)
onSuccess
in interface CallbackRecipient<V,E extends Exception>
public CallbackRecipient<V,E> onError(ExceptionCallback<E> exceptionCallback)
onError
in interface CallbackRecipient<V,E extends Exception>
public final V get() throws InterruptedException, ExecutionException
get
in interface Future<V>
InterruptedException
ExecutionException
public final V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
protected final void maybeInvokeCallbacks()
public static <V,E extends Exception> MiniDnsFuture<V,E> from(V result)