public class PromiseKeeper extends Object implements PromiseListener
| Constructor and Description |
|---|
PromiseKeeper() |
| Modifier and Type | Method and Description |
|---|---|
Optional<JoynrException> |
getError()
Get the error causing rejection of the promise.
|
Optional<JoynrException> |
getError(long timeout)
Get the error causing rejection of the promise.
|
Optional<Object[]> |
getValues()
Get the resolved values of the promise.
|
Optional<Object[]> |
getValues(long timeout)
Get the resolved values of the promise.
|
boolean |
isFulfilled() |
boolean |
isRejected() |
boolean |
isSettled() |
void |
onFulfillment(Object... values) |
void |
onRejection(JoynrException error) |
void |
waitForSettlement()
Blocks until the promise is settled.
|
void |
waitForSettlement(long timeout)
Blocks until the promise is settled or timeout is reached.
|
public void onFulfillment(Object... values)
onFulfillment in interface PromiseListenerpublic void onRejection(JoynrException error)
onRejection in interface PromiseListenerpublic Optional<Object[]> getValues() throws InterruptedException
InterruptedException - if the thread is interrupted.public Optional<Object[]> getValues(long timeout) throws InterruptedException
timeout - the maximum time to wait in milliseconds.InterruptedException - if the thread is interrupted.public Optional<JoynrException> getError() throws InterruptedException
InterruptedException - if the thread is interrupted.public Optional<JoynrException> getError(long timeout) throws InterruptedException
timeout - the maximum time to wait in milliseconds.InterruptedException - if the thread is interrupted.public void waitForSettlement()
throws InterruptedException
InterruptedException - if the thread is interrupted.public void waitForSettlement(long timeout)
throws InterruptedException
timeout - the maximum time to wait in milliseconds.InterruptedException - if the thread is interrupted.public boolean isFulfilled()
public boolean isRejected()
public boolean isSettled()
Copyright © 2021. All rights reserved.