Package org.jivesoftware.smack
Class SmackFuture<V,E extends Exception>
java.lang.Object
org.jivesoftware.smack.SmackFuture<V,E>
- All Implemented Interfaces:
Future<V>
,CallbackRecipient<V,
E>
- Direct Known Subclasses:
SmackFuture.InternalSmackFuture
public abstract class SmackFuture<V,E extends Exception>
extends Object
implements Future<V>, CallbackRecipient<V,E>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
SmackFuture.InternalSmackFuture<V,
E extends Exception> static class
A simple version of InternalSmackFuture which implements isNonFatalException(E) as always returningfalse
method.static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
await
(Collection<? extends SmackFuture<?, ?>> futures, long timeout) static boolean
await
(Collection<? extends SmackFuture<?, ?>> futures, long timeout, TimeUnit unit) final boolean
cancel
(boolean mayInterruptIfRunning) static <V,
E extends Exception>
SmackFuture<V,E> from
(V result) protected final void
protected void
futureWait
(long timeout) final V
get()
final V
final V
final boolean
final boolean
isDone()
protected final void
void
onCompletion
(Consumer<SmackFuture<V, E>> completionCallback) onError
(ExceptionCallback<E> exceptionCallback) onSuccess
(SuccessCallback<V> successCallback) final boolean
-
Field Details
-
result
-
exception
-
-
Constructor Details
-
SmackFuture
public SmackFuture()
-
-
Method Details
-
cancel
-
isCancelled
- Specified by:
isCancelled
in interfaceFuture<V>
-
isDone
-
wasSuccessful
-
onSuccess
- Specified by:
onSuccess
in interfaceCallbackRecipient<V,
E extends Exception>
-
onError
- Specified by:
onError
in interfaceCallbackRecipient<V,
E extends Exception>
-
onCompletion
-
get
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
getOrThrow
- Throws:
E extends Exception
InterruptedException
-
get
public final V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
getIfAvailable
-
getExceptionIfAvailable
-
maybeInvokeCallbacks
-
futureWait
- Throws:
InterruptedException
-
futureWait
- Throws:
InterruptedException
-
from
-
await
public static boolean await(Collection<? extends SmackFuture<?, ?>> futures, long timeout) throws InterruptedException- Throws:
InterruptedException
-
await
public static boolean await(Collection<? extends SmackFuture<?, ?>> futures, long timeout, TimeUnit unit) throws InterruptedException- Throws:
InterruptedException
-