Package io.netty.handler.codec.http2
Class Http2CodecUtil.SimpleChannelPromiseAggregator
java.lang.Object
io.netty.util.concurrent.AbstractFuture<Void>
io.netty.util.concurrent.DefaultPromise<Void>
io.netty.channel.DefaultChannelPromise
io.netty.handler.codec.http2.Http2CodecUtil.SimpleChannelPromiseAggregator
- All Implemented Interfaces:
ChannelFlushPromiseNotifier.FlushCheckpoint,ChannelFuture,ChannelPromise,Future<Void>,Promise<Void>,Future<Void>
- Enclosing class:
Http2CodecUtil
Provides the ability to associate the outcome of multiple
ChannelPromise
objects into a single ChannelPromise object.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Throwableprivate booleanprivate intprivate intprivate final ChannelPromiseFields inherited from class io.netty.util.concurrent.DefaultPromise
PROPERTY_MAX_LISTENER_STACK_DEPTH -
Constructor Summary
ConstructorsConstructorDescriptionSimpleChannelPromiseAggregator(ChannelPromise promise, Channel c, EventExecutor e) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprivate booleanprivate booleanSignify that no morenewPromise()allocations will be made.Allocate a new promise which will be used to aggregate the overall success of this promise aggregator.private voidsetAggregateFailure(Throwable cause) setFailure(Throwable cause) Fail this object if it has not already been failed.private ChannelPromisesetSuccess(Void result) Marks this future as a success and notifies all listeners.booleantryFailure(Throwable cause) Marks this future as a failure and notifies all listeners.private booleanbooleantrySuccess(Void result) Marks this future as a success and notifies all listeners.Methods inherited from class io.netty.channel.DefaultChannelPromise
addListener, addListeners, await, awaitUninterruptibly, channel, checkDeadLock, executor, flushCheckpoint, flushCheckpoint, isVoid, promise, removeListener, removeListeners, setSuccess, sync, syncUninterruptibly, trySuccess, unvoidMethods inherited from class io.netty.util.concurrent.DefaultPromise
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, get, get, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.netty.util.concurrent.Future
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccessMethods inherited from interface java.util.concurrent.Future
exceptionNow, get, get, isCancelled, isDone, resultNow, stateMethods inherited from interface io.netty.util.concurrent.Promise
setUncancellable
-
Field Details
-
promise
-
expectedCount
private int expectedCount -
doneCount
private int doneCount -
aggregateFailure
-
doneAllocating
private boolean doneAllocating
-
-
Constructor Details
-
SimpleChannelPromiseAggregator
SimpleChannelPromiseAggregator(ChannelPromise promise, Channel c, EventExecutor e)
-
-
Method Details
-
newPromise
Allocate a new promise which will be used to aggregate the overall success of this promise aggregator.- Returns:
- A new promise which will be aggregated.
nullifdoneAllocatingPromises()was previously called.
-
doneAllocatingPromises
Signify that no morenewPromise()allocations will be made. The aggregation can not be successful until this method is called.- Returns:
- The promise that is the aggregation of all promises allocated with
newPromise().
-
tryFailure
Description copied from interface:PromiseMarks this future as a failure and notifies all listeners.- Specified by:
tryFailurein interfacePromise<Void>- Overrides:
tryFailurein classDefaultPromise<Void>- Returns:
trueif and only if successfully marked this future as a failure. Otherwisefalsebecause this future is already marked as either a success or a failure.
-
setFailure
Fail this object if it has not already been failed.This method will NOT throw an
IllegalStateExceptionif called multiple times because that may be expected.- Specified by:
setFailurein interfaceChannelPromise- Specified by:
setFailurein interfacePromise<Void>- Overrides:
setFailurein classDefaultChannelPromise
-
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 interfaceChannelPromise- Specified by:
setSuccessin interfacePromise<Void>- Overrides:
setSuccessin classDefaultChannelPromise
-
trySuccess
Description copied from interface:PromiseMarks this future as a success and notifies all listeners.- Specified by:
trySuccessin interfacePromise<Void>- Overrides:
trySuccessin classDefaultPromise<Void>- Returns:
trueif and only if successfully marked this future as a success. Otherwisefalsebecause this future is already marked as either a success or a failure.
-
allowFailure
private boolean allowFailure() -
awaitingPromises
private boolean awaitingPromises() -
allPromisesDone
private boolean allPromisesDone() -
setPromise
-
tryPromise
private boolean tryPromise() -
setAggregateFailure
-