java.lang.Object | |
↳ | org.apache.lucene.store.Lock.With |
Utility class for executing code with exclusive access.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an executor that will grab the named lock.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Calls
doBody() while lock is obtained. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Code to execute with exclusive access.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs an executor that will grab the named lock.
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. Lock is released when
doBody()
exits.
LockObtainFailedException | if lock could not be obtained |
---|---|
IOException | if obtain() throws IOException
|