Class PromiseDelegate<V>

  • Type Parameters:
    V - promise type
    All Implemented Interfaces:
    io.netty.util.concurrent.Future<V>, io.netty.util.concurrent.Promise<V>, java.util.concurrent.Future<V>

    public class PromiseDelegate<V>
    extends java.lang.Object
    implements io.netty.util.concurrent.Promise<V>
    A simple delegate class which wraps an existing Promise and permits overriding of some of its methods.
    • Constructor Summary

      Constructors 
      Constructor Description
      PromiseDelegate​(io.netty.util.concurrent.Promise<V> promise)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.util.concurrent.Promise<V> addListener​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> listener)  
      io.netty.util.concurrent.Promise<V> addListeners​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... listeners)  
      io.netty.util.concurrent.Promise<V> await()  
      boolean await​(long timeoutMillis)  
      boolean await​(long timeout, java.util.concurrent.TimeUnit unit)  
      io.netty.util.concurrent.Promise<V> awaitUninterruptibly()  
      boolean awaitUninterruptibly​(long timeoutMillis)  
      boolean awaitUninterruptibly​(long timeout, java.util.concurrent.TimeUnit unit)  
      boolean cancel​(boolean mayInterruptIfRunning)  
      java.lang.Throwable cause()  
      V get()  
      V get​(long timeout, java.util.concurrent.TimeUnit unit)  
      V getNow()  
      boolean isCancellable()  
      boolean isCancelled()  
      boolean isDone()  
      boolean isSuccess()  
      io.netty.util.concurrent.Promise<V> removeListener​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> listener)  
      io.netty.util.concurrent.Promise<V> removeListeners​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... listeners)  
      io.netty.util.concurrent.Promise<V> setFailure​(java.lang.Throwable cause)  
      io.netty.util.concurrent.Promise<V> setSuccess​(V result)  
      boolean setUncancellable()  
      io.netty.util.concurrent.Promise<V> sync()  
      io.netty.util.concurrent.Promise<V> syncUninterruptibly()  
      boolean tryFailure​(java.lang.Throwable cause)  
      boolean trySuccess​(V result)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PromiseDelegate

        public PromiseDelegate​(io.netty.util.concurrent.Promise<V> promise)
    • Method Detail

      • setSuccess

        public final io.netty.util.concurrent.Promise<V> setSuccess​(V result)
        Specified by:
        setSuccess in interface io.netty.util.concurrent.Promise<V>
      • trySuccess

        public boolean trySuccess​(V result)
        Specified by:
        trySuccess in interface io.netty.util.concurrent.Promise<V>
      • setFailure

        public final io.netty.util.concurrent.Promise<V> setFailure​(java.lang.Throwable cause)
        Specified by:
        setFailure in interface io.netty.util.concurrent.Promise<V>
      • tryFailure

        public boolean tryFailure​(java.lang.Throwable cause)
        Specified by:
        tryFailure in interface io.netty.util.concurrent.Promise<V>
      • setUncancellable

        public boolean setUncancellable()
        Specified by:
        setUncancellable in interface io.netty.util.concurrent.Promise<V>
      • isSuccess

        public boolean isSuccess()
        Specified by:
        isSuccess in interface io.netty.util.concurrent.Future<V>
      • isCancellable

        public final boolean isCancellable()
        Specified by:
        isCancellable in interface io.netty.util.concurrent.Future<V>
      • cause

        public final java.lang.Throwable cause()
        Specified by:
        cause in interface io.netty.util.concurrent.Future<V>
      • addListener

        public io.netty.util.concurrent.Promise<V> addListener​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> listener)
        Specified by:
        addListener in interface io.netty.util.concurrent.Future<V>
        Specified by:
        addListener in interface io.netty.util.concurrent.Promise<V>
      • addListeners

        public io.netty.util.concurrent.Promise<V> addListeners​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... listeners)
        Specified by:
        addListeners in interface io.netty.util.concurrent.Future<V>
        Specified by:
        addListeners in interface io.netty.util.concurrent.Promise<V>
      • removeListener

        public io.netty.util.concurrent.Promise<V> removeListener​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> listener)
        Specified by:
        removeListener in interface io.netty.util.concurrent.Future<V>
        Specified by:
        removeListener in interface io.netty.util.concurrent.Promise<V>
      • removeListeners

        public io.netty.util.concurrent.Promise<V> removeListeners​(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... listeners)
        Specified by:
        removeListeners in interface io.netty.util.concurrent.Future<V>
        Specified by:
        removeListeners in interface io.netty.util.concurrent.Promise<V>
      • await

        public io.netty.util.concurrent.Promise<V> await()
                                                  throws java.lang.InterruptedException
        Specified by:
        await in interface io.netty.util.concurrent.Future<V>
        Specified by:
        await in interface io.netty.util.concurrent.Promise<V>
        Throws:
        java.lang.InterruptedException
      • awaitUninterruptibly

        public io.netty.util.concurrent.Promise<V> awaitUninterruptibly()
        Specified by:
        awaitUninterruptibly in interface io.netty.util.concurrent.Future<V>
        Specified by:
        awaitUninterruptibly in interface io.netty.util.concurrent.Promise<V>
      • await

        public boolean await​(long timeout,
                             java.util.concurrent.TimeUnit unit)
                      throws java.lang.InterruptedException
        Specified by:
        await in interface io.netty.util.concurrent.Future<V>
        Throws:
        java.lang.InterruptedException
      • await

        public boolean await​(long timeoutMillis)
                      throws java.lang.InterruptedException
        Specified by:
        await in interface io.netty.util.concurrent.Future<V>
        Throws:
        java.lang.InterruptedException
      • awaitUninterruptibly

        public boolean awaitUninterruptibly​(long timeout,
                                            java.util.concurrent.TimeUnit unit)
        Specified by:
        awaitUninterruptibly in interface io.netty.util.concurrent.Future<V>
      • awaitUninterruptibly

        public boolean awaitUninterruptibly​(long timeoutMillis)
        Specified by:
        awaitUninterruptibly in interface io.netty.util.concurrent.Future<V>
      • getNow

        public V getNow()
        Specified by:
        getNow in interface io.netty.util.concurrent.Future<V>
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface io.netty.util.concurrent.Future<V>
        Specified by:
        cancel in interface java.util.concurrent.Future<V>
      • isCancelled

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

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

        public final V get()
                    throws java.lang.InterruptedException,
                           java.util.concurrent.ExecutionException
        Specified by:
        get in interface java.util.concurrent.Future<V>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • get

        public final V get​(long timeout,
                           java.util.concurrent.TimeUnit unit)
                    throws java.lang.InterruptedException,
                           java.util.concurrent.ExecutionException,
                           java.util.concurrent.TimeoutException
        Specified by:
        get in interface java.util.concurrent.Future<V>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException
      • sync

        public final io.netty.util.concurrent.Promise<V> sync()
                                                       throws java.lang.InterruptedException
        Specified by:
        sync in interface io.netty.util.concurrent.Future<V>
        Specified by:
        sync in interface io.netty.util.concurrent.Promise<V>
        Throws:
        java.lang.InterruptedException
      • syncUninterruptibly

        public final io.netty.util.concurrent.Promise<V> syncUninterruptibly()
        Specified by:
        syncUninterruptibly in interface io.netty.util.concurrent.Future<V>
        Specified by:
        syncUninterruptibly in interface io.netty.util.concurrent.Promise<V>