Class CompleteChannelFuture
- All Implemented Interfaces:
ChannelFuture, Future<Void>, Future<Void>
- Direct Known Subclasses:
FailedChannelFuture, SucceededChannelFuture
A skeletal
ChannelFuture implementation which represents a
ChannelFuture which has been completed already.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompleteChannelFuture(Channel channel, EventExecutor executor) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionaddListener(GenericFutureListener<? extends Future<? super Void>> listener) Adds the specified listener to this future.addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Adds the specified listeners to this future.await()Waits for this future to be completed.Waits for this future to be completed without interruption.channel()Returns a channel where the I/O operation associated with this future takes place.protected EventExecutorexecutor()Return theEventExecutorwhich is used by thisCompleteFuture.getNow()Return the result without blocking.booleanisVoid()Returnstrueif thisChannelFutureis 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()removeListener(GenericFutureListener<? extends Future<? super Void>> listener) Removes the first occurrence of the specified listener from this future.removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Removes the first occurrence for each of the listeners from this future.sync()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.Waits for this future until it is done, and rethrows the cause of the failure if this future failed.Methods inherited from class CompleteFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, isCancellable, isCancelled, isDoneMethods inherited from class AbstractFuture
get, getMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Future
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, isCancellable, isSuccessMethods inherited from interface Future
get, get, isCancelled, isDone
-
Field Details
-
channel
-
-
Constructor Details
-
CompleteChannelFuture
Creates a new instance.- Parameters:
channel- theChannelassociated with this future
-
-
Method Details
-
executor
Description copied from class:CompleteFutureReturn theEventExecutorwhich is used by thisCompleteFuture.- Overrides:
executorin classCompleteFuture<Void>
-
addListener
Description copied from interface:FutureAdds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.- Specified by:
addListenerin interfaceChannelFuture- Specified by:
addListenerin interfaceFuture<Void>- Overrides:
addListenerin classCompleteFuture<Void>
-
addListeners
public ChannelFuture addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:FutureAdds the specified listeners to this future. The specified listeners are notified when this future is done. If this future is already completed, the specified listeners are notified immediately.- Specified by:
addListenersin interfaceChannelFuture- Specified by:
addListenersin interfaceFuture<Void>- Overrides:
addListenersin classCompleteFuture<Void>
-
removeListener
Description copied from interface:FutureRemoves the first occurrence of the specified listener from this future. The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.- Specified by:
removeListenerin interfaceChannelFuture- Specified by:
removeListenerin interfaceFuture<Void>- Overrides:
removeListenerin classCompleteFuture<Void>
-
removeListeners
public ChannelFuture removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:FutureRemoves the first occurrence for each of the listeners from this future. The specified listeners are no longer notified when this future is done. If the specified listeners are not associated with this future, this method does nothing and returns silently.- Specified by:
removeListenersin interfaceChannelFuture- Specified by:
removeListenersin interfaceFuture<Void>- Overrides:
removeListenersin classCompleteFuture<Void>
-
syncUninterruptibly
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptiblyin interfaceChannelFuture- Specified by:
syncUninterruptiblyin interfaceFuture<Void>- Overrides:
syncUninterruptiblyin classCompleteFuture<Void>
-
sync
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncin interfaceChannelFuture- Specified by:
syncin interfaceFuture<Void>- Overrides:
syncin classCompleteFuture<Void>- Throws:
InterruptedException
-
await
Description copied from interface:FutureWaits for this future to be completed.- Specified by:
awaitin interfaceChannelFuture- Specified by:
awaitin interfaceFuture<Void>- Overrides:
awaitin classCompleteFuture<Void>- Throws:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
Description copied from interface:FutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceChannelFuture- Specified by:
awaitUninterruptiblyin interfaceFuture<Void>- Overrides:
awaitUninterruptiblyin classCompleteFuture<Void>
-
channel
Description copied from interface:ChannelFutureReturns a channel where the I/O operation associated with this future takes place.- Specified by:
channelin interfaceChannelFuture
-
getNow
Description copied from interface:FutureReturn the result without blocking. If the future is not done yet this will returnnull.As it is possible that a
nullvalue is used to mark the future as successful you also need to check if the future is really done withFuture.isDone()and not rely on the returnednullvalue. -
isVoid
public boolean isVoid()Description copied from interface:ChannelFutureReturnstrueif thisChannelFutureis a void future and so not allow to call any of the following methods:- Specified by:
isVoidin interfaceChannelFuture
-