Class RedissonPromise<T>

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.concurrent.

    • Constructor Summary

      Constructors 
      Constructor Description
      RedissonPromise()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RPromise<T> await()
      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,  unit)
      Waits for this future to be completed within the specified time limit.
      RPromise<T> awaitUninterruptibly()
      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,  unit)
      Waits for this future to be completed within the specified time limit without interruption.
      boolean cancel​(boolean mayInterruptIfRunning)  
      cause()
      Returns the cause of the failed I/O operation if the I/O operation has failed.
      T getNow()
      Return the result without blocking.
      boolean hasListeners()  
      boolean isCancelled()  
      boolean isDone()  
      boolean isSuccess()
      Returns true if and only if the I/O operation was completed successfully.
      static <V> RFuture<V>  cause)  
      static <V> RFuture<V> newSucceededFuture​(V result)  
      void <? super > action)  
      boolean setUncancellable()
      Make this future impossible to cancel.
      RPromise<T> sync()
      Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
      RPromise<T> syncUninterruptibly()
      Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
      toString()  
      boolean  cause)
      Marks this future as a failure and notifies all listeners.
      boolean trySuccess​(T result)
      Marks this future as a success and notifies all listeners.
      • Methods inherited from class java.util.concurrent.

        , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
      • Methods inherited from class java.lang.

        , , , , , , , , ,
      • Methods inherited from interface java.util.concurrent.

        , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
      • Methods inherited from interface java.util.concurrent.

        ,
      • Methods inherited from interface org.redisson.api.RFuture

        join
    • Constructor Detail

      • RedissonPromise

        public RedissonPromise()
    • Method Detail

      • newFailedFuture

        public static <V>  cause)
      • newSucceededFuture

        public static <V> RFuture<V> newSucceededFuture​(V result)
      • isSuccess

        public boolean isSuccess()
        Description copied from interface: RFuture
        Returns true if and only if the I/O operation was completed successfully.
        Specified by:
        isSuccess in interface RFuture<T>
        Returns:
        true if future was completed successfully
      • isDone

        public boolean isDone()
        Specified by:
         in interface <T>
        Overrides:
         in class <T>
      • isCancelled

        public boolean isCancelled()
        Specified by:
         in interface <T>
        Overrides:
         in class <T>
      • trySuccess

        public boolean trySuccess​(T result)
        Description copied from interface: RPromise
        Marks this future as a success and notifies all listeners.
        Specified by:
        trySuccess in interface RPromise<T>
        Parameters:
        result - object
        Returns:
        true if and only if successfully marked this future as a success. Otherwise false because this future is already marked as either a success or a failure.
      • cause

        public  cause()
        Description copied from interface: RFuture
        Returns the cause of the failed I/O operation if the I/O operation has failed.
        Specified by:
        cause in interface RFuture<T>
        Returns:
        the cause of the failure. null if succeeded or this future is not completed yet.
      • tryFailure

        public boolean tryFailure​( cause)
        Description copied from interface: RPromise
        Marks this future as a failure and notifies all listeners.
        Specified by:
        tryFailure in interface RPromise<T>
        Parameters:
        cause - object
        Returns:
        true if and only if successfully marked this future as a failure. Otherwise false because this future is already marked as either a success or a failure.
      • setUncancellable

        public boolean setUncancellable()
        Description copied from interface: RPromise
        Make this future impossible to cancel.
        Specified by:
        setUncancellable in interface RPromise<T>
        Returns:
        true if and only if successfully marked this future as uncancellable or it is already done without being cancelled. false if this future has been cancelled already.
      • await

        public RPromise<T> await()
                          throws 
        Description copied from interface: RFuture
        Waits for this future to be completed.
        Specified by:
        await in interface RFuture<T>
        Specified by:
        await in interface RPromise<T>
        Returns:
        Future object
        Throws:
        - if the current thread was interrupted
      • awaitUninterruptibly

        public RPromise<T> awaitUninterruptibly()
        Description copied from interface: RFuture
        Waits for this future to be completed without interruption. This method catches an and discards it silently.
        Specified by:
        awaitUninterruptibly in interface RFuture<T>
        Specified by:
        awaitUninterruptibly in interface RPromise<T>
        Returns:
        Future object
      • sync

        public RPromise<T> sync()
                         throws 
        Description copied from interface: RFuture
        Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
        Specified by:
        sync in interface RFuture<T>
        Specified by:
        sync in interface RPromise<T>
        Returns:
        Future object
        Throws:
        - if the current thread was interrupted
      • await

        public boolean await​(long timeout,
                              unit)
                      throws 
        Description copied from interface: RFuture
        Waits for this future to be completed within the specified time limit.
        Specified by:
        await in interface RFuture<T>
        Parameters:
        timeout - - wait timeout
        unit - - time unit
        Returns:
        true if and only if the future was completed within the specified time limit
        Throws:
        - if the current thread was interrupted
      • await

        public boolean await​(long timeoutMillis)
                      throws 
        Description copied from interface: RFuture
        Waits for this future to be completed within the specified time limit.
        Specified by:
        await in interface RFuture<T>
        Parameters:
        timeoutMillis - - timeout value
        Returns:
        true if and only if the future was completed within the specified time limit
        Throws:
        - if the current thread was interrupted
      • awaitUninterruptibly

        public boolean awaitUninterruptibly​(long timeout,
                                             unit)
        Description copied from interface: RFuture
        Waits for this future to be completed within the specified time limit without interruption. This method catches an and discards it silently.
        Specified by:
        awaitUninterruptibly in interface RFuture<T>
        Parameters:
        timeout - - timeout value
        unit - - timeout unit value
        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: RFuture
        Waits for this future to be completed within the specified time limit without interruption. This method catches an and discards it silently.
        Specified by:
        awaitUninterruptibly in interface RFuture<T>
        Parameters:
        timeoutMillis - - timeout value
        Returns:
        true if and only if the future was completed within the specified time limit
      • getNow

        public T getNow()
        Description copied from interface: RFuture
        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 and not relay on the returned null value.
        Specified by:
        getNow in interface RFuture<T>
        Returns:
        object
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
         in interface <T>
        Overrides:
         in class <T>
      • toString

        public  toString()
        Overrides:
         in class <T>
      • onComplete

        public void onComplete​(<? super > action)
        Specified by:
        onComplete in interface RFuture<T>