public class AsyncChannelPromise extends AsyncPromise.WithExecutor<java.lang.Void> implements io.netty.channel.ChannelPromise
AsyncPromise
and ChannelPromise
This class is all boiler plate, just ensuring we return ourselves and invoke the correct Promise method.AsyncPromise.WithExecutor<V>
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable
CANCELLED, UNCANCELLABLE, UNSET
Constructor and Description |
---|
AsyncChannelPromise(io.netty.channel.Channel channel) |
Modifier and Type | Method and Description |
---|---|
AsyncChannelPromise |
addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
Add a listener to be invoked once this future completes.
|
AsyncChannelPromise |
addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners) |
AsyncChannelPromise |
await()
Wait for this promise to complete
|
AsyncChannelPromise |
awaitUninterruptibly()
Wait uninterruptibly for this promise to complete
|
io.netty.channel.Channel |
channel() |
boolean |
isVoid() |
AsyncChannelPromise |
removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener) |
AsyncChannelPromise |
removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners) |
AsyncChannelPromise |
setFailure(java.lang.Throwable throwable)
Complete the promise abnormally if not already complete
|
io.netty.channel.ChannelPromise |
setSuccess() |
AsyncChannelPromise |
setSuccess(java.lang.Void v)
Complete the promise successfully if not already complete
|
AsyncChannelPromise |
sync()
waits for completion; in case of failure rethrows the original exception without a new wrapping exception
so may cause problems for reporting stack traces
|
AsyncChannelPromise |
syncUninterruptibly()
waits for completion; in case of failure rethrows the original exception without a new wrapping exception
so may cause problems for reporting stack traces
|
boolean |
trySuccess() |
io.netty.channel.ChannelPromise |
unvoid() |
static AsyncChannelPromise |
withListener(io.netty.channel.Channel channel,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener) |
static AsyncChannelPromise |
withListener(io.netty.channel.ChannelHandlerContext context,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener) |
static io.netty.channel.ChannelFuture |
writeAndFlush(io.netty.channel.ChannelHandlerContext context,
java.lang.Object message) |
static io.netty.channel.ChannelFuture |
writeAndFlush(io.netty.channel.ChannelHandlerContext context,
java.lang.Object message,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener) |
static io.netty.channel.ChannelFuture |
writeAndFlush(io.netty.channel.Channel channel,
java.lang.Object message) |
static io.netty.channel.ChannelFuture |
writeAndFlush(io.netty.channel.Channel channel,
java.lang.Object message,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener) |
notifyExecutor
addCallback, addCallback, addCallback, awaitThrowUncheckedOnInterrupt, isUncancellable, setUncancellable, setUncancellableExclusive, tryFailure, trySuccess, uncancellable, uncancellable, uncancellable, withExecutor
awaitUntil, flatMap, map
addCallback, addCallback, addCallback, addListener, addListener, await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly, cancel, cause, description, flatMap, get, get, getNow, getWhenDone, isCancellable, isCancelled, isDone, isSuccess, map, map, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setUncancellable, tryFailure, trySuccess
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
addCallback, addCallback, addCallback, addListener, addListener, await, awaitUninterruptibly, flatMap, flatMap, map, map, rethrowIfFailed, syncThrowUncheckedOnInterrupt
await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntil, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly
public static AsyncChannelPromise withListener(io.netty.channel.ChannelHandlerContext context, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
public static AsyncChannelPromise withListener(io.netty.channel.Channel channel, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.ChannelHandlerContext context, java.lang.Object message, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.Channel channel, java.lang.Object message, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.ChannelHandlerContext context, java.lang.Object message)
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.Channel channel, java.lang.Object message)
public io.netty.channel.Channel channel()
channel
in interface io.netty.channel.ChannelFuture
channel
in interface io.netty.channel.ChannelPromise
public boolean isVoid()
isVoid
in interface io.netty.channel.ChannelFuture
public io.netty.channel.ChannelPromise setSuccess()
setSuccess
in interface io.netty.channel.ChannelPromise
public AsyncChannelPromise setSuccess(java.lang.Void v)
AsyncPromise
setSuccess
in interface io.netty.channel.ChannelPromise
setSuccess
in interface io.netty.util.concurrent.Promise<java.lang.Void>
setSuccess
in class AsyncPromise<java.lang.Void>
public boolean trySuccess()
trySuccess
in interface io.netty.channel.ChannelPromise
public AsyncChannelPromise setFailure(java.lang.Throwable throwable)
AsyncPromise
setFailure
in interface io.netty.channel.ChannelPromise
setFailure
in interface io.netty.util.concurrent.Promise<java.lang.Void>
setFailure
in class AsyncPromise<java.lang.Void>
public AsyncChannelPromise sync() throws java.lang.InterruptedException
AsyncPromise
sync
in interface io.netty.channel.ChannelFuture
sync
in interface io.netty.channel.ChannelPromise
sync
in interface io.netty.util.concurrent.Promise<java.lang.Void>
sync
in class AsyncPromise<java.lang.Void>
java.lang.InterruptedException
public AsyncChannelPromise syncUninterruptibly()
AsyncPromise
syncUninterruptibly
in interface io.netty.channel.ChannelFuture
syncUninterruptibly
in interface io.netty.channel.ChannelPromise
syncUninterruptibly
in interface io.netty.util.concurrent.Promise<java.lang.Void>
syncUninterruptibly
in class AsyncPromise<java.lang.Void>
public AsyncChannelPromise await() throws java.lang.InterruptedException
AsyncPromise
await
in interface io.netty.channel.ChannelFuture
await
in interface io.netty.channel.ChannelPromise
await
in interface io.netty.util.concurrent.Promise<java.lang.Void>
await
in interface Awaitable
await
in class AsyncPromise<java.lang.Void>
java.lang.InterruptedException
- if interruptedpublic AsyncChannelPromise awaitUninterruptibly()
AsyncPromise
awaitUninterruptibly
in interface io.netty.channel.ChannelFuture
awaitUninterruptibly
in interface io.netty.channel.ChannelPromise
awaitUninterruptibly
in interface io.netty.util.concurrent.Promise<java.lang.Void>
awaitUninterruptibly
in interface Awaitable
awaitUninterruptibly
in class AsyncPromise<java.lang.Void>
public AsyncChannelPromise addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
AbstractFuture
AbstractFuture.notifyExecutor()
in the order they are added (or the specified executor
in the case of AbstractFuture.addListener(Runnable, Executor)
.
if AbstractFuture.notifyExecutor()
is unset, they are invoked in the order they are added.
The ordering holds across all variants of this method.addListener
in interface io.netty.channel.ChannelFuture
addListener
in interface io.netty.channel.ChannelPromise
addListener
in interface io.netty.util.concurrent.Promise<java.lang.Void>
addListener
in class AsyncPromise<java.lang.Void>
public AsyncChannelPromise addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners)
addListeners
in interface io.netty.channel.ChannelFuture
addListeners
in interface io.netty.channel.ChannelPromise
addListeners
in interface io.netty.util.concurrent.Promise<java.lang.Void>
addListeners
in class AsyncPromise<java.lang.Void>
public AsyncChannelPromise removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
removeListener
in interface io.netty.channel.ChannelFuture
removeListener
in interface io.netty.channel.ChannelPromise
removeListener
in interface io.netty.util.concurrent.Promise<java.lang.Void>
removeListener
in class AsyncPromise<java.lang.Void>
public AsyncChannelPromise removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners)
removeListeners
in interface io.netty.channel.ChannelFuture
removeListeners
in interface io.netty.channel.ChannelPromise
removeListeners
in interface io.netty.util.concurrent.Promise<java.lang.Void>
removeListeners
in class AsyncPromise<java.lang.Void>
public io.netty.channel.ChannelPromise unvoid()
unvoid
in interface io.netty.channel.ChannelPromise
Copyright © 2009-2022 The Apache Software Foundation