public interface StateLock
Modifier and Type | Method and Description |
---|---|
boolean |
tryToWhen(StateCondition when,
java.lang.Runnable runnable)
Try to acquire the lock, and then do something when the
condition is true.
|
boolean |
waitToWhen(StateCondition when,
java.lang.Runnable runnable)
Wait to do something when the condition is true.
|
boolean tryToWhen(StateCondition when, java.lang.Runnable runnable) throws OddjobLockedException
OddjobLockedException
is thrown.when
- The condition.runnable
- The action.OddjobLockedException
- If the lock can not be acquired.boolean waitToWhen(StateCondition when, java.lang.Runnable runnable)
when
- The condition.runnable
- The action.