Class VoidChannelGroupFuture

java.lang.Object
io.netty.channel.group.VoidChannelGroupFuture
All Implemented Interfaces:
ChannelGroupFuture, Future<java.lang.Void>, java.lang.Iterable<ChannelFuture>, java.util.concurrent.Future<java.lang.Void>

final class VoidChannelGroupFuture extends java.lang.Object implements ChannelGroupFuture
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final java.util.Iterator<ChannelFuture>
     
    private final ChannelGroup
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
    Adds the specified listener to this future.
    addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
    Adds the specified listeners to this future.
    Waits for this future to be completed.
    boolean
    await(long timeoutMillis)
    Waits for this future to be completed within the specified time limit.
    boolean
    await(long timeout, java.util.concurrent.TimeUnit unit)
    Waits for this future to be completed within the specified time limit.
    Waits for this future to be completed without interruption.
    boolean
    awaitUninterruptibly(long timeoutMillis)
    Waits for this future to be completed within the specified time limit without interruption.
    boolean
    awaitUninterruptibly(long timeout, java.util.concurrent.TimeUnit unit)
    Waits for this future to be completed within the specified time limit without interruption.
    boolean
    cancel(boolean mayInterruptIfRunning)
    If the cancellation was successful it will fail the future with a CancellationException.
    Returns the cause of the failed I/O operation if the I/O operation has failed.
    find(Channel channel)
    Returns the ChannelFuture of the individual I/O operation which is associated with the specified Channel.
    java.lang.Void
    get()
     
    java.lang.Void
    get(long timeout, java.util.concurrent.TimeUnit unit)
     
    java.lang.Void
    Return the result without blocking.
    Returns the ChannelGroup which is associated with this future.
    boolean
    returns true if and only if the operation can be cancelled via Future.cancel(boolean).
    boolean
     
    boolean
     
    boolean
    Returns true if and only if the I/O operations associated with this future have failed partially with some success.
    boolean
    Returns true if and only if the I/O operations associated with this future were partially successful with some failure.
    boolean
    Returns true if and only if all I/O operations associated with this future were successful without any failure.
    java.util.Iterator<ChannelFuture>
    Returns the Iterator that enumerates all ChannelFutures which are associated with this future.
    private static java.lang.RuntimeException
     
    removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
    Removes the first occurrence of the specified listener from this future.
    removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
    Removes the first occurrence for each of the listeners from this future.
    Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
    Waits for this future until it is done, and rethrows the cause of the failure if this future failed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

  • Constructor Details

    • VoidChannelGroupFuture

      VoidChannelGroupFuture(ChannelGroup group)
  • Method Details

    • group

      public ChannelGroup group()
      Description copied from interface: ChannelGroupFuture
      Returns the ChannelGroup which is associated with this future.
      Specified by:
      group in interface ChannelGroupFuture
    • find

      public ChannelFuture find(Channel channel)
      Description copied from interface: ChannelGroupFuture
      Returns the ChannelFuture of the individual I/O operation which is associated with the specified Channel.
      Specified by:
      find in interface ChannelGroupFuture
      Returns:
      the matching ChannelFuture if found. null otherwise.
    • isSuccess

      public boolean isSuccess()
      Description copied from interface: ChannelGroupFuture
      Returns true if and only if all I/O operations associated with this future were successful without any failure.
      Specified by:
      isSuccess in interface ChannelGroupFuture
      Specified by:
      isSuccess in interface Future<java.lang.Void>
    • cause

      public ChannelGroupException cause()
      Description copied from interface: Future
      Returns the cause of the failed I/O operation if the I/O operation has failed.
      Specified by:
      cause in interface ChannelGroupFuture
      Specified by:
      cause in interface Future<java.lang.Void>
      Returns:
      the cause of the failure. null if succeeded or this future is not completed yet.
    • isPartialSuccess

      public boolean isPartialSuccess()
      Description copied from interface: ChannelGroupFuture
      Returns true if and only if the I/O operations associated with this future were partially successful with some failure.
      Specified by:
      isPartialSuccess in interface ChannelGroupFuture
    • isPartialFailure

      public boolean isPartialFailure()
      Description copied from interface: ChannelGroupFuture
      Returns true if and only if the I/O operations associated with this future have failed partially with some success.
      Specified by:
      isPartialFailure in interface ChannelGroupFuture
    • addListener

      public ChannelGroupFuture addListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
      Description copied from interface: Future
      Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.
      Specified by:
      addListener in interface ChannelGroupFuture
      Specified by:
      addListener in interface Future<java.lang.Void>
    • addListeners

      public ChannelGroupFuture addListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
      Description copied from interface: Future
      Adds the specified listeners to this future. The specified listeners are notified when this future is done. If this future is already completed, the specified listeners are notified immediately.
      Specified by:
      addListeners in interface ChannelGroupFuture
      Specified by:
      addListeners in interface Future<java.lang.Void>
    • removeListener

      public ChannelGroupFuture removeListener(GenericFutureListener<? extends Future<? super java.lang.Void>> listener)
      Description copied from interface: Future
      Removes the first occurrence of the specified listener from this future. The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.
      Specified by:
      removeListener in interface ChannelGroupFuture
      Specified by:
      removeListener in interface Future<java.lang.Void>
    • removeListeners

      public ChannelGroupFuture removeListeners(GenericFutureListener<? extends Future<? super java.lang.Void>>... listeners)
      Description copied from interface: Future
      Removes the first occurrence for each of the listeners from this future. The specified listeners are no longer notified when this future is done. If the specified listeners are not associated with this future, this method does nothing and returns silently.
      Specified by:
      removeListeners in interface ChannelGroupFuture
      Specified by:
      removeListeners in interface Future<java.lang.Void>
    • await

      public ChannelGroupFuture await()
      Description copied from interface: Future
      Waits for this future to be completed.
      Specified by:
      await in interface ChannelGroupFuture
      Specified by:
      await in interface Future<java.lang.Void>
    • awaitUninterruptibly

      public ChannelGroupFuture awaitUninterruptibly()
      Description copied from interface: Future
      Waits for this future to be completed without interruption. This method catches an InterruptedException and discards it silently.
      Specified by:
      awaitUninterruptibly in interface ChannelGroupFuture
      Specified by:
      awaitUninterruptibly in interface Future<java.lang.Void>
    • syncUninterruptibly

      public ChannelGroupFuture syncUninterruptibly()
      Description copied from interface: Future
      Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
      Specified by:
      syncUninterruptibly in interface ChannelGroupFuture
      Specified by:
      syncUninterruptibly in interface Future<java.lang.Void>
    • sync

      public ChannelGroupFuture sync()
      Description copied from interface: Future
      Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
      Specified by:
      sync in interface ChannelGroupFuture
      Specified by:
      sync in interface Future<java.lang.Void>
    • iterator

      public java.util.Iterator<ChannelFuture> iterator()
      Description copied from interface: ChannelGroupFuture
      Returns the Iterator that enumerates all ChannelFutures which are associated with this future. Please note that the returned Iterator is unmodifiable, which means a ChannelFuture cannot be removed from this future.
      Specified by:
      iterator in interface ChannelGroupFuture
      Specified by:
      iterator in interface java.lang.Iterable<ChannelFuture>
    • isCancellable

      public boolean isCancellable()
      Description copied from interface: Future
      returns true if and only if the operation can be cancelled via Future.cancel(boolean).
      Specified by:
      isCancellable in interface Future<java.lang.Void>
    • await

      public boolean await(long timeout, java.util.concurrent.TimeUnit unit)
      Description copied from interface: Future
      Waits for this future to be completed within the specified time limit.
      Specified by:
      await in interface Future<java.lang.Void>
      Returns:
      true if and only if the future was completed within the specified time limit
    • await

      public boolean await(long timeoutMillis)
      Description copied from interface: Future
      Waits for this future to be completed within the specified time limit.
      Specified by:
      await in interface Future<java.lang.Void>
      Returns:
      true if and only if the future was completed within the specified time limit
    • awaitUninterruptibly

      public boolean awaitUninterruptibly(long timeout, java.util.concurrent.TimeUnit unit)
      Description copied from interface: Future
      Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.
      Specified by:
      awaitUninterruptibly in interface Future<java.lang.Void>
      Returns:
      true if and only if the future was completed within the specified time limit
    • awaitUninterruptibly

      public boolean awaitUninterruptibly(long timeoutMillis)
      Description copied from interface: Future
      Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.
      Specified by:
      awaitUninterruptibly in interface Future<java.lang.Void>
      Returns:
      true if and only if the future was completed within the specified time limit
    • getNow

      public java.lang.Void getNow()
      Description copied from interface: Future
      Return the result without blocking. If the future is not done yet this will return null.

      As it is possible that a null value is used to mark the future as successful you also need to check if the future is really done with Future.isDone() and not rely on the returned null value.

      Specified by:
      getNow in interface Future<java.lang.Void>
    • cancel

      public boolean cancel(boolean mayInterruptIfRunning)
      If the cancellation was successful it will fail the future with a CancellationException.
      Specified by:
      cancel in interface Future<java.lang.Void>
      Specified by:
      cancel in interface java.util.concurrent.Future<java.lang.Void>
      Parameters:
      mayInterruptIfRunning - this value has no effect in this implementation.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface java.util.concurrent.Future<java.lang.Void>
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface java.util.concurrent.Future<java.lang.Void>
    • get

      public java.lang.Void get()
      Specified by:
      get in interface java.util.concurrent.Future<java.lang.Void>
    • get

      public java.lang.Void get(long timeout, java.util.concurrent.TimeUnit unit)
      Specified by:
      get in interface java.util.concurrent.Future<java.lang.Void>
    • reject

      private static java.lang.RuntimeException reject()