public class FileLockerImpl extends java.lang.Object implements FileLocker
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
LOCKFILE_SUFFIX |
private org.eclipse.osgi.service.datalocation.Location |
lockFileLocation |
(package private) java.io.File |
lockMarkerFile |
Constructor and Description |
---|
FileLockerImpl(java.io.File file,
org.eclipse.osgi.service.datalocation.Location anyLocation) |
Modifier and Type | Method and Description |
---|---|
boolean |
isLocked()
Whether the file associated with this locker object is currently locked (by this process or
any other process).
|
void |
lock()
Equivalent to {
FileLocker.lock(long) with a timeout argument of 10000 milliseconds. |
void |
lock(long timeout)
Attempt to lock the file associated with this locker object.
|
void |
release()
Release the lock if acquired.
|
private static final java.lang.String LOCKFILE_SUFFIX
private final org.eclipse.osgi.service.datalocation.Location lockFileLocation
final java.io.File lockMarkerFile
public FileLockerImpl(java.io.File file, org.eclipse.osgi.service.datalocation.Location anyLocation)
public void lock()
FileLocker
FileLocker.lock(long)
with a timeout argument of 10000 milliseconds.lock
in interface FileLocker
public void lock(long timeout)
FileLocker
lock
in interface FileLocker
timeout
- timeout in millisecondspublic void release()
FileLocker
release
in interface FileLocker
public boolean isLocked()
FileLocker
isLocked
in interface FileLocker