public interface FileLocker
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 {
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.
|
void lock() throws LockTimeoutException
lock(long)
with a timeout argument of 10000 milliseconds.LockTimeoutException
void lock(long timeout) throws LockTimeoutException
timeout
- timeout in millisecondsLockTimeoutException
- if lock cannot be obtained for more than the specified timeout in millseconds.void release()
boolean isLocked()