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
Modifier and TypeClassDescriptionstatic interface
MiniDnsFuture.ExceptionsWrapper<EI extends Exception,
EO extends Exception> static class
MiniDnsFuture.InternalMiniDnsFuture<V,
E extends Exception> -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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) final V
get()
final V
final V
final boolean
final boolean
final boolean
final boolean
isDone()
protected final void
onError
(ExceptionCallback<E> exceptionCallback) onSuccess
(SuccessCallback<V> successCallback)
-
Field Details
-
result
-
exception
-
-
Constructor Details
-
MiniDnsFuture
public MiniDnsFuture()
-
-
Method Details
-
cancel
-
isCancelled
- Specified by:
isCancelled
in interfaceFuture<V>
-
isDone
-
hasResult
-
hasException
-
onSuccess
- Specified by:
onSuccess
in interfaceCallbackRecipient<V,
E extends Exception>
-
onError
- Specified by:
onError
in interfaceCallbackRecipient<V,
E extends Exception>
-
get
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
getOrThrow
- Throws:
E
-
get
public final V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
maybeInvokeCallbacks
-
from
-
anySuccessfulOf
public static <V> MiniDnsFuture<V,IOException> anySuccessfulOf(Collection<MiniDnsFuture<V, IOException>> futures) -
anySuccessfulOf
public static <V,EI extends Exception, MiniDnsFuture<V,EO extends Exception> EO> anySuccessfulOf(Collection<MiniDnsFuture<V, EI>> futures, MiniDnsFuture.ExceptionsWrapper<EI, EO> exceptionsWrapper)
-