org.apache.lucene.store
Class Lock.With
java.lang.Object
|
+--org.apache.lucene.store.Lock.With
- Enclosing class:
- Lock
- public abstract static class Lock.With
- extends Object
Utility class for executing code with exclusive access.
Constructor Summary |
Lock.With(Lock lock)
Constructs an executor that will grab the named lock. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Lock.With
public Lock.With(Lock lock)
- Constructs an executor that will grab the named lock.
doBody
protected abstract Object doBody()
throws IOException
- Code to execute with exclusive access.
run
public Object run()
throws IOException
- Calls
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.
Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.