static final class SimpleFSLockFactory.SimpleFSLock extends Lock
Modifier and Type | Field and Description |
---|---|
private boolean |
closed |
private java.nio.file.attribute.FileTime |
creationTime |
private java.nio.file.Path |
path |
Constructor and Description |
---|
SimpleFSLock(java.nio.file.Path path,
java.nio.file.attribute.FileTime creationTime) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases exclusive access.
|
void |
ensureValid()
Best effort check that this lock is still valid.
|
java.lang.String |
toString() |
private final java.nio.file.Path path
private final java.nio.file.attribute.FileTime creationTime
private volatile boolean closed
SimpleFSLock(java.nio.file.Path path, java.nio.file.attribute.FileTime creationTime) throws java.io.IOException
java.io.IOException
public void ensureValid() throws java.io.IOException
Lock
ensureValid
in class Lock
java.io.IOException
- if the lock is no longer valid.public void close() throws java.io.IOException
Lock
Note that exceptions thrown from close may require human intervention, as it may mean the lock was no longer valid, or that fs permissions prevent removal of the lock file, or other reasons.
public java.lang.String toString()
toString
in class java.lang.Object