|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.util.CondVar
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.
Constructor Summary | |
CondVar(java.lang.String name,
java.lang.Object cond)
|
|
CondVar(java.lang.String name,
java.lang.Object cond,
java.lang.Object lock)
|
Method Summary | |
java.lang.Object |
get()
|
java.lang.Object |
getLock()
|
void |
set(java.lang.Object result)
Sets the result |
java.lang.String |
toString()
|
void |
waitUntil(java.lang.Object result)
|
void |
waitUntil(java.lang.Object result,
long timeout)
Waits until the condition matches the expected result. |
void |
waitUntilWithTimeout(java.lang.Object result,
long timeout)
Waits until the condition matches the expected result. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CondVar(java.lang.String name, java.lang.Object cond)
public CondVar(java.lang.String name, java.lang.Object cond, java.lang.Object lock)
Method Detail |
public java.lang.Object get()
public void set(java.lang.Object result)
public java.lang.Object getLock()
public void waitUntilWithTimeout(java.lang.Object result, long timeout) throws TimeoutException
result
- The result, needs to match the condition (using equals()).timeout
- Number of milliseconds to wait. A value of <= 0 means to wait forever
TimeoutException
- Thrown if the result still doesn't match the condition after timeout
milliseconds have elapsedpublic void waitUntil(java.lang.Object result, long timeout)
result
- The result, needs to match the condition (using equals()).timeout
- Number of milliseconds to wait. A value of <= 0 means to wait foreverpublic void waitUntil(java.lang.Object result)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |