public abstract class SmackFuture<V,E extends Exception> extends Object implements Future<V>, CallbackRecipient<V,E>
Modifier and Type | Class and Description |
---|---|
static class |
SmackFuture.InternalProcessStanzaSmackFuture<V,E extends Exception> |
static class |
SmackFuture.InternalSmackFuture<V,E extends Exception> |
static class |
SmackFuture.SimpleInternalProcessStanzaSmackFuture<V,E extends Exception>
A simple version of InternalSmackFuture which implements isNonFatalException(E) as always returning
false method. |
Modifier and Type | Field and Description |
---|---|
protected E |
exception |
protected V |
result |
Constructor and Description |
---|
SmackFuture() |
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 SmackFuture()
public final 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 getOrThrow() throws E extends Exception, InterruptedException
E extends Exception
InterruptedException
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> SmackFuture<V,E> from(V result)