Class CompleteFuture<V>

    • Constructor Detail

      • CompleteFuture

        protected CompleteFuture​(EventExecutor executor)
        Creates a new instance.
        Parameters:
        executor - the EventExecutor associated with this future
    • Method Detail

      • addListener

        public Future<V> addListener​(GenericFutureListener<? extends Future<? super V>> 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.
      • addListeners

        public Future<V> addListeners​(GenericFutureListener<? extends Future<? super V>>... 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.
      • removeListener

        public Future<V> removeListener​(GenericFutureListener<? extends Future<? super V>> 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.
      • removeListeners

        public Future<V> removeListeners​(GenericFutureListener<? extends Future<? super V>>... 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.
      • await

        public Future<V> await()
                        throws java.lang.InterruptedException
        Description copied from interface: Future
        Waits for this future to be completed.
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted
      • await

        public boolean await​(long timeout,
                             java.util.concurrent.TimeUnit unit)
                      throws java.lang.InterruptedException
        Description copied from interface: Future
        Waits for this future to be completed within the specified time limit.
        Returns:
        true if and only if the future was completed within the specified time limit
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted
      • sync

        public Future<V> sync()
                       throws java.lang.InterruptedException
        Description copied from interface: Future
        Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
        Throws:
        java.lang.InterruptedException
      • syncUninterruptibly

        public Future<V> 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.
      • await

        public boolean await​(long timeoutMillis)
                      throws java.lang.InterruptedException
        Description copied from interface: Future
        Waits for this future to be completed within the specified time limit.
        Returns:
        true if and only if the future was completed within the specified time limit
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted
      • awaitUninterruptibly

        public Future<V> awaitUninterruptibly()
        Description copied from interface: Future
        Waits for this future to be completed without interruption. This method catches an InterruptedException and discards it silently.
      • 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.
        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.
        Returns:
        true if and only if the future was completed within the specified time limit
      • isDone

        public boolean isDone()
      • isCancellable

        public boolean isCancellable()
        Description copied from interface: Future
        returns true if and only if the operation can be cancelled via Future.cancel(boolean).
      • isCancelled

        public boolean isCancelled()
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        If the cancellation was successful it will fail the future with a CancellationException.
        Parameters:
        mayInterruptIfRunning - this value has no effect in this implementation.