Class PromiseKeeper

    • Constructor Detail

      • PromiseKeeper

        public PromiseKeeper()
    • Method Detail

      • getValues

        public Optional<Object[]> getValues()
                                     throws InterruptedException
        Get the resolved values of the promise. If the promise is not settled, the call blocks until the promise is settled.
        Returns:
        the resolved values or null in case of timeout.
        Throws:
        InterruptedException - if the thread is interrupted.
      • getValues

        public Optional<Object[]> getValues​(long timeout)
                                     throws InterruptedException
        Get the resolved values of the promise. If the promise is not settled, the call blocks until the promise is settled or timeout is reached.
        Parameters:
        timeout - the maximum time to wait in milliseconds.
        Returns:
        the resolved values or null in case of timeout.
        Throws:
        InterruptedException - if the thread is interrupted.
      • getError

        public Optional<JoynrException> getError()
                                          throws InterruptedException
        Get the error causing rejection of the promise. If the promise is not settled, the call blocks until the promise is settled.
        Returns:
        the error causing rejection or null in case of timeout.
        Throws:
        InterruptedException - if the thread is interrupted.
      • getError

        public Optional<JoynrException> getError​(long timeout)
                                          throws InterruptedException
        Get the error causing rejection of the promise. If the promise is not settled, the call blocks until the promise is settled or timeout is reached.
        Parameters:
        timeout - the maximum time to wait in milliseconds.
        Returns:
        the error causing rejection or null in case of timeout.
        Throws:
        InterruptedException - if the thread is interrupted.
      • waitForSettlement

        public void waitForSettlement​(long timeout)
                               throws InterruptedException
        Blocks until the promise is settled or timeout is reached.
        Parameters:
        timeout - the maximum time to wait in milliseconds.
        Throws:
        InterruptedException - if the thread is interrupted.
      • isFulfilled

        public boolean isFulfilled()
      • isRejected

        public boolean isRejected()
      • isSettled

        public boolean isSettled()