public abstract class BaseDirectory extends Directory
Directory
that uses a LockFactory
for locking.Modifier and Type | Field and Description |
---|---|
protected boolean |
isOpen |
protected LockFactory |
lockFactory
Holds the LockFactory instance (implements locking for
this Directory instance).
|
Modifier | Constructor and Description |
---|---|
protected |
BaseDirectory(LockFactory lockFactory)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
ensureOpen() |
Lock |
obtainLock(java.lang.String name)
Returns an obtained
Lock . |
java.lang.String |
toString() |
close, copyFrom, createOutput, createTempOutput, deleteFile, fileLength, listAll, openChecksumInput, openInput, renameFile, sync
protected volatile boolean isOpen
protected final LockFactory lockFactory
protected BaseDirectory(LockFactory lockFactory)
public final Lock obtainLock(java.lang.String name) throws java.io.IOException
Directory
Lock
.obtainLock
in class Directory
name
- the name of the lock fileLockObtainFailedException
- (optional specific exception) if the lock could
not be obtained because it is currently held elsewhere.java.io.IOException
- if any i/o error occurs attempting to gain the lockprotected final void ensureOpen() throws AlreadyClosedException
ensureOpen
in class Directory
AlreadyClosedException
- if this Directory is closed