| | |
| | | public static boolean acquireSharedLock(String lockFile, |
| | | StringBuilder failureReason) |
| | | { |
| | | |
| | | mapLock.lock(); |
| | | |
| | | try |
| | |
| | | public static boolean acquireExclusiveLock(String lockFile, |
| | | StringBuilder failureReason) |
| | | { |
| | | |
| | | mapLock.lock(); |
| | | |
| | | try |
| | |
| | | public static boolean releaseLock(String lockFile, |
| | | StringBuilder failureReason) |
| | | { |
| | | |
| | | mapLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public static String getLockDirectoryPath() |
| | | { |
| | | |
| | | String lockDirectory = System.getProperty(PROPERTY_LOCK_DIRECTORY); |
| | | if ((lockDirectory == null) || (lockDirectory.length() == 0)) |
| | | { |
| | |
| | | */ |
| | | public static String getServerLockFileName() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append(getLockDirectoryPath()); |
| | | buffer.append(File.separator); |
| | |
| | | */ |
| | | public static String getBackendLockFileName(Backend backend) |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append(getLockDirectoryPath()); |
| | | buffer.append(File.separator); |