| java.lang.Object org.jgroups.util.CondVar
CondVar | public class CondVar (Code) | | Class that checks on a condition and - if condition doesn't match the expected result - waits until the result
matches the expected result, or a timeout occurs. First version used WaitableBoolean from util.concurrent, but
that class would not allow for timeouts.
author: Bela Ban version: $Id: CondVar.java,v 1.3 2004/12/31 14:10:40 belaban Exp $ |
doWait | void doWait(long timeout)(Code) | | |
waitUntil | public void waitUntil(Object result, long timeout)(Code) | | Waits until the condition matches the expected result. Returns immediately if they match, otherwise waits
for timeout milliseconds or until the results match. This method doesn't throw a TimeoutException
Parameters: result - The result, needs to match the condition (using equals()). Parameters: timeout - Number of milliseconds to wait. A value of <= 0 means to wait forever |
waitUntilWithTimeout | public void waitUntilWithTimeout(Object result, long timeout) throws TimeoutException(Code) | | Waits until the condition matches the expected result. Returns immediately if they match, otherwise waits
for timeout milliseconds or until the results match.
Parameters: result - The result, needs to match the condition (using equals()). Parameters: timeout - Number of milliseconds to wait. A value of <= 0 means to wait forever throws: TimeoutException - Thrown if the result still doesn't match the condition after timeoutmilliseconds have elapsed |
|
|