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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classSmackFuture.InternalSmackFuture<V,E extends Exception> static classA simple version of InternalSmackFuture which implements isNonFatalException(E) as always returningfalsemethod.static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanawait(Collection<? extends SmackFuture<?, ?>> futures, long timeout) static booleanawait(Collection<? extends SmackFuture<?, ?>> futures, long timeout, TimeUnit unit) final booleancancel(boolean mayInterruptIfRunning) static <V,E extends Exception>
SmackFuture<V, E> from(V result) protected final voidprotected voidfutureWait(long timeout) final Vget()final Vfinal Vfinal booleanfinal booleanisDone()protected final voidvoidonCompletion(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
public final boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public final boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<V>
-
isDone
public final boolean isDone() -
wasSuccessful
public final boolean wasSuccessful() -
onSuccess
- Specified by:
onSuccessin interfaceCallbackRecipient<V,E extends Exception>
-
onError
- Specified by:
onErrorin interfaceCallbackRecipient<V,E extends Exception>
-
onCompletion
-
get
- Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionException
-
getOrThrow
- Throws:
EInterruptedException
-
get
public final V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
getIfAvailable
-
getExceptionIfAvailable
-
maybeInvokeCallbacks
protected final void 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
-