|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.ce.commonj.utils.BooleanLock
This class is a simple semaphore used to synchronize access to shared resources.
Constructor Summary | |
BooleanLock()
Creates a new BooleanLock object with initial value false. |
|
BooleanLock(boolean initialValue)
Creates a new BooleanLock object with specified initial value |
Method Summary | |
boolean |
isFalse()
Check if BooleanLock value is false |
boolean |
isTrue()
Check if BooleanLock value is true |
void |
setValue(boolean newValue)
Set a new value to BooleanLock. |
boolean |
waitToSetFalse(long msTimeout)
Set BooleanLock value to false if it is set to true before the timeout. |
boolean |
waitToSetTrue(long msTimeout)
Set BooleanLock value to true if it is set to false before the timeout. |
boolean |
waitUntilFalse(long msTimeout)
Check if the value of the BooleanLock is false or wait for a maximum amount of time specified by msTimeout that the value is set to false. |
boolean |
waitUntilStateIs(boolean state,
long msTimeout)
Check if the value of the BooleanLock equals the specified state or wait for a maximum amount of time specified by msTimeout that the value is set to the specified state. |
boolean |
waitUntilTrue(long msTimeout)
Check if the value of the BooleanLock is true or wait for a maximum amount of time specified by msTimeout that the value is set to true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BooleanLock()
public BooleanLock(boolean initialValue)
Method Detail |
public void setValue(boolean newValue)
newValue
- The boolean new value.public boolean waitToSetTrue(long msTimeout) throws java.lang.InterruptedException
msTimeout
- The timeout expressed in milliseconds.
If 0L wait indefinitely.
java.lang.InterruptedException
public boolean waitToSetFalse(long msTimeout) throws java.lang.InterruptedException
msTimeout
- The timeout expressed in milliseconds.
If 0L wait indefinitely.
java.lang.InterruptedException
public boolean isTrue()
public boolean isFalse()
public boolean waitUntilTrue(long msTimeout) throws java.lang.InterruptedException
msTimeout
- The maximum amount of time to wait before return a response.
This is expressed in milliseconds.
If 0L wait indefinitely.
java.lang.InterruptedException
public boolean waitUntilFalse(long msTimeout) throws java.lang.InterruptedException
msTimeout
- The maximum amount of time to wait before return a response.
This is expressed in milliseconds.
If 0L wait indefinitely.
java.lang.InterruptedException
public boolean waitUntilStateIs(boolean state, long msTimeout) throws java.lang.InterruptedException
msTimeout
- The maximum amount of time to wait before return a response.
This is expressed in milliseconds.
If 0L wait indefinitely.
java.lang.InterruptedException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |