|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.trendrr.oss.concurrent.PeriodicLock
public class PeriodicLock
this lock will allow one thread access every x milliseconds. all threads will block while the single thread has the lock. it is useful for reinitialization code.
| Constructor Summary | |
|---|---|
PeriodicLock(long delay,
long period)
|
|
| Method Summary | |
|---|---|
java.util.Date |
getNextUnlock()
|
boolean |
lockOrSkip()
same as above, only will return false if the timedlock is locked or if another thread is accessing the restricted code. |
boolean |
lockOrWait()
will return true if the lock is obtained. |
void |
lockUntil(java.util.Date date)
forces the next time the lock will unlock. |
void |
unlock()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PeriodicLock(long delay,
long period)
| Method Detail |
|---|
public boolean lockOrWait()
public boolean lockOrSkip()
public void unlock()
public void lockUntil(java.util.Date date)
date - public java.util.Date getNextUnlock()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||