static final class NativeFSLockFactory.NativeFSLock extends Lock
Modifier and Type | Field and Description |
---|---|
(package private) java.nio.channels.FileChannel |
channel |
(package private) boolean |
closed |
(package private) java.nio.file.attribute.FileTime |
creationTime |
(package private) java.nio.channels.FileLock |
lock |
(package private) java.nio.file.Path |
path |
Constructor and Description |
---|
NativeFSLock(java.nio.channels.FileLock lock,
java.nio.channels.FileChannel channel,
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() |
final java.nio.channels.FileLock lock
final java.nio.channels.FileChannel channel
final java.nio.file.Path path
final java.nio.file.attribute.FileTime creationTime
volatile boolean closed
NativeFSLock(java.nio.channels.FileLock lock, java.nio.channels.FileChannel channel, java.nio.file.Path path, java.nio.file.attribute.FileTime creationTime)
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