static final class Http2CodecUtil.SimpleChannelPromiseAggregator extends DefaultChannelPromise
ChannelPromise
objects into a single ChannelPromise
object.Modifier and Type | Field and Description |
---|---|
private boolean |
doneAllocating |
private int |
doneCount |
private int |
expectedCount |
private java.lang.Throwable |
lastFailure |
private ChannelPromise |
promise |
Constructor and Description |
---|
SimpleChannelPromiseAggregator(ChannelPromise promise,
Channel c,
EventExecutor e) |
Modifier and Type | Method and Description |
---|---|
private boolean |
allowFailure() |
private boolean |
allPromisesDone() |
private boolean |
awaitingPromises() |
ChannelPromise |
doneAllocatingPromises()
Signify that no more
newPromise() allocations will be made. |
ChannelPromise |
newPromise()
Allocate a new promise which will be used to aggregate the overall success of this promise aggregator.
|
ChannelPromise |
setFailure(java.lang.Throwable cause)
Fail this object if it has not already been failed.
|
private ChannelPromise |
setPromise() |
ChannelPromise |
setSuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
boolean |
tryFailure(java.lang.Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
private boolean |
tryPromise() |
boolean |
trySuccess(java.lang.Void result)
Marks this future as a success and notifies all
listeners.
|
addListener, addListeners, await, awaitUninterruptibly, channel, checkDeadLock, executor, flushCheckpoint, flushCheckpoint, isVoid, promise, removeListener, removeListeners, setSuccess, sync, syncUninterruptibly, trySuccess, unvoid
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilder
get, get
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setUncancellable
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
private final ChannelPromise promise
private int expectedCount
private int doneCount
private java.lang.Throwable lastFailure
private boolean doneAllocating
SimpleChannelPromiseAggregator(ChannelPromise promise, Channel c, EventExecutor e)
public ChannelPromise newPromise()
null
if doneAllocatingPromises()
was previously called.public ChannelPromise doneAllocatingPromises()
newPromise()
allocations will be made.
The aggregation can not be successful until this method is called.newPromise()
.public boolean tryFailure(java.lang.Throwable cause)
Promise
tryFailure
in interface Promise<java.lang.Void>
tryFailure
in class DefaultPromise<java.lang.Void>
true
if and only if successfully marked this future as
a failure. Otherwise false
because this future is
already marked as either a success or a failure.public ChannelPromise setFailure(java.lang.Throwable cause)
This method will NOT throw an IllegalStateException
if called multiple times
because that may be expected.
setFailure
in interface ChannelPromise
setFailure
in interface Promise<java.lang.Void>
setFailure
in class DefaultChannelPromise
public ChannelPromise setSuccess(java.lang.Void result)
Promise
IllegalStateException
.setSuccess
in interface ChannelPromise
setSuccess
in interface Promise<java.lang.Void>
setSuccess
in class DefaultChannelPromise
public boolean trySuccess(java.lang.Void result)
Promise
trySuccess
in interface Promise<java.lang.Void>
trySuccess
in class DefaultPromise<java.lang.Void>
true
if and only if successfully marked this future as
a success. Otherwise false
because this future is
already marked as either a success or a failure.private boolean allowFailure()
private boolean awaitingPromises()
private boolean allPromisesDone()
private ChannelPromise setPromise()
private boolean tryPromise()