|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.excalibur.concurrent.Semaphore
Constructor Summary | |
Semaphore(long tokens)
|
Method Summary | |
void |
acquire()
Aquire access to resource. |
boolean |
attempt(long msecs)
Aquire access to resource. |
void |
release()
Release lock. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Semaphore(long tokens)
Method Detail |
public void acquire() throws java.lang.InterruptedException
Sync
acquire
in interface Sync
org.apache.avalon.excalibur.concurrent.Sync
java.lang.InterruptedException
- if an error occurspublic void release()
Sync
release
in interface Sync
public boolean attempt(long msecs) throws java.lang.InterruptedException
Sync
attempt
in interface Sync
org.apache.avalon.excalibur.concurrent.Sync
msec
- the duration to wait for lock to be releasedjava.lang.InterruptedException
- if an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |