private class SingleInstanceLockFactory.SingleInstanceLock extends Lock
Modifier and Type | Field and Description |
---|---|
private boolean |
closed |
private java.lang.String |
lockName |
Constructor and Description |
---|
SingleInstanceLock(java.lang.String lockName) |
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.lang.String lockName
private volatile boolean closed
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