public class DefaultChannelPromise extends DefaultPromise<java.lang.Void> implements ChannelPromise
ChannelPromise implementation. It is recommended to use ChannelOutboundInvoker.newPromise() to create
a new ChannelPromise rather than calling the constructor explicitly.| 构造器和说明 |
|---|
DefaultChannelPromise(Channel channel)
Creates a new instance.
|
DefaultChannelPromise(Channel channel,
EventExecutor executor)
Creates a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
ChannelPromise |
addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Adds the specified listener to this future.
|
ChannelPromise |
addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Adds the specified listeners to this future.
|
ChannelPromise |
await()
Waits for this future to be completed.
|
ChannelPromise |
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) |
boolean |
isVoid()
Returns
true if this ChannelFuture is a void future and so not allow to call any of the
following methods:
ChannelFuture.addListener(GenericFutureListener)
ChannelFuture.addListeners(GenericFutureListener[])
ChannelFuture.await()
Future.await(long, TimeUnit) ()}
Future.await(long) ()}
ChannelFuture.awaitUninterruptibly()
ChannelFuture.sync()
ChannelFuture.syncUninterruptibly()
|
ChannelPromise |
promise() |
ChannelPromise |
removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Removes the first occurrence of the specified listener from this future.
|
ChannelPromise |
removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
ChannelPromise |
setFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
ChannelPromise |
setSuccess() |
ChannelPromise |
setSuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
ChannelPromise |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
ChannelPromise |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
boolean |
trySuccess() |
ChannelPromise |
unvoid()
|
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, get, get, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilder, tryFailure, trySuccessclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetUncancellable, tryFailure, trySuccessawait, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccesspublic DefaultChannelPromise(Channel channel)
channel - the Channel associated with this futurepublic DefaultChannelPromise(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 在类中 DefaultPromise<java.lang.Void>public Channel channel()
ChannelFuturechannel 在接口中 ChannelFuturechannel 在接口中 ChannelPromisepublic ChannelPromise setSuccess()
setSuccess 在接口中 ChannelPromisepublic ChannelPromise setSuccess(java.lang.Void result)
PromiseIllegalStateException.setSuccess 在接口中 ChannelPromisesetSuccess 在接口中 Promise<java.lang.Void>setSuccess 在类中 DefaultPromise<java.lang.Void>public boolean trySuccess()
trySuccess 在接口中 ChannelPromisepublic ChannelPromise setFailure(java.lang.Throwable cause)
PromiseIllegalStateException.setFailure 在接口中 ChannelPromisesetFailure 在接口中 Promise<java.lang.Void>setFailure 在类中 DefaultPromise<java.lang.Void>public ChannelPromise addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureaddListener 在接口中 ChannelFutureaddListener 在接口中 ChannelPromiseaddListener 在接口中 Promise<java.lang.Void>addListener 在类中 DefaultPromise<java.lang.Void>public ChannelPromise addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureaddListeners 在接口中 ChannelFutureaddListeners 在接口中 ChannelPromiseaddListeners 在接口中 Promise<java.lang.Void>addListeners 在类中 DefaultPromise<java.lang.Void>public ChannelPromise removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
FutureremoveListener 在接口中 ChannelFutureremoveListener 在接口中 ChannelPromiseremoveListener 在接口中 Promise<java.lang.Void>removeListener 在类中 DefaultPromise<java.lang.Void>public ChannelPromise removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
FutureremoveListeners 在接口中 ChannelFutureremoveListeners 在接口中 ChannelPromiseremoveListeners 在接口中 Promise<java.lang.Void>removeListeners 在类中 DefaultPromise<java.lang.Void>public ChannelPromise sync() throws java.lang.InterruptedException
Futuresync 在接口中 ChannelFuturesync 在接口中 ChannelPromisesync 在接口中 Promise<java.lang.Void>sync 在类中 DefaultPromise<java.lang.Void>java.lang.InterruptedExceptionpublic ChannelPromise syncUninterruptibly()
FuturesyncUninterruptibly 在接口中 ChannelFuturesyncUninterruptibly 在接口中 ChannelPromisesyncUninterruptibly 在接口中 Promise<java.lang.Void>syncUninterruptibly 在类中 DefaultPromise<java.lang.Void>public ChannelPromise await() throws java.lang.InterruptedException
Futureawait 在接口中 ChannelFutureawait 在接口中 ChannelPromiseawait 在接口中 Promise<java.lang.Void>await 在类中 DefaultPromise<java.lang.Void>java.lang.InterruptedException - if the current thread was interruptedpublic ChannelPromise awaitUninterruptibly()
FutureInterruptedException and
discards it silently.awaitUninterruptibly 在接口中 ChannelFutureawaitUninterruptibly 在接口中 ChannelPromiseawaitUninterruptibly 在接口中 Promise<java.lang.Void>awaitUninterruptibly 在类中 DefaultPromise<java.lang.Void>public long flushCheckpoint()
public void flushCheckpoint(long checkpoint)
public ChannelPromise promise()
protected void checkDeadLock()
checkDeadLock 在类中 DefaultPromise<java.lang.Void>public ChannelPromise unvoid()
ChannelPromiseunvoid 在接口中 ChannelPromisepublic boolean isVoid()
ChannelFuturetrue if this ChannelFuture is a void future and so not allow to call any of the
following methods:
isVoid 在接口中 ChannelFuture