Modifier and Type | Class and Description |
---|---|
private static class | |
private static class | |
private static class |
Modifier and Type | Field and Description |
---|---|
private static final DefaultPromise. | |
private static final StackTraceElement[] | |
private final EventExecutor | |
private GenericFutureListener | listener
One or more listeners. |
private DefaultFutureListeners | |
private static final InternalLogger | |
private static final int | |
private boolean | notifyingListeners
Threading - synchronized(this). |
private static final InternalLogger | |
private volatile Object | |
private static final AtomicReferenceFieldUpdater | |
private static final Object | |
private static final Object | |
private short | waiters
Threading - synchronized(this). |
Access | Constructor and Description |
---|---|
public | DefaultPromise(EventExecutor
the executor)EventExecutor which is used to notify the promise once it is complete.
It is assumed this executor will protect against StackOverflowError exceptions.
The executor may be used to avoid StackOverflowError by executing a Runnable if the stack
depth exceeds a threshold.Creates a new instance. |
protected |
Modifier and Type | Method and Description |
---|---|
public Promise | addListener(GenericFutureListener<? extends Future<? super V>> listener)
Implements io. |
private void | |
public Promise | addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Implements io. |
public Promise | await()
Implements io. |
public boolean | await(long timeout, TimeUnit unit)
Implements io. |
public boolean | await(long timeoutMillis)
Implements io. |
private boolean | |
public Promise | awaitUninterruptibly()
Implements io. |
public boolean | awaitUninterruptibly(long timeout, TimeUnit unit)
Implements io. |
public boolean | awaitUninterruptibly(long timeoutMillis)
Implements io. |
public boolean | cancel(boolean
this value has no effect in this implementation. mayInterruptIfRunning)Implements io. |
public Throwable | cause()
Implements io. |
private Throwable | |
protected void | |
private synchronized boolean | Returns: true if there are any listeners attached to the promise, false otherwise.Check if there are any waiters and if so notify these. |
private void | |
protected EventExecutor | Returns: The executor used to notify listeners when this promise is complete.Get the executor used to notify listeners when this promise is complete. |
public V | get()
Overrides io. Implements java. |
public V | get(long
the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Overrides io. Implements java. |
public V | |
private void | |
public boolean | isCancellable()
Implements io. true if and only if the operation can be cancelled via cancel(boolean) .
|
public boolean | isCancelled()
Implements java. true if this task was cancelled before it completed
normally.
|
private static boolean | |
public boolean | |
private static boolean | |
public boolean | isSuccess()
Implements io. true if and only if the I/O operation was completed
successfully.
|
protected static void | notifyListener(EventExecutor
the executor to use to notify the listener eventExecutor, final Future<?> listener .the future that is complete. future, final GenericFutureListener<?> the listener to notify. listener)Notify a listener that a future has completed. |
private static void | |
private void | |
private void | |
private void | |
private static void | notifyListenerWithStackOverFlowProtection(final EventExecutor executor, final Future<?> future, final GenericFutureListener<?> listener)
The logic in this method should be identical to |
private static void | notifyProgressiveListener0(ProgressiveFuture<V> future, GenericProgressiveFutureListener<F extends ProgressiveFuture<?>> l, long progress, long total)
|
pack-priv void | notifyProgressiveListeners(final long
the new progress. progress, final long the total progress. total)Notify all progressive listeners. |
private static void | notifyProgressiveListeners0(ProgressiveFuture<?> future, GenericProgressiveFutureListener<?>[] listeners, long progress, long total)
|
private synchronized Object | progressiveListeners()
Returns a |
public Promise | removeListener(final GenericFutureListener<? extends Future<? super V>> listener)
Implements io. |
private void | |
public Promise | removeListeners(final GenericFutureListener<? extends Future<? super V>>... listeners)
Implements io. |
private void | |
private static void | |
public Promise | setFailure(Throwable cause)
Implements io. |
private boolean | |
public Promise | setSuccess(V result)
Implements io. |
private boolean | |
public boolean | setUncancellable()
Implements io. |
private boolean | |
public Promise | sync()
Implements io. |
public Promise | syncUninterruptibly()
Implements io. |
public String | |
protected StringBuilder | |
public boolean | tryFailure(Throwable cause)
Implements io. |
public boolean | trySuccess(V result)
Implements io. |