|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.store.Lock.With
Utility class for executing code with exclusive access.
Constructor Summary | |
Lock.With(Lock lock)
Deprecated. Kept only to avoid breaking existing code. |
|
Lock.With(Lock lock,
long lockWaitTimeout)
Constructs an executor that will grab the named lock. |
Method Summary | |
protected abstract java.lang.Object |
doBody()
Code to execute with exclusive access. |
java.lang.Object |
run()
Calls doBody() while lock is obtained. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Lock.With(Lock lock)
public Lock.With(Lock lock, long lockWaitTimeout)
Method Detail |
protected abstract java.lang.Object doBody() throws java.io.IOException
java.io.IOException
public java.lang.Object run() throws java.io.IOException
doBody()
while lock is obtained. Blocks if lock
cannot be obtained immediately. Retries to obtain lock once per second
until it is obtained, or until it has tried ten times. Lock is released when
doBody()
exits.
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |