Package org.apache.cassandra.net
Class AsyncChannelPromise
java.lang.Object
org.apache.cassandra.utils.concurrent.AbstractFuture<V>
org.apache.cassandra.utils.concurrent.AsyncFuture<V>
org.apache.cassandra.utils.concurrent.AsyncPromise<V>
org.apache.cassandra.utils.concurrent.AsyncPromise.WithExecutor<Void>
org.apache.cassandra.net.AsyncChannelPromise
- All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<Void>,io.netty.channel.ChannelFuture,io.netty.channel.ChannelPromise,io.netty.util.concurrent.Future<Void>,io.netty.util.concurrent.Promise<Void>,Future<Void>,Awaitable,Future<Void>,Promise<Void>
public class AsyncChannelPromise
extends AsyncPromise.WithExecutor<Void>
implements io.netty.channel.ChannelPromise
See
AsyncPromise and ChannelPromise
This class is all boiler plate, just ensuring we return ourselves and invoke the correct Promise method.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cassandra.utils.concurrent.AsyncPromise
AsyncPromise.WithExecutor<V>Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable -
Field Summary
Fields inherited from class org.apache.cassandra.utils.concurrent.AbstractFuture
CANCELLED, UNCANCELLABLE, UNSET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) Add a listener to be invoked once this future completes.addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>... listeners) await()Wait for this promise to completeWait uninterruptibly for this promise to completeio.netty.channel.Channelchannel()booleanisVoid()removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>... listeners) setFailure(Throwable throwable) Complete the promise abnormally if not already completeio.netty.channel.ChannelPromisesetSuccess(Void v) Complete the promise successfully if not already completesync()waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traceswaits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack tracesbooleanio.netty.channel.ChannelPromiseunvoid()static AsyncChannelPromisewithListener(io.netty.channel.ChannelHandlerContext context, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) static AsyncChannelPromisewithListener(io.netty.channel.Channel channel, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) static io.netty.channel.ChannelFuturewriteAndFlush(io.netty.channel.ChannelHandlerContext context, Object message) static io.netty.channel.ChannelFuturewriteAndFlush(io.netty.channel.ChannelHandlerContext context, Object message, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) static io.netty.channel.ChannelFuturewriteAndFlush(io.netty.channel.Channel channel, Object message) static io.netty.channel.ChannelFuturewriteAndFlush(io.netty.channel.Channel channel, Object message, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) Methods inherited from class org.apache.cassandra.utils.concurrent.AsyncPromise.WithExecutor
notifyExecutorMethods inherited from class org.apache.cassandra.utils.concurrent.AsyncPromise
addCallback, addCallback, addCallback, awaitThrowUncheckedOnInterrupt, isUncancellable, setUncancellable, setUncancellableExclusive, tryFailure, trySuccess, uncancellable, uncancellable, uncancellable, withExecutorMethods inherited from class org.apache.cassandra.utils.concurrent.AsyncFuture
awaitUntil, flatMap, mapMethods inherited from class org.apache.cassandra.utils.concurrent.AbstractFuture
addCallback, addCallback, addCallback, addListener, addListener, await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly, cancel, cause, description, flatMap, get, get, getNow, getWhenDone, isCancellable, isCancelled, isDone, isSuccess, map, map, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntil, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptiblyMethods inherited from interface io.netty.util.concurrent.Future
await, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccessMethods inherited from interface java.util.concurrent.Future
get, get, isCancelled, isDoneMethods inherited from interface org.apache.cassandra.utils.concurrent.Future
addCallback, addCallback, addCallback, addListener, addListener, await, awaitUninterruptibly, flatMap, flatMap, map, map, rethrowIfFailed, syncThrowUncheckedOnInterruptMethods inherited from interface io.netty.util.concurrent.Promise
setUncancellable, tryFailure, trySuccess
-
Constructor Details
-
AsyncChannelPromise
public AsyncChannelPromise(io.netty.channel.Channel channel)
-
-
Method Details
-
withListener
public static AsyncChannelPromise withListener(io.netty.channel.ChannelHandlerContext context, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) -
withListener
public static AsyncChannelPromise withListener(io.netty.channel.Channel channel, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) -
writeAndFlush
-
writeAndFlush
-
writeAndFlush
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.ChannelHandlerContext context, Object message) -
writeAndFlush
public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.Channel channel, Object message) -
channel
public io.netty.channel.Channel channel()- Specified by:
channelin interfaceio.netty.channel.ChannelFuture- Specified by:
channelin interfaceio.netty.channel.ChannelPromise
-
isVoid
public boolean isVoid()- Specified by:
isVoidin interfaceio.netty.channel.ChannelFuture
-
setSuccess
public io.netty.channel.ChannelPromise setSuccess()- Specified by:
setSuccessin interfaceio.netty.channel.ChannelPromise
-
setSuccess
Description copied from class:AsyncPromiseComplete the promise successfully if not already complete- Specified by:
setSuccessin interfaceio.netty.channel.ChannelPromise- Specified by:
setSuccessin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
setSuccessin interfacePromise<Void>- Overrides:
setSuccessin classAsyncPromise<Void>
-
trySuccess
public boolean trySuccess()- Specified by:
trySuccessin interfaceio.netty.channel.ChannelPromise
-
setFailure
Description copied from class:AsyncPromiseComplete the promise abnormally if not already complete- Specified by:
setFailurein interfaceio.netty.channel.ChannelPromise- Specified by:
setFailurein interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
setFailurein interfacePromise<Void>- Overrides:
setFailurein classAsyncPromise<Void>
-
sync
Description copied from class:AsyncPromisewaits 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:
syncin interfaceio.netty.channel.ChannelFuture- Specified by:
syncin interfaceio.netty.channel.ChannelPromise- Specified by:
syncin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
syncin interfaceFuture<Void>- Specified by:
syncin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
syncin interfacePromise<Void>- Overrides:
syncin classAsyncPromise<Void>- Throws:
InterruptedException
-
syncUninterruptibly
Description copied from class:AsyncPromisewaits 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:
syncUninterruptiblyin interfaceio.netty.channel.ChannelFuture- Specified by:
syncUninterruptiblyin interfaceio.netty.channel.ChannelPromise- Specified by:
syncUninterruptiblyin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
syncUninterruptiblyin interfaceFuture<Void>- Specified by:
syncUninterruptiblyin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
syncUninterruptiblyin interfacePromise<Void>- Overrides:
syncUninterruptiblyin classAsyncPromise<Void>
-
await
Description copied from class:AsyncPromiseWait for this promise to complete- Specified by:
awaitin interfaceAwaitable- Specified by:
awaitin interfaceio.netty.channel.ChannelFuture- Specified by:
awaitin interfaceio.netty.channel.ChannelPromise- Specified by:
awaitin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
awaitin interfaceFuture<Void>- Specified by:
awaitin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
awaitin interfacePromise<Void>- Overrides:
awaitin classAsyncPromise<Void>- Throws:
InterruptedException- if interrupted
-
awaitUninterruptibly
Description copied from class:AsyncPromiseWait uninterruptibly for this promise to complete- Specified by:
awaitUninterruptiblyin interfaceAwaitable- Specified by:
awaitUninterruptiblyin interfaceio.netty.channel.ChannelFuture- Specified by:
awaitUninterruptiblyin interfaceio.netty.channel.ChannelPromise- Specified by:
awaitUninterruptiblyin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
awaitUninterruptiblyin interfaceFuture<Void>- Specified by:
awaitUninterruptiblyin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
awaitUninterruptiblyin interfacePromise<Void>- Overrides:
awaitUninterruptiblyin classAsyncPromise<Void>
-
addListener
public AsyncChannelPromise addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) Description copied from class:AbstractFutureAdd a listener to be invoked once this future completes. Listeners are submitted toAbstractFuture.notifyExecutor()in the order they are added (or the specified executor in the case ofAbstractFuture.addListener(Runnable, Executor). ifAbstractFuture.notifyExecutor()is unset, they are invoked in the order they are added. The ordering holds across all variants of this method.- Specified by:
addListenerin interfaceio.netty.channel.ChannelFuture- Specified by:
addListenerin interfaceio.netty.channel.ChannelPromise- Specified by:
addListenerin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
addListenerin interfaceFuture<Void>- Specified by:
addListenerin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
addListenerin interfacePromise<Void>- Overrides:
addListenerin classAsyncPromise<Void>
-
addListeners
public AsyncChannelPromise addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>... listeners) - Specified by:
addListenersin interfaceio.netty.channel.ChannelFuture- Specified by:
addListenersin interfaceio.netty.channel.ChannelPromise- Specified by:
addListenersin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
addListenersin interfaceFuture<Void>- Specified by:
addListenersin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
addListenersin interfacePromise<Void>- Overrides:
addListenersin classAsyncPromise<Void>
-
removeListener
public AsyncChannelPromise removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener) - Specified by:
removeListenerin interfaceio.netty.channel.ChannelFuture- Specified by:
removeListenerin interfaceio.netty.channel.ChannelPromise- Specified by:
removeListenerin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
removeListenerin interfaceFuture<Void>- Specified by:
removeListenerin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
removeListenerin interfacePromise<Void>- Overrides:
removeListenerin classAsyncPromise<Void>
-
removeListeners
public AsyncChannelPromise removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>... listeners) - Specified by:
removeListenersin interfaceio.netty.channel.ChannelFuture- Specified by:
removeListenersin interfaceio.netty.channel.ChannelPromise- Specified by:
removeListenersin interfaceio.netty.util.concurrent.Future<Void>- Specified by:
removeListenersin interfaceFuture<Void>- Specified by:
removeListenersin interfaceio.netty.util.concurrent.Promise<Void>- Specified by:
removeListenersin interfacePromise<Void>- Overrides:
removeListenersin classAsyncPromise<Void>
-
unvoid
public io.netty.channel.ChannelPromise unvoid()- Specified by:
unvoidin interfaceio.netty.channel.ChannelPromise
-