| java.lang.Object org.jgroups.util.Promise
Promise | public class Promise (Code) | | Allows a thread to submit an asynchronous request and to wait for the result. The caller may choose to check
for the result at a later time, or immediately and it may block or not. Both the caller and responder have to
know the promise.
author: Bela Ban |
hasResult | boolean hasResult(Code) | | |
doWait | void doWait(long timeout)(Code) | | |
getResult | public Object getResult(long timeout)(Code) | | Returns the result, but never throws a TimeoutException; returns null instead.
Parameters: timeout - Object |
getResultWithTimeout | public Object getResultWithTimeout(long timeout) throws TimeoutException(Code) | | Blocks until a result is available, or timeout milliseconds have elapsed
Parameters: timeout - An object throws: TimeoutException.If - a timeout occurred (implies that timeout > 0) |
hasResult | public boolean hasResult()(Code) | | Checks whether result is available. Does not block.
|
reset | public void reset()(Code) | | Causes all waiting threads to return
|
setResult | public void setResult(Object obj)(Code) | | Sets the result and notifies any threads
waiting for it
|
|
|