public class DefaultChannelPromise extends DefaultPromise<Void> implements ChannelPromise
ChannelPromise implementation. It is recommended to use Channel.newPromise() to create
a new ChannelPromise rather than calling the constructor explicitly.| Constructor and Description |
|---|
DefaultChannelPromise(Channel channel)
Creates a new instance.
|
DefaultChannelPromise(Channel channel,
EventExecutor executor)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ChannelPromise |
addListener(GenericFutureListener<? extends Future<? super Void>> listener)
Adds the specified listener to this future.
|
ChannelPromise |
addListeners(GenericFutureListener<? extends Future<? super 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()
Do deadlock checks
|
protected EventExecutor |
executor() |
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 Void>> listener)
Removes the specified listener from this future.
|
ChannelPromise |
removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)
Removes the specified listeners from this future.
|
ChannelPromise |
setFailure(Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
ChannelPromise |
setSuccess() |
ChannelPromise |
setSuccess(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, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilder, tryFailure, trySuccessget, getclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetUncancellable, tryFailure, trySuccessawait, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccessget, get, isCancelled, isDonepublic DefaultChannelPromise(Channel channel)
channel - the Channel associated with this futurepublic DefaultChannelPromise(Channel channel, EventExecutor executor)
channel - the Channel associated with this futureprotected EventExecutor executor()
executor in class DefaultPromise<Void>public Channel channel()
ChannelFuturechannel in interface ChannelFuturechannel in interface ChannelPromisepublic ChannelPromise setSuccess()
setSuccess in interface ChannelPromisepublic ChannelPromise setSuccess(Void result)
PromiseIllegalStateException.setSuccess in interface ChannelPromisesetSuccess in interface Promise<Void>setSuccess in class DefaultPromise<Void>public boolean trySuccess()
trySuccess in interface ChannelPromisepublic ChannelPromise setFailure(Throwable cause)
PromiseIllegalStateException.setFailure in interface ChannelPromisesetFailure in interface Promise<Void>setFailure in class DefaultPromise<Void>public ChannelPromise addListener(GenericFutureListener<? extends Future<? super Void>> listener)
FutureaddListener in interface ChannelFutureaddListener in interface ChannelPromiseaddListener in interface Promise<Void>addListener in class DefaultPromise<Void>public ChannelPromise addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)
FutureaddListeners in interface ChannelFutureaddListeners in interface ChannelPromiseaddListeners in interface Promise<Void>addListeners in class DefaultPromise<Void>public ChannelPromise removeListener(GenericFutureListener<? extends Future<? super Void>> listener)
FutureremoveListener in interface ChannelFutureremoveListener in interface ChannelPromiseremoveListener in interface Promise<Void>removeListener in class DefaultPromise<Void>public ChannelPromise removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)
FutureremoveListeners in interface ChannelFutureremoveListeners in interface ChannelPromiseremoveListeners in interface Promise<Void>removeListeners in class DefaultPromise<Void>public ChannelPromise sync() throws InterruptedException
Futuresync in interface ChannelFuturesync in interface ChannelPromisesync in interface Promise<Void>sync in class DefaultPromise<Void>InterruptedExceptionpublic ChannelPromise syncUninterruptibly()
FuturesyncUninterruptibly in interface ChannelFuturesyncUninterruptibly in interface ChannelPromisesyncUninterruptibly in interface Promise<Void>syncUninterruptibly in class DefaultPromise<Void>public ChannelPromise await() throws InterruptedException
Futureawait in interface ChannelFutureawait in interface ChannelPromiseawait in interface Promise<Void>await in class DefaultPromise<Void>InterruptedException - if the current thread was interruptedpublic ChannelPromise awaitUninterruptibly()
FutureInterruptedException and
discards it silently.awaitUninterruptibly in interface ChannelFutureawaitUninterruptibly in interface ChannelPromiseawaitUninterruptibly in interface Promise<Void>awaitUninterruptibly in class DefaultPromise<Void>public long flushCheckpoint()
public void flushCheckpoint(long checkpoint)
public ChannelPromise promise()
protected void checkDeadLock()
DefaultPromisecheckDeadLock in class DefaultPromise<Void>public ChannelPromise unvoid()
ChannelPromiseunvoid in interface ChannelPromisepublic boolean isVoid()
ChannelFuturetrue if this ChannelFuture is a void future and so not allow to call any of the
following methods:
isVoid in interface ChannelFutureCopyright © 2008–2015 The Netty Project. All rights reserved.