|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- A resolved value typepublic interface AResolver<T>
This is a fundamental interface that is used to return values from operation.
However it is rarely implemented directly. Usually code uses either
Promise
(that represent process returning the value) or When
that represent the process of waiting for value.
Method Summary | |
---|---|
void |
resolve(T value)
Resolve promise with value which is a result of successful execution of the operation. |
void |
smash(Throwable ex)
Smash the promise with exception. |
Methods inherited from interface net.sf.asyncobjects.AsyncObject |
---|
dereference, isImmediate |
Method Detail |
---|
void smash(Throwable ex)
ex
- an exeception that describes a reason for failure. Note that
ex must not be null. Smashing with null is normally treated as
smashing with a NullPointerException
.void resolve(T value)
value
- a value to return to promise. The value must not be a promise.
If promise is provided to resolver, resolvers implemented by
Promise
and When
treat it as if the resolver
was smashed with IllegalArgumentException
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |