Class LockableFile.LockFile
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.lockingfile.LockableFile.LockFile
-
- All Implemented Interfaces:
LockableFile.InterProcessLock
- Enclosing class:
- LockableFile
private class LockableFile.LockFile extends java.lang.Object implements LockableFile.InterProcessLock
This is an alternative approach to locking a file system-wide.This is not recommended as there are claims that this is not reliable. Most likely there are issues with remote file systems but the claims do not go into detail.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FilelockFilestatic longSTALENESS_INTERVAL_IN_MILLIS
-
Constructor Summary
Constructors Modifier Constructor Description privateLockFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddeleteStaleLockFile()voidlock()booleantryLock()voidunlock()
-
-
-
Field Detail
-
STALENESS_INTERVAL_IN_MILLIS
public static final long STALENESS_INTERVAL_IN_MILLIS
- See Also:
- Constant Field Values
-
lockFile
private final java.io.File lockFile
-
-
Method Detail
-
lock
public void lock() throws java.io.IOException- Specified by:
lockin interfaceLockableFile.InterProcessLock- Throws:
java.io.IOException
-
tryLock
public boolean tryLock() throws java.io.IOException- Specified by:
tryLockin interfaceLockableFile.InterProcessLock- Throws:
java.io.IOException
-
unlock
public void unlock() throws java.io.IOException- Specified by:
unlockin interfaceLockableFile.InterProcessLock- Throws:
java.io.IOException
-
deleteStaleLockFile
private void deleteStaleLockFile() throws java.io.IOException- Throws:
java.io.IOException
-
-