Class 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.
  • 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

      public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.ChannelHandlerContext context, Object message, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener)
    • writeAndFlush

      public static io.netty.channel.ChannelFuture writeAndFlush(io.netty.channel.Channel channel, Object message, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener)
    • 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:
      channel in interface io.netty.channel.ChannelFuture
      Specified by:
      channel in interface io.netty.channel.ChannelPromise
    • isVoid

      public boolean isVoid()
      Specified by:
      isVoid in interface io.netty.channel.ChannelFuture
    • setSuccess

      public io.netty.channel.ChannelPromise setSuccess()
      Specified by:
      setSuccess in interface io.netty.channel.ChannelPromise
    • setSuccess

      public AsyncChannelPromise setSuccess(Void v)
      Description copied from class: AsyncPromise
      Complete the promise successfully if not already complete
      Specified by:
      setSuccess in interface io.netty.channel.ChannelPromise
      Specified by:
      setSuccess in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      setSuccess in interface Promise<Void>
      Overrides:
      setSuccess in class AsyncPromise<Void>
    • trySuccess

      public boolean trySuccess()
      Specified by:
      trySuccess in interface io.netty.channel.ChannelPromise
    • setFailure

      public AsyncChannelPromise setFailure(Throwable throwable)
      Description copied from class: AsyncPromise
      Complete the promise abnormally if not already complete
      Specified by:
      setFailure in interface io.netty.channel.ChannelPromise
      Specified by:
      setFailure in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      setFailure in interface Promise<Void>
      Overrides:
      setFailure in class AsyncPromise<Void>
    • sync

      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 interface io.netty.channel.ChannelFuture
      Specified by:
      sync in interface io.netty.channel.ChannelPromise
      Specified by:
      sync in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      sync in interface Future<Void>
      Specified by:
      sync in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      sync in interface Promise<Void>
      Overrides:
      sync in class AsyncPromise<Void>
      Throws:
      InterruptedException
    • syncUninterruptibly

      public AsyncChannelPromise 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 interface io.netty.channel.ChannelFuture
      Specified by:
      syncUninterruptibly in interface io.netty.channel.ChannelPromise
      Specified by:
      syncUninterruptibly in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      syncUninterruptibly in interface Future<Void>
      Specified by:
      syncUninterruptibly in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      syncUninterruptibly in interface Promise<Void>
      Overrides:
      syncUninterruptibly in class AsyncPromise<Void>
    • await

      Description copied from class: AsyncPromise
      Wait for this promise to complete
      Specified by:
      await in interface Awaitable
      Specified by:
      await in interface io.netty.channel.ChannelFuture
      Specified by:
      await in interface io.netty.channel.ChannelPromise
      Specified by:
      await in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      await in interface Future<Void>
      Specified by:
      await in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      await in interface Promise<Void>
      Overrides:
      await in class AsyncPromise<Void>
      Throws:
      InterruptedException - if interrupted
    • awaitUninterruptibly

      public AsyncChannelPromise awaitUninterruptibly()
      Description copied from class: AsyncPromise
      Wait uninterruptibly for this promise to complete
      Specified by:
      awaitUninterruptibly in interface Awaitable
      Specified by:
      awaitUninterruptibly in interface io.netty.channel.ChannelFuture
      Specified by:
      awaitUninterruptibly in interface io.netty.channel.ChannelPromise
      Specified by:
      awaitUninterruptibly in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      awaitUninterruptibly in interface Future<Void>
      Specified by:
      awaitUninterruptibly in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      awaitUninterruptibly in interface Promise<Void>
      Overrides:
      awaitUninterruptibly in class AsyncPromise<Void>
    • addListener

      public AsyncChannelPromise addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener)
      Description copied from class: AbstractFuture
      Add a listener to be invoked once this future completes. Listeners are submitted to 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.
      Specified by:
      addListener in interface io.netty.channel.ChannelFuture
      Specified by:
      addListener in interface io.netty.channel.ChannelPromise
      Specified by:
      addListener in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      addListener in interface Future<Void>
      Specified by:
      addListener in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      addListener in interface Promise<Void>
      Overrides:
      addListener in class AsyncPromise<Void>
    • addListeners

      public AsyncChannelPromise addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>... listeners)
      Specified by:
      addListeners in interface io.netty.channel.ChannelFuture
      Specified by:
      addListeners in interface io.netty.channel.ChannelPromise
      Specified by:
      addListeners in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      addListeners in interface Future<Void>
      Specified by:
      addListeners in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      addListeners in interface Promise<Void>
      Overrides:
      addListeners in class AsyncPromise<Void>
    • removeListener

      public AsyncChannelPromise removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>> listener)
      Specified by:
      removeListener in interface io.netty.channel.ChannelFuture
      Specified by:
      removeListener in interface io.netty.channel.ChannelPromise
      Specified by:
      removeListener in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      removeListener in interface Future<Void>
      Specified by:
      removeListener in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      removeListener in interface Promise<Void>
      Overrides:
      removeListener in class AsyncPromise<Void>
    • removeListeners

      public AsyncChannelPromise removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super Void>>... listeners)
      Specified by:
      removeListeners in interface io.netty.channel.ChannelFuture
      Specified by:
      removeListeners in interface io.netty.channel.ChannelPromise
      Specified by:
      removeListeners in interface io.netty.util.concurrent.Future<Void>
      Specified by:
      removeListeners in interface Future<Void>
      Specified by:
      removeListeners in interface io.netty.util.concurrent.Promise<Void>
      Specified by:
      removeListeners in interface Promise<Void>
      Overrides:
      removeListeners in class AsyncPromise<Void>
    • unvoid

      public io.netty.channel.ChannelPromise unvoid()
      Specified by:
      unvoid in interface io.netty.channel.ChannelPromise