Package org.apache.cassandra.net
Class AsyncChannelPromise
- java.lang.Object
-
- org.apache.cassandra.net.AsyncPromise<java.lang.Void>
-
- org.apache.cassandra.net.AsyncChannelPromise
-
- All Implemented Interfaces:
io.netty.channel.ChannelFuture
,io.netty.channel.ChannelPromise
,io.netty.util.concurrent.Future<java.lang.Void>
,io.netty.util.concurrent.Promise<java.lang.Void>
,java.util.concurrent.Future<java.lang.Void>
public class AsyncChannelPromise extends AsyncPromise<java.lang.Void> implements io.netty.channel.ChannelPromise
SeeAsyncPromise
andChannelPromise
This class is all boiler plate, just ensuring we return ourselves and invoke the correct Promise method.
-
-
Constructor Summary
Constructors Constructor Description AsyncChannelPromise(io.netty.channel.Channel channel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.channel.ChannelPromise
addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
io.netty.channel.ChannelPromise
addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners)
io.netty.channel.ChannelPromise
await()
io.netty.channel.ChannelPromise
awaitUninterruptibly()
io.netty.channel.Channel
channel()
boolean
isVoid()
io.netty.channel.ChannelPromise
removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
io.netty.channel.ChannelPromise
removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners)
io.netty.channel.ChannelPromise
setFailure(java.lang.Throwable throwable)
io.netty.channel.ChannelPromise
setSuccess()
io.netty.channel.ChannelPromise
setSuccess(java.lang.Void v)
io.netty.channel.ChannelPromise
sync()
waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack tracesio.netty.channel.ChannelPromise
syncUninterruptibly()
waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack tracesboolean
trySuccess()
io.netty.channel.ChannelPromise
unvoid()
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 AsyncChannelPromise
withListener(io.netty.channel.Channel channel, 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)
-
Methods inherited from class org.apache.cassandra.net.AsyncPromise
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, get, get, getNow, isCancellable, isCancelled, isDone, isSuccess, setUncancellable, toString, tryFailure, trySuccess, uncancellable, uncancellable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
withListener
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)
-
withListener
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)
-
writeAndFlush
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)
-
writeAndFlush
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)
-
writeAndFlush
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.ChannelHandlerContext context, java.lang.Object message)
-
writeAndFlush
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.Channel channel, java.lang.Object message)
-
channel
public io.netty.channel.Channel channel()
- Specified by:
channel
in interfaceio.netty.channel.ChannelFuture
- Specified by:
channel
in interfaceio.netty.channel.ChannelPromise
-
isVoid
public boolean isVoid()
- Specified by:
isVoid
in interfaceio.netty.channel.ChannelFuture
-
setSuccess
public io.netty.channel.ChannelPromise setSuccess()
- Specified by:
setSuccess
in interfaceio.netty.channel.ChannelPromise
-
setSuccess
public io.netty.channel.ChannelPromise setSuccess(java.lang.Void v)
- Specified by:
setSuccess
in interfaceio.netty.channel.ChannelPromise
- Specified by:
setSuccess
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
setSuccess
in classAsyncPromise<java.lang.Void>
-
trySuccess
public boolean trySuccess()
- Specified by:
trySuccess
in interfaceio.netty.channel.ChannelPromise
-
setFailure
public io.netty.channel.ChannelPromise setFailure(java.lang.Throwable throwable)
- Specified by:
setFailure
in interfaceio.netty.channel.ChannelPromise
- Specified by:
setFailure
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
setFailure
in classAsyncPromise<java.lang.Void>
-
sync
public io.netty.channel.ChannelPromise sync() throws java.lang.InterruptedException
Description copied from class:AsyncPromise
waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traces- Specified by:
sync
in interfaceio.netty.channel.ChannelFuture
- Specified by:
sync
in interfaceio.netty.channel.ChannelPromise
- Specified by:
sync
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
sync
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
sync
in classAsyncPromise<java.lang.Void>
- Throws:
java.lang.InterruptedException
-
syncUninterruptibly
public io.netty.channel.ChannelPromise syncUninterruptibly()
Description copied from class:AsyncPromise
waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traces- Specified by:
syncUninterruptibly
in interfaceio.netty.channel.ChannelFuture
- Specified by:
syncUninterruptibly
in interfaceio.netty.channel.ChannelPromise
- Specified by:
syncUninterruptibly
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
syncUninterruptibly
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
syncUninterruptibly
in classAsyncPromise<java.lang.Void>
-
await
public io.netty.channel.ChannelPromise await() throws java.lang.InterruptedException
- Specified by:
await
in interfaceio.netty.channel.ChannelFuture
- Specified by:
await
in interfaceio.netty.channel.ChannelPromise
- Specified by:
await
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
await
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
await
in classAsyncPromise<java.lang.Void>
- Throws:
java.lang.InterruptedException
-
awaitUninterruptibly
public io.netty.channel.ChannelPromise awaitUninterruptibly()
- Specified by:
awaitUninterruptibly
in interfaceio.netty.channel.ChannelFuture
- Specified by:
awaitUninterruptibly
in interfaceio.netty.channel.ChannelPromise
- Specified by:
awaitUninterruptibly
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
awaitUninterruptibly
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
awaitUninterruptibly
in classAsyncPromise<java.lang.Void>
-
addListener
public io.netty.channel.ChannelPromise addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
- Specified by:
addListener
in interfaceio.netty.channel.ChannelFuture
- Specified by:
addListener
in interfaceio.netty.channel.ChannelPromise
- Specified by:
addListener
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
addListener
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
addListener
in classAsyncPromise<java.lang.Void>
-
addListeners
public io.netty.channel.ChannelPromise addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners)
- Specified by:
addListeners
in interfaceio.netty.channel.ChannelFuture
- Specified by:
addListeners
in interfaceio.netty.channel.ChannelPromise
- Specified by:
addListeners
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
addListeners
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
addListeners
in classAsyncPromise<java.lang.Void>
-
removeListener
public io.netty.channel.ChannelPromise removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener)
- Specified by:
removeListener
in interfaceio.netty.channel.ChannelFuture
- Specified by:
removeListener
in interfaceio.netty.channel.ChannelPromise
- Specified by:
removeListener
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
removeListener
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
removeListener
in classAsyncPromise<java.lang.Void>
-
removeListeners
public io.netty.channel.ChannelPromise removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners)
- Specified by:
removeListeners
in interfaceio.netty.channel.ChannelFuture
- Specified by:
removeListeners
in interfaceio.netty.channel.ChannelPromise
- Specified by:
removeListeners
in interfaceio.netty.util.concurrent.Future<java.lang.Void>
- Specified by:
removeListeners
in interfaceio.netty.util.concurrent.Promise<java.lang.Void>
- Overrides:
removeListeners
in classAsyncPromise<java.lang.Void>
-
unvoid
public io.netty.channel.ChannelPromise unvoid()
- Specified by:
unvoid
in interfaceio.netty.channel.ChannelPromise
-
-