Interface ChannelPromise
- All Known Subinterfaces:
ChannelProgressivePromise
- All Known Implementing Classes:
DefaultChannelProgressivePromise, DefaultChannelPromise, DelegatingChannelPromiseNotifier, VoidChannelPromise
Special
ChannelFuture which is writable.-
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.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.setFailure(Throwable cause) Marks this future as a failure and notifies all listeners.setSuccess(Void result) Marks this future as a success and notifies all listeners.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.booleanunvoid()Methods inherited from interface ChannelFuture
isVoidMethods inherited from interface Future
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccessMethods inherited from interface Future
get, get, isCancelled, isDoneMethods inherited from interface Promise
setUncancellable, tryFailure, trySuccess
-
Method Details
-
channel
Channel channel()Description copied from interface:ChannelFutureReturns a channel where the I/O operation associated with this future takes place.- Specified by:
channelin interfaceChannelFuture
-
setSuccess
Description copied from interface:PromiseMarks this future as a success and notifies all listeners. If it is success or failed already it will throw anIllegalStateException.- Specified by:
setSuccessin interfacePromise<Void>
-
setSuccess
ChannelPromise setSuccess() -
trySuccess
boolean trySuccess() -
setFailure
Description copied from interface:PromiseMarks this future as a failure and notifies all listeners. If it is success or failed already it will throw anIllegalStateException.- Specified by:
setFailurein interfacePromise<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>- Specified by:
addListenerin interfacePromise<Void>
-
addListeners
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>- Specified by:
addListenersin interfacePromise<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>- Specified by:
removeListenerin interfacePromise<Void>
-
removeListeners
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>- Specified by:
removeListenersin interfacePromise<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>- Specified by:
syncin interfacePromise<Void>- Throws:
InterruptedException
-
syncUninterruptibly
ChannelPromise 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>- Specified by:
syncUninterruptiblyin interfacePromise<Void>
-
await
Description copied from interface:FutureWaits for this future to be completed.- Specified by:
awaitin interfaceChannelFuture- Specified by:
awaitin interfaceFuture<Void>- Specified by:
awaitin interfacePromise<Void>- Throws:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
ChannelPromise 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>- Specified by:
awaitUninterruptiblyin interfacePromise<Void>
-
unvoid
ChannelPromise unvoid()
-