abstract class CompleteChannelFuture extends CompleteFuture<java.lang.Void> implements ChannelFuture
ChannelFuture
implementation which represents a
ChannelFuture
which has been completed already.Modifier | Constructor and Description |
---|---|
protected |
CompleteChannelFuture(Channel channel,
EventExecutor executor)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
ChannelFuture |
addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Adds the specified listener to this future.
|
ChannelFuture |
addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Adds the specified listeners to this future.
|
ChannelFuture |
await()
Waits for this future to be completed.
|
ChannelFuture |
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 EventExecutor |
executor()
Return the
EventExecutor which is used by this CompleteFuture . |
java.lang.Void |
getNow()
Return the result without blocking.
|
ChannelFuture |
removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Removes the first occurrence of the specified listener from this future.
|
ChannelFuture |
removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
ChannelFuture |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
ChannelFuture |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, isCancellable, isCancelled, isDone
get, get
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, isCancellable, isSuccess
private final Channel channel
protected CompleteChannelFuture(Channel channel, EventExecutor executor)
channel
- the Channel
associated with this futureprotected EventExecutor executor()
CompleteFuture
EventExecutor
which is used by this CompleteFuture
.executor
in class CompleteFuture<java.lang.Void>
public ChannelFuture addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Future
addListener
in interface ChannelFuture
addListener
in class CompleteFuture<java.lang.Void>
public ChannelFuture addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Future
addListeners
in interface ChannelFuture
addListeners
in class CompleteFuture<java.lang.Void>
public ChannelFuture removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
Future
removeListener
in interface ChannelFuture
removeListener
in class CompleteFuture<java.lang.Void>
public ChannelFuture removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
Future
removeListeners
in interface ChannelFuture
removeListeners
in class CompleteFuture<java.lang.Void>
public ChannelFuture syncUninterruptibly()
Future
syncUninterruptibly
in interface ChannelFuture
syncUninterruptibly
in class CompleteFuture<java.lang.Void>
public ChannelFuture sync() throws java.lang.InterruptedException
Future
sync
in interface ChannelFuture
sync
in class CompleteFuture<java.lang.Void>
java.lang.InterruptedException
public ChannelFuture await() throws java.lang.InterruptedException
Future
await
in interface ChannelFuture
await
in class CompleteFuture<java.lang.Void>
java.lang.InterruptedException
- if the current thread was interruptedpublic ChannelFuture awaitUninterruptibly()
Future
InterruptedException
and
discards it silently.awaitUninterruptibly
in interface ChannelFuture
awaitUninterruptibly
in class CompleteFuture<java.lang.Void>
public Channel channel()
ChannelFuture
channel
in interface ChannelFuture
public java.lang.Void getNow()
Future
null
.
As it is possible that a null
value is used to mark the future as successful you also need to check
if the future is really done with Future.isDone()
and not relay on the returned null
value.