Package io.netty.channel
Interface ChannelProgressivePromise
- All Superinterfaces:
ChannelFuture
,ChannelProgressiveFuture
,ChannelPromise
,Future<Void>
,Future<Void>
,ProgressiveFuture<Void>
,ProgressivePromise<Void>
,Promise<Void>
- All Known Implementing Classes:
DefaultChannelProgressivePromise
public interface ChannelProgressivePromise
extends ProgressivePromise<Void>, ChannelProgressiveFuture, ChannelPromise
Special
ChannelPromise
which will be notified once the associated bytes is transferring.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
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.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.setProgress
(long progress, long total) Sets the current progress of the operation and notifies the listeners that implementGenericProgressiveFutureListener
.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.unvoid()
Methods inherited from interface io.netty.channel.ChannelFuture
isVoid
Methods inherited from interface io.netty.channel.ChannelPromise
channel, trySuccess
Methods inherited from interface io.netty.util.concurrent.Future
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
Methods inherited from interface java.util.concurrent.Future
exceptionNow, get, get, isCancelled, isDone, resultNow, state
Methods inherited from interface io.netty.util.concurrent.ProgressivePromise
tryProgress
Methods inherited from interface io.netty.util.concurrent.Promise
setUncancellable, tryFailure, trySuccess
-
Method Details
-
addListener
ChannelProgressivePromise addListener(GenericFutureListener<? extends Future<? super Void>> listener) Description copied from interface:Future
Adds 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:
addListener
in interfaceChannelFuture
- Specified by:
addListener
in interfaceChannelProgressiveFuture
- Specified by:
addListener
in interfaceChannelPromise
- Specified by:
addListener
in interfaceFuture<Void>
- Specified by:
addListener
in interfaceProgressiveFuture<Void>
- Specified by:
addListener
in interfaceProgressivePromise<Void>
- Specified by:
addListener
in interfacePromise<Void>
-
addListeners
ChannelProgressivePromise addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:Future
Adds 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:
addListeners
in interfaceChannelFuture
- Specified by:
addListeners
in interfaceChannelProgressiveFuture
- Specified by:
addListeners
in interfaceChannelPromise
- Specified by:
addListeners
in interfaceFuture<Void>
- Specified by:
addListeners
in interfaceProgressiveFuture<Void>
- Specified by:
addListeners
in interfaceProgressivePromise<Void>
- Specified by:
addListeners
in interfacePromise<Void>
-
removeListener
ChannelProgressivePromise removeListener(GenericFutureListener<? extends Future<? super Void>> listener) Description copied from interface:Future
Removes 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:
removeListener
in interfaceChannelFuture
- Specified by:
removeListener
in interfaceChannelProgressiveFuture
- Specified by:
removeListener
in interfaceChannelPromise
- Specified by:
removeListener
in interfaceFuture<Void>
- Specified by:
removeListener
in interfaceProgressiveFuture<Void>
- Specified by:
removeListener
in interfaceProgressivePromise<Void>
- Specified by:
removeListener
in interfacePromise<Void>
-
removeListeners
ChannelProgressivePromise removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners) Description copied from interface:Future
Removes 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:
removeListeners
in interfaceChannelFuture
- Specified by:
removeListeners
in interfaceChannelProgressiveFuture
- Specified by:
removeListeners
in interfaceChannelPromise
- Specified by:
removeListeners
in interfaceFuture<Void>
- Specified by:
removeListeners
in interfaceProgressiveFuture<Void>
- Specified by:
removeListeners
in interfaceProgressivePromise<Void>
- Specified by:
removeListeners
in interfacePromise<Void>
-
sync
Description copied from interface:Future
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
sync
in interfaceChannelFuture
- Specified by:
sync
in interfaceChannelProgressiveFuture
- Specified by:
sync
in interfaceChannelPromise
- Specified by:
sync
in interfaceFuture<Void>
- Specified by:
sync
in interfaceProgressiveFuture<Void>
- Specified by:
sync
in interfaceProgressivePromise<Void>
- Specified by:
sync
in interfacePromise<Void>
- Throws:
InterruptedException
-
syncUninterruptibly
ChannelProgressivePromise syncUninterruptibly()Description copied from interface:Future
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptibly
in interfaceChannelFuture
- Specified by:
syncUninterruptibly
in interfaceChannelProgressiveFuture
- Specified by:
syncUninterruptibly
in interfaceChannelPromise
- Specified by:
syncUninterruptibly
in interfaceFuture<Void>
- Specified by:
syncUninterruptibly
in interfaceProgressiveFuture<Void>
- Specified by:
syncUninterruptibly
in interfaceProgressivePromise<Void>
- Specified by:
syncUninterruptibly
in interfacePromise<Void>
-
await
Description copied from interface:Future
Waits for this future to be completed.- Specified by:
await
in interfaceChannelFuture
- Specified by:
await
in interfaceChannelProgressiveFuture
- Specified by:
await
in interfaceChannelPromise
- Specified by:
await
in interfaceFuture<Void>
- Specified by:
await
in interfaceProgressiveFuture<Void>
- Specified by:
await
in interfaceProgressivePromise<Void>
- Specified by:
await
in interfacePromise<Void>
- Throws:
InterruptedException
- if the current thread was interrupted
-
awaitUninterruptibly
ChannelProgressivePromise awaitUninterruptibly()Description copied from interface:Future
Waits for this future to be completed without interruption. This method catches anInterruptedException
and discards it silently.- Specified by:
awaitUninterruptibly
in interfaceChannelFuture
- Specified by:
awaitUninterruptibly
in interfaceChannelProgressiveFuture
- Specified by:
awaitUninterruptibly
in interfaceChannelPromise
- Specified by:
awaitUninterruptibly
in interfaceFuture<Void>
- Specified by:
awaitUninterruptibly
in interfaceProgressiveFuture<Void>
- Specified by:
awaitUninterruptibly
in interfaceProgressivePromise<Void>
- Specified by:
awaitUninterruptibly
in interfacePromise<Void>
-
setSuccess
Description copied from interface:Promise
Marks this future as a success and notifies all listeners. If it is success or failed already it will throw anIllegalStateException
.- Specified by:
setSuccess
in interfaceChannelPromise
- Specified by:
setSuccess
in interfaceProgressivePromise<Void>
- Specified by:
setSuccess
in interfacePromise<Void>
-
setSuccess
ChannelProgressivePromise setSuccess()- Specified by:
setSuccess
in interfaceChannelPromise
-
setFailure
Description copied from interface:Promise
Marks this future as a failure and notifies all listeners. If it is success or failed already it will throw anIllegalStateException
.- Specified by:
setFailure
in interfaceChannelPromise
- Specified by:
setFailure
in interfaceProgressivePromise<Void>
- Specified by:
setFailure
in interfacePromise<Void>
-
setProgress
Description copied from interface:ProgressivePromise
Sets the current progress of the operation and notifies the listeners that implementGenericProgressiveFutureListener
.- Specified by:
setProgress
in interfaceProgressivePromise<Void>
-
unvoid
ChannelProgressivePromise unvoid()Description copied from interface:ChannelPromise
- Specified by:
unvoid
in interfaceChannelPromise
-