| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private volatile String | fileName
The lock file name. |
| private long | lastWrite
The last time the lock file was written. |
| private volatile boolean | locked
Whether the file is locked. |
| private static final String | |
| private String | |
| private Properties | |
| private static final int | |
| private volatile ServerSocket | serverSocket
The server socket (only used when using the SOCKET mode). |
| private final int | sleep
The number of milliseconds to sleep after checking a file. |
| private static final int | |
| private static final String | |
| private static final int | |
| private final Trace | trace
The trace object. |
| private String | |
| private Thread |
| Access | Constructor and Description |
|---|---|
| public | FileLock(TraceSystem
the trace system to use traceSystem, String the file name fileName, int the number of milliseconds to sleep sleep)Create a new file locking object. |
| Modifier and Type | Method and Description |
|---|---|
| private static long | Returns: last modified date/time in milliseconds UTCfile name to check fileName)Aggressively read last modified time, to work-around remote filesystems. |
| private void | |
| private DbException | |
| private static DbException | |
| public static FileLockMethod | Returns: the method typethe method name method)Get the file locking method type given a method name. |
| public String | |
| public Properties | |
| public synchronized void | |
| private void | |
| private void | |
| public void | |
| public Properties | |
| public void | |
| private void | |
| private static void | |
| public synchronized void | |
| private void |
| FILE | back to summary |
|---|---|
| private static final String FILE | |
| fileName | back to summary |
|---|---|
| private volatile String fileName The lock file name. | |
| lastWrite | back to summary |
|---|---|
| private long lastWrite The last time the lock file was written. | |
| locked | back to summary |
|---|---|
| private volatile boolean locked Whether the file is locked. | |
| MAGIC | back to summary |
|---|---|
| private static final String MAGIC | |
| method | back to summary |
|---|---|
| private String method | |
| properties | back to summary |
|---|---|
| private Properties properties | |
| RANDOM_BYTES | back to summary |
|---|---|
| private static final int RANDOM_BYTES | |
| serverSocket | back to summary |
|---|---|
| private volatile ServerSocket serverSocket The server socket (only used when using the SOCKET mode). | |
| sleep | back to summary |
|---|---|
| private final int sleep The number of milliseconds to sleep after checking a file. | |
| SLEEP_GAP | back to summary |
|---|---|
| private static final int SLEEP_GAP | |
| SOCKET | back to summary |
|---|---|
| private static final String SOCKET | |
| TIME_GRANULARITY | back to summary |
|---|---|
| private static final int TIME_GRANULARITY | |
| trace | back to summary |
|---|---|
| private final Trace trace The trace object. | |
| uniqueId | back to summary |
|---|---|
| private String uniqueId | |
| watchdog | back to summary |
|---|---|
| private Thread watchdog | |
| FileLock | back to summary |
|---|---|
| public FileLock(TraceSystem traceSystem, String fileName, int sleep) Create a new file locking object.
| |
| aggressiveLastModified | back to summary |
|---|---|
| private static long aggressiveLastModified(String fileName) Aggressively read last modified time, to work-around remote filesystems.
| |
| checkServer | back to summary |
|---|---|
| private void checkServer() | |
| getExceptionAlreadyInUse | back to summary |
|---|---|
| private DbException getExceptionAlreadyInUse(String reason) | |
| getExceptionFatal | back to summary |
|---|---|
| private static DbException getExceptionFatal(String reason, Throwable t) | |
| getFileLockMethod | back to summary |
|---|---|
| public static FileLockMethod getFileLockMethod(String method) Get the file locking method type given a method name.
| |
| getUniqueId | back to summary |
|---|---|
| public String getUniqueId() | |
| load | back to summary |
|---|---|
| public Properties load() Load the properties file.
| |
| lock | back to summary |
|---|---|
| public synchronized void lock(FileLockMethod fileLockMethod) Lock the file if possible. A file may only be locked once.
| |
| lockFile | back to summary |
|---|---|
| private void lockFile() | |
| lockSocket | back to summary |
|---|---|
| private void lockSocket() | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| save | back to summary |
|---|---|
| public Properties save() Save the lock file.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(String key, String value) Add or change a setting to the properties. This call does not save the file. | |
| setUniqueId | back to summary |
|---|---|
| private void setUniqueId() | |
| sleep | back to summary |
|---|---|
| private static void sleep(int time) | |
| unlock | back to summary |
|---|---|
| public synchronized void unlock() Unlock the file. The watchdog thread is stopped. This method does nothing if the file is already unlocked. | |
| waitUntilOld | back to summary |
|---|---|
| private void waitUntilOld() | |