public abstract class SmackFuture<V,E extends java.lang.Exception> extends java.lang.Object implements java.util.concurrent.Future<V>, CallbackRecipient<V,E>
Modifier and Type | Class and Description |
---|---|
static class |
SmackFuture.InternalProcessStanzaSmackFuture<V,E extends java.lang.Exception> |
static class |
SmackFuture.InternalSmackFuture<V,E extends java.lang.Exception> |
static class |
SmackFuture.SimpleInternalProcessStanzaSmackFuture<V,E extends java.lang.Exception>
A simple version of InternalSmackFuture which implements isNonFatalException(E) as always returning
false method. |
static class |
SmackFuture.SocketFuture |
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 java.lang.Exception> |
from(V result) |
protected void |
futureWait() |
protected void |
futureWait(long timeout) |
V |
get() |
V |
get(long timeout,
java.util.concurrent.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 final boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<V>
public final boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<V>
public final boolean isDone()
isDone
in interface java.util.concurrent.Future<V>
public CallbackRecipient<V,E> onSuccess(SuccessCallback<V> successCallback)
onSuccess
in interface CallbackRecipient<V,E extends java.lang.Exception>
public CallbackRecipient<V,E> onError(ExceptionCallback<E> exceptionCallback)
onError
in interface CallbackRecipient<V,E extends java.lang.Exception>
public final V get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<V>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public final V getOrThrow() throws E extends java.lang.Exception, java.lang.InterruptedException
E extends java.lang.Exception
java.lang.InterruptedException
public final V get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<V>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
protected final void maybeInvokeCallbacks()
protected final void futureWait() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void futureWait(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public static <V,E extends java.lang.Exception> SmackFuture<V,E> from(V result)