|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.core.LockFileManager
public class LockFileManager
This class provides a mechanism for allowing the Directory Server to utilize file locks as provided by the underlying OS. File locks may be exclusive or shared, and will be visible between different processes on the same system.
Constructor Summary | |
---|---|
LockFileManager()
|
Method Summary | |
---|---|
static boolean |
acquireExclusiveLock(java.lang.String lockFile,
java.lang.StringBuilder failureReason)
Attempts to acquire an exclusive lock on the specified file. |
static boolean |
acquireSharedLock(java.lang.String lockFile,
java.lang.StringBuilder failureReason)
Attempts to acquire a shared lock on the specified file. |
static java.lang.String |
getBackendLockFileName(Backend backend)
Retrieves the filename that should be used for the lock file for the specified backend. |
static java.lang.String |
getLockDirectoryPath()
Retrieves the path to the directory that should be used to hold the lock files. |
static java.lang.String |
getServerLockFileName()
Retrieves the filename that should be used for the lock file for the Directory Server instance. |
static boolean |
releaseLock(java.lang.String lockFile,
java.lang.StringBuilder failureReason)
Attempts to release the lock on the specified file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockFileManager()
Method Detail |
---|
public static boolean acquireSharedLock(java.lang.String lockFile, java.lang.StringBuilder failureReason)
lockFile
- The file for which to obtain the shared lock.failureReason
- A buffer that can be used to hold a reason that the
lock could not be acquired.
true
if the lock was obtained successfully, or
false
if it could not be obtained.public static boolean acquireExclusiveLock(java.lang.String lockFile, java.lang.StringBuilder failureReason)
lockFile
- The file for which to obtain the exclusive lock.failureReason
- A buffer that can be used to hold a reason that the
lock could not be acquired.
true
if the lock was obtained successfully, or
false
if it could not be obtained.public static boolean releaseLock(java.lang.String lockFile, java.lang.StringBuilder failureReason)
lockFile
- The file for which to release the associated lock.failureReason
- A buffer that can be used to hold information about
a problem that occurred preventing the successful
release.
true
if the lock was found and released successfully,
or false
if a problem occurred that might have
prevented the lock from being released.public static java.lang.String getLockDirectoryPath()
public static java.lang.String getServerLockFileName()
public static java.lang.String getBackendLockFileName(Backend backend)
backend
- The backend for which to retrieve the filename for the
lock file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |