public class FileLock
extends java.lang.Object
implements java.lang.Runnable
| Constructor and Description |
|---|
FileLock(TraceSystem traceSystem,
java.lang.String fileName,
int sleep)
Create a new file locking object.
|
| Modifier and Type | Method and Description |
|---|---|
static FileLockMethod |
getFileLockMethod(java.lang.String method)
Get the file locking method type given a method name.
|
java.lang.String |
getUniqueId() |
java.util.Properties |
load()
Load the properties file.
|
void |
lock(FileLockMethod fileLockMethod)
Lock the file if possible.
|
void |
run() |
java.util.Properties |
save()
Save the lock file.
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Add or change a setting to the properties.
|
void |
unlock()
Unlock the file.
|
public FileLock(TraceSystem traceSystem, java.lang.String fileName, int sleep)
traceSystem - the trace system to usefileName - the file namesleep - the number of milliseconds to sleeppublic void lock(FileLockMethod fileLockMethod)
fileLockMethod - the file locking method to useDbException - if locking was not successfulpublic void unlock()
public void setProperty(java.lang.String key,
java.lang.String value)
key - the keyvalue - the valuepublic java.util.Properties save()
public java.util.Properties load()
public static FileLockMethod getFileLockMethod(java.lang.String method)
method - the method nameDbException - if the method name is unknownpublic java.lang.String getUniqueId()
public void run()
run in interface java.lang.Runnable