Package org.minidns
Class MiniDnsFuture<V,E extends Exception>
- java.lang.Object
-
- org.minidns.MiniDnsFuture<V,E>
-
- All Implemented Interfaces:
Future<V>
,CallbackRecipient<V,E>
- Direct Known Subclasses:
MiniDnsFuture.InternalMiniDnsFuture
public abstract class MiniDnsFuture<V,E extends Exception> extends Object implements Future<V>, CallbackRecipient<V,E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MiniDnsFuture.ExceptionsWrapper<EI extends Exception,EO extends Exception>
static class
MiniDnsFuture.InternalMiniDnsFuture<V,E extends Exception>
-
Constructor Summary
Constructors Constructor Description MiniDnsFuture()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V,EI extends Exception,EO extends Exception>
MiniDnsFuture<V,EO>anySuccessfulOf(Collection<MiniDnsFuture<V,EI>> futures, MiniDnsFuture.ExceptionsWrapper<EI,EO> exceptionsWrapper)
static <V> MiniDnsFuture<V,IOException>
anySuccessfulOf(Collection<MiniDnsFuture<V,IOException>> futures)
boolean
cancel(boolean mayInterruptIfRunning)
static <V,E extends Exception>
MiniDnsFuture<V,E>from(V result)
V
get()
V
get(long timeout, TimeUnit unit)
V
getOrThrow()
boolean
hasException()
boolean
hasResult()
boolean
isCancelled()
boolean
isDone()
protected void
maybeInvokeCallbacks()
CallbackRecipient<V,E>
onError(ExceptionCallback<E> exceptionCallback)
CallbackRecipient<V,E>
onSuccess(SuccessCallback<V> successCallback)
-
-
-
Constructor Detail
-
MiniDnsFuture
public MiniDnsFuture()
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public final boolean isCancelled()
- Specified by:
isCancelled
in interfaceFuture<V>
-
hasResult
public final boolean hasResult()
-
hasException
public final boolean hasException()
-
onSuccess
public CallbackRecipient<V,E> onSuccess(SuccessCallback<V> successCallback)
- Specified by:
onSuccess
in interfaceCallbackRecipient<V,E extends Exception>
-
onError
public CallbackRecipient<V,E> onError(ExceptionCallback<E> exceptionCallback)
- Specified by:
onError
in interfaceCallbackRecipient<V,E extends Exception>
-
get
public final V get() throws InterruptedException, ExecutionException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
get
public final V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
maybeInvokeCallbacks
protected final void maybeInvokeCallbacks()
-
from
public static <V,E extends Exception> MiniDnsFuture<V,E> from(V result)
-
anySuccessfulOf
public static <V> MiniDnsFuture<V,IOException> anySuccessfulOf(Collection<MiniDnsFuture<V,IOException>> futures)
-
anySuccessfulOf
public static <V,EI extends Exception,EO extends Exception> MiniDnsFuture<V,EO> anySuccessfulOf(Collection<MiniDnsFuture<V,EI>> futures, MiniDnsFuture.ExceptionsWrapper<EI,EO> exceptionsWrapper)
-
-