class PromiseTask<V> extends DefaultPromise<V> implements java.util.concurrent.RunnableFuture<V>
| Modifier and Type | Class and Description |
|---|---|
private static class |
PromiseTask.RunnableAdapter<T> |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.Callable<V> |
task |
| Constructor and Description |
|---|
PromiseTask(EventExecutor executor,
java.util.concurrent.Callable<V> callable) |
PromiseTask(EventExecutor executor,
java.lang.Runnable runnable,
V result) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
void |
run() |
Promise<V> |
setFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
protected Promise<V> |
setFailureInternal(java.lang.Throwable cause) |
Promise<V> |
setSuccess(V result)
Marks this future as a success and notifies all
listeners.
|
protected Promise<V> |
setSuccessInternal(V result) |
boolean |
setUncancellable()
Make this future impossible to cancel.
|
protected boolean |
setUncancellableInternal() |
(package private) static <T> java.util.concurrent.Callable<T> |
toCallable(java.lang.Runnable runnable,
T result) |
protected java.lang.StringBuilder |
toStringBuilder() |
boolean |
tryFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
protected boolean |
tryFailureInternal(java.lang.Throwable cause) |
boolean |
trySuccess(V result)
Marks this future as a success and notifies all
listeners.
|
protected boolean |
trySuccessInternal(V result) |
addListener, addListeners, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, checkDeadLock, executor, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, notifyProgressiveListeners, removeListener, removeListeners, sync, syncUninterruptibly, toStringget, getprotected final java.util.concurrent.Callable<V> task
PromiseTask(EventExecutor executor, java.lang.Runnable runnable, V result)
PromiseTask(EventExecutor executor, java.util.concurrent.Callable<V> callable)
static <T> java.util.concurrent.Callable<T> toCallable(java.lang.Runnable runnable,
T result)
public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void run()
run in interface java.lang.Runnablerun in interface java.util.concurrent.RunnableFuture<V>public final Promise<V> setFailure(java.lang.Throwable cause)
PromiseIllegalStateException.setFailure in interface Promise<V>setFailure in class DefaultPromise<V>public final boolean tryFailure(java.lang.Throwable cause)
PromisetryFailure in interface Promise<V>tryFailure in class DefaultPromise<V>true if and only if successfully marked this future as
a failure. Otherwise false because this future is
already marked as either a success or a failure.protected final boolean tryFailureInternal(java.lang.Throwable cause)
public final Promise<V> setSuccess(V result)
PromiseIllegalStateException.setSuccess in interface Promise<V>setSuccess in class DefaultPromise<V>public final boolean trySuccess(V result)
PromisetrySuccess in interface Promise<V>trySuccess in class DefaultPromise<V>true if and only if successfully marked this future as
a success. Otherwise false because this future is
already marked as either a success or a failure.protected final boolean trySuccessInternal(V result)
public final boolean setUncancellable()
PromisesetUncancellable in interface Promise<V>setUncancellable in class DefaultPromise<V>true if and only if successfully marked this future as uncancellable or it is already done
without being cancelled. false if this future has been cancelled already.protected final boolean setUncancellableInternal()
protected java.lang.StringBuilder toStringBuilder()
toStringBuilder in class DefaultPromise<V>