public class DefaultChannelPromise extends DefaultPromise<java.lang.Void> implements ChannelPromise
ChannelPromise
实现。
建议使用ChannelOutboundInvoker.newPromise()
创建新的ChannelPromise
,而不是显式调用构造函数。
Constructor and Description |
---|
DefaultChannelPromise(Channel channel)
创建一个新的实例。
|
DefaultChannelPromise(Channel channel, EventExecutor executor)
创建一个新的实例。
|
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilder, tryFailure, trySuccess
get, get
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setUncancellable, tryFailure, trySuccess
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
public DefaultChannelPromise(Channel channel)
channel
- 与此未来相关的Channel
public DefaultChannelPromise(Channel channel, EventExecutor executor)
channel
- 与此未来相关的Channel
protected EventExecutor executor()
DefaultPromise
假定该执行者将防止StackOverflowError
例外。 如果堆栈深度超过阈值,执行程序可以通过执行Runnable
来避免StackOverflowError
。
executor
在课程
DefaultPromise<java.lang.Void>
public Channel channel()
ChannelFuture
channel
接口
ChannelFuture
channel
接口
ChannelPromise
public ChannelPromise setSuccess()
setSuccess
在界面
ChannelPromise
public ChannelPromise setSuccess(java.lang.Void result)
Promise
复制的描述
IllegalStateException
。
setSuccess
在界面
ChannelPromise
setSuccess
在界面
Promise<java.lang.Void>
setSuccess
在课堂上
DefaultPromise<java.lang.Void>
public boolean trySuccess()
trySuccess
接口
ChannelPromise
public ChannelPromise setFailure(java.lang.Throwable cause)
Promise
IllegalStateException
。
setFailure
接口
ChannelPromise
setFailure
接口
Promise<java.lang.Void>
setFailure
DefaultPromise<java.lang.Void>
public ChannelPromise addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Future
addListener
在界面
ChannelFuture
addListener
接口
ChannelPromise
addListener
接口
Promise<java.lang.Void>
addListener
在课堂上
DefaultPromise<java.lang.Void>
public ChannelPromise addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Future
addListeners
接口
ChannelFuture
addListeners
接口
ChannelPromise
addListeners
在界面
Promise<java.lang.Void>
addListeners
在课堂上
DefaultPromise<java.lang.Void>
public ChannelPromise removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Future
复制的描述
removeListener
在界面
ChannelFuture
removeListener
,界面
ChannelPromise
removeListener
接口
Promise<java.lang.Void>
removeListener
在课堂上
DefaultPromise<java.lang.Void>
public ChannelPromise removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Future
removeListeners
在界面
ChannelFuture
removeListeners
接口
ChannelPromise
removeListeners
在界面
Promise<java.lang.Void>
removeListeners
在课堂上
DefaultPromise<java.lang.Void>
public ChannelPromise sync() throws java.lang.InterruptedException
Future
复制的描述
sync
接口
ChannelFuture
sync
接口
ChannelPromise
sync
在界面
Promise<java.lang.Void>
sync
DefaultPromise<java.lang.Void>
java.lang.InterruptedException
public ChannelPromise syncUninterruptibly()
Future
syncUninterruptibly
,界面
ChannelFuture
syncUninterruptibly
在界面
ChannelPromise
syncUninterruptibly
接口
Promise<java.lang.Void>
syncUninterruptibly
,上课
DefaultPromise<java.lang.Void>
public ChannelPromise await() throws java.lang.InterruptedException
Future
await
在界面
ChannelFuture
await
在界面
ChannelPromise
await
在界面
Promise<java.lang.Void>
await
在课堂上
DefaultPromise<java.lang.Void>
java.lang.InterruptedException
- 如果当前线程中断
public ChannelPromise awaitUninterruptibly()
Future
InterruptedException
并以静默方式丢弃它。
awaitUninterruptibly
接口
ChannelFuture
awaitUninterruptibly
,界面
ChannelPromise
awaitUninterruptibly
,界面
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()
ChannelPromise
复制的描述
ChannelFuture.isVoid()
本身返回true
则返回新的ChannelPromise
。
unvoid
接口
ChannelPromise
public boolean isVoid()
ChannelFuture
ChannelFuture
是无效未来,并且不允许调用以下任何方法,则返回true
:
isVoid
,界面
ChannelFuture
Copyright © 2008–2018 The Netty Project. All rights reserved.