public abstract class AbstractResilientPromise<T> extends java.lang.Object implements ResilientPromise<T>
| Constructor and Description |
|---|
AbstractResilientPromise() |
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Block on this promise being completed.
|
boolean |
await(long timeout,
java.util.concurrent.TimeUnit unit) |
T |
awaitResult()
Block on this promise being completed and return the result.
|
java.lang.Exception |
getError()
Return any error that has been delivered.
|
T |
getResult()
Return any result that has been delivered.
|
Status |
getStatus()
Return the status of the promise.
|
boolean |
isDone()
Indicate if the
Status of the promise is not pending. |
boolean |
isError()
Indicate if the
Status of the promise is error. |
boolean |
isSuccessful()
Indicate if the
Status of the promise is successful. |
boolean |
isTimedOut()
Indicate if the
Status of the promise is timeout. |
void |
wrapPromise(ResilientPromise<T> promise) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeliverError, deliverResult, setTimedOutprotected volatile T result
public void await()
throws java.lang.InterruptedException
ResilientPromiseawait in interface ResilientPromise<T>java.lang.InterruptedExceptionpublic boolean await(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
await in interface ResilientPromise<T>java.lang.InterruptedExceptionpublic T awaitResult() throws java.lang.InterruptedException
ResilientPromiseawaitResult in interface ResilientPromise<T>java.lang.InterruptedExceptionpublic T getResult()
ResilientPromisegetResult in interface ResilientPromise<T>public java.lang.Exception getError()
ResilientPromisegetError in interface ResilientPromise<T>public Status getStatus()
ResilientPromisegetStatus in interface ResilientPromise<T>public boolean isSuccessful()
ResilientPromiseStatus of the promise is successful.isSuccessful in interface ResilientPromise<T>public boolean isDone()
ResilientPromiseStatus of the promise is not pending.isDone in interface ResilientPromise<T>public boolean isError()
ResilientPromiseStatus of the promise is error.isError in interface ResilientPromise<T>public boolean isTimedOut()
ResilientPromiseStatus of the promise is timeout.isTimedOut in interface ResilientPromise<T>public void wrapPromise(ResilientPromise<T> promise)
Copyright © 2014 Tim Brooks. All Rights Reserved.