public class DefaultChannelProgressivePromise extends DefaultProgressivePromise<java.lang.Void> implements ChannelProgressivePromise
ChannelProgressivePromise implementation. It is recommended to use
Channel.newProgressivePromise() to create a new ChannelProgressivePromise rather than calling the
constructor explicitly.| Constructor and Description |
|---|
DefaultChannelProgressivePromise(Channel channel)
Creates a new instance.
|
DefaultChannelProgressivePromise(Channel channel,
EventExecutor executor)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ChannelProgressivePromise |
addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Adds the specified listener to this future.
|
ChannelProgressivePromise |
addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Adds the specified listeners to this future.
|
ChannelProgressivePromise |
await()
Waits for this future to be completed.
|
ChannelProgressivePromise |
awaitUninterruptibly()
Waits for this future to be completed without
interruption.
|
Channel |
channel()
Returns a channel where the I/O operation associated with this
future takes place.
|
protected void |
checkDeadLock() |
protected EventExecutor |
executor()
Get the executor used to notify listeners when this promise is complete.
|
long |
flushCheckpoint() |
void |
flushCheckpoint(long checkpoint) |
ChannelProgressivePromise |
promise() |
ChannelProgressivePromise |
removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Removes the first occurrence of the specified listener from this future.
|
ChannelProgressivePromise |
removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
ChannelProgressivePromise |
setFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
ChannelProgressivePromise |
setProgress(long progress,
long total)
Sets the current progress of the operation and notifies the listeners that implement
GenericProgressiveFutureListener. |
ChannelProgressivePromise |
setSuccess() |
ChannelProgressivePromise |
setSuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
ChannelProgressivePromise |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
ChannelProgressivePromise |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
boolean |
trySuccess() |
tryProgressawait, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilder, tryFailure, trySuccessget, getclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittryProgresssetUncancellable, tryFailure, trySuccessawait, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccesspublic DefaultChannelProgressivePromise(Channel channel)
channel - the Channel associated with this futurepublic DefaultChannelProgressivePromise(Channel channel, EventExecutor executor)
channel - the Channel associated with this futureprotected EventExecutor executor()
DefaultPromise
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.
executor in class DefaultPromise<java.lang.Void>public Channel channel()
ChannelFuturechannel in interface ChannelFuturechannel in interface ChannelPromisepublic ChannelProgressivePromise setSuccess()
setSuccess in interface ChannelProgressivePromisesetSuccess in interface ChannelPromisepublic ChannelProgressivePromise setSuccess(java.lang.Void result)
PromiseIllegalStateException.setSuccess in interface ChannelProgressivePromisesetSuccess in interface ChannelPromisesetSuccess in interface ProgressivePromise<java.lang.Void>setSuccess in interface Promise<java.lang.Void>setSuccess in class DefaultProgressivePromise<java.lang.Void>public boolean trySuccess()
trySuccess in interface ChannelPromisepublic ChannelProgressivePromise setFailure(java.lang.Throwable cause)
PromiseIllegalStateException.setFailure in interface ChannelProgressivePromisesetFailure in interface ChannelPromisesetFailure in interface ProgressivePromise<java.lang.Void>setFailure in interface Promise<java.lang.Void>setFailure in class DefaultProgressivePromise<java.lang.Void>public ChannelProgressivePromise setProgress(long progress, long total)
ProgressivePromiseGenericProgressiveFutureListener.setProgress in interface ChannelProgressivePromisesetProgress in interface ProgressivePromise<java.lang.Void>setProgress in class DefaultProgressivePromise<java.lang.Void>public ChannelProgressivePromise addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureaddListener in interface ChannelFutureaddListener in interface ChannelProgressiveFutureaddListener in interface ChannelProgressivePromiseaddListener in interface ChannelPromiseaddListener in interface ProgressiveFuture<java.lang.Void>addListener in interface ProgressivePromise<java.lang.Void>addListener in interface Promise<java.lang.Void>addListener in class DefaultProgressivePromise<java.lang.Void>public ChannelProgressivePromise addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureaddListeners in interface ChannelFutureaddListeners in interface ChannelProgressiveFutureaddListeners in interface ChannelProgressivePromiseaddListeners in interface ChannelPromiseaddListeners in interface ProgressiveFuture<java.lang.Void>addListeners in interface ProgressivePromise<java.lang.Void>addListeners in interface Promise<java.lang.Void>addListeners in class DefaultProgressivePromise<java.lang.Void>public ChannelProgressivePromise removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureremoveListener in interface ChannelFutureremoveListener in interface ChannelProgressiveFutureremoveListener in interface ChannelProgressivePromiseremoveListener in interface ChannelPromiseremoveListener in interface ProgressiveFuture<java.lang.Void>removeListener in interface ProgressivePromise<java.lang.Void>removeListener in interface Promise<java.lang.Void>removeListener in class DefaultProgressivePromise<java.lang.Void>public ChannelProgressivePromise removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureremoveListeners in interface ChannelFutureremoveListeners in interface ChannelProgressiveFutureremoveListeners in interface ChannelProgressivePromiseremoveListeners in interface ChannelPromiseremoveListeners in interface ProgressiveFuture<java.lang.Void>removeListeners in interface ProgressivePromise<java.lang.Void>removeListeners in interface Promise<java.lang.Void>removeListeners in class DefaultProgressivePromise<java.lang.Void>public ChannelProgressivePromise sync() throws java.lang.InterruptedException
Futuresync in interface ChannelFuturesync in interface ChannelProgressiveFuturesync in interface ChannelProgressivePromisesync in interface ChannelPromisesync in interface ProgressiveFuture<java.lang.Void>sync in interface ProgressivePromise<java.lang.Void>sync in interface Promise<java.lang.Void>sync in class DefaultProgressivePromise<java.lang.Void>java.lang.InterruptedExceptionpublic ChannelProgressivePromise syncUninterruptibly()
FuturesyncUninterruptibly in interface ChannelFuturesyncUninterruptibly in interface ChannelProgressiveFuturesyncUninterruptibly in interface ChannelProgressivePromisesyncUninterruptibly in interface ChannelPromisesyncUninterruptibly in interface ProgressiveFuture<java.lang.Void>syncUninterruptibly in interface ProgressivePromise<java.lang.Void>syncUninterruptibly in interface Promise<java.lang.Void>syncUninterruptibly in class DefaultProgressivePromise<java.lang.Void>public ChannelProgressivePromise await() throws java.lang.InterruptedException
Futureawait in interface ChannelFutureawait in interface ChannelProgressiveFutureawait in interface ChannelProgressivePromiseawait in interface ChannelPromiseawait in interface ProgressiveFuture<java.lang.Void>await in interface ProgressivePromise<java.lang.Void>await in interface Promise<java.lang.Void>await in class DefaultProgressivePromise<java.lang.Void>java.lang.InterruptedException - if the current thread was interruptedpublic ChannelProgressivePromise awaitUninterruptibly()
FutureInterruptedException and
discards it silently.awaitUninterruptibly in interface ChannelFutureawaitUninterruptibly in interface ChannelProgressiveFutureawaitUninterruptibly in interface ChannelProgressivePromiseawaitUninterruptibly in interface ChannelPromiseawaitUninterruptibly in interface ProgressiveFuture<java.lang.Void>awaitUninterruptibly in interface ProgressivePromise<java.lang.Void>awaitUninterruptibly in interface Promise<java.lang.Void>awaitUninterruptibly in class DefaultProgressivePromise<java.lang.Void>public long flushCheckpoint()
public void flushCheckpoint(long checkpoint)
public ChannelProgressivePromise promise()
protected void checkDeadLock()
checkDeadLock in class DefaultPromise<java.lang.Void>Copyright © 2008–2018 The Netty Project. All rights reserved.