Package io.netty.channel
Interface ChannelPromise
-
- All Superinterfaces:
ChannelFuture,Future<java.lang.Void>,java.util.concurrent.Future<java.lang.Void>,Promise<java.lang.Void>
- All Known Subinterfaces:
ChannelProgressivePromise
- All Known Implementing Classes:
DefaultChannelProgressivePromise,DefaultChannelPromise,DelegatingChannelPromiseNotifier,VoidChannelPromise
public interface ChannelPromise extends ChannelFuture, Promise<java.lang.Void>
SpecialChannelFuturewhich is writable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChannelPromiseaddListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)Adds the specified listener to this future.ChannelPromiseaddListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)Adds the specified listeners to this future.ChannelPromiseawait()Waits for this future to be completed.ChannelPromiseawaitUninterruptibly()Waits for this future to be completed without interruption.Channelchannel()Returns a channel where the I/O operation associated with this future takes place.ChannelPromiseremoveListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)Removes the first occurrence of the specified listener from this future.ChannelPromiseremoveListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)Removes the first occurrence for each of the listeners from this future.ChannelPromisesetFailure(java.lang.Throwable cause)Marks this future as a failure and notifies all listeners.ChannelPromisesetSuccess()ChannelPromisesetSuccess(java.lang.Void result)Marks this future as a success and notifies all listeners.ChannelPromisesync()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.ChannelPromisesyncUninterruptibly()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.booleantrySuccess()ChannelPromiseunvoid()-
Methods inherited from interface io.netty.channel.ChannelFuture
isVoid
-
Methods inherited from interface io.netty.util.concurrent.Future
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
-
Methods inherited from interface io.netty.util.concurrent.Promise
setUncancellable, tryFailure, trySuccess
-
-
-
-
Method Detail
-
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
ChannelPromise setSuccess(java.lang.Void result)
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<java.lang.Void>
-
setSuccess
ChannelPromise setSuccess()
-
trySuccess
boolean trySuccess()
-
setFailure
ChannelPromise setFailure(java.lang.Throwable cause)
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<java.lang.Void>
-
addListener
ChannelPromise addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
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<java.lang.Void>- Specified by:
addListenerin interfacePromise<java.lang.Void>
-
addListeners
ChannelPromise addListeners(GenericFutureListener<? extends Future<? super java.lang.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<java.lang.Void>- Specified by:
addListenersin interfacePromise<java.lang.Void>
-
removeListener
ChannelPromise removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
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<java.lang.Void>- Specified by:
removeListenerin interfacePromise<java.lang.Void>
-
removeListeners
ChannelPromise removeListeners(GenericFutureListener<? extends Future<? super java.lang.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<java.lang.Void>- Specified by:
removeListenersin interfacePromise<java.lang.Void>
-
sync
ChannelPromise sync() throws java.lang.InterruptedException
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.
-
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<java.lang.Void>- Specified by:
syncUninterruptiblyin interfacePromise<java.lang.Void>
-
await
ChannelPromise await() throws java.lang.InterruptedException
Description copied from interface:FutureWaits for this future to be completed.
-
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<java.lang.Void>- Specified by:
awaitUninterruptiblyin interfacePromise<java.lang.Void>
-
unvoid
ChannelPromise unvoid()
-
-