public class FileLockManager extends BaseLockManager
Modifier and Type | Class and Description |
---|---|
protected static class |
FileLockManager.ByteArrayBuffer |
BaseLockManager.LockDescription
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected static int |
BASE_SIZE |
protected static Integer |
lockPoolInitialization |
protected static LockPool |
myFileLocks |
protected File |
synchDirectory |
static String |
synchDirectoryProperty
Synchronization directory property - local to this implementation of ILockManager
|
activePrefix, anonymousServiceNamePrefix, anonymousServiceTypeCounter, globalData, globalFlags, localLocks, localSections, myLocks, mySections, serviceDataPrefix, serviceListPrefix, servicePrefix, serviceTypeLockPrefix, threadID, TYPE_READ, TYPE_WRITE, TYPE_WRITENONEX
Constructor and Description |
---|
FileLockManager() |
FileLockManager(File synchDirectory) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkGlobalFlag(String flagName)
Check the condition of a specified flag.
|
void |
clearGlobalFlag(String flagName)
Clear a flag.
|
protected static String |
getFlagResourceName(String flagName)
Calculate the name of a flag resource.
|
protected LockPool |
getGlobalLockPool()
Override this method to change the nature of global locks.
|
static File |
getSynchDirectoryProperty()
Get the synch directory property.
|
protected String |
makeFilePath(String key)
Create a file path given a key name.
|
byte[] |
readData(String resourceName)
Read data from a shared data resource.
|
void |
setGlobalFlag(String flagName)
Raise a flag.
|
void |
writeData(String resourceName,
byte[] data)
Write data to a shared data resource.
|
buildServiceListEntry, buildServiceTypeLockName, checkServiceActive, cleanupInactiveService, clear, clearLocks, constructUniqueServiceName, countActiveServices, deleteServiceData, endServiceActivity, enter, enterCriticalSections, enterLocks, enterLocksNoWait, enterNonExWrite, enterNonExWriteCriticalSection, enterNonExWriteLock, enterNonExWriteLockNoWait, enterNonExWriteNoWait, enterNoWait, enterRead, enterReadCriticalSection, enterReadLock, enterReadLockNoWait, enterReadNoWait, enterWrite, enterWriteCriticalSection, enterWriteLock, enterWriteLockNoWait, enterWriteNoWait, getSharedConfiguration, getSortedUniqueLocks, leave, leaveCriticalSections, leaveLocks, leaveNonExWrite, leaveNonExWriteCriticalSection, leaveNonExWriteLock, leaveRead, leaveReadCriticalSection, leaveReadLock, leaveWrite, leaveWriteCriticalSection, leaveWriteLock, makeActiveServiceFlagName, makeRegisteredServiceFlagName, makeServiceCounterName, makeServiceDataName, readServiceCounter, readServiceData, readServiceName, registerServiceBeginServiceActivity, registerServiceBeginServiceActivity, retrieveServiceData, scanServiceData, timedWait, updateServiceData, writeServiceCounter, writeServiceData, writeServiceName
public static final String _rcsid
public static final String synchDirectoryProperty
protected static final Integer lockPoolInitialization
protected static LockPool myFileLocks
protected File synchDirectory
protected static final int BASE_SIZE
public FileLockManager(File synchDirectory) throws ManifoldCFException
ManifoldCFException
public FileLockManager() throws ManifoldCFException
ManifoldCFException
public static File getSynchDirectoryProperty() throws ManifoldCFException
ManifoldCFException
protected static String getFlagResourceName(String flagName)
flagName
- is the name of the flag.public void setGlobalFlag(String flagName) throws ManifoldCFException
setGlobalFlag
in interface ILockManager
setGlobalFlag
in class BaseLockManager
flagName
- is the name of the flag to set.ManifoldCFException
public void clearGlobalFlag(String flagName) throws ManifoldCFException
clearGlobalFlag
in interface ILockManager
clearGlobalFlag
in class BaseLockManager
flagName
- is the name of the flag to clear.ManifoldCFException
public boolean checkGlobalFlag(String flagName) throws ManifoldCFException
checkGlobalFlag
in interface ILockManager
checkGlobalFlag
in class BaseLockManager
flagName
- is the name of the flag to check.ManifoldCFException
public byte[] readData(String resourceName) throws ManifoldCFException
readData
in interface ILockManager
readData
in class BaseLockManager
resourceName
- is the global name of the resource.ManifoldCFException
public void writeData(String resourceName, byte[] data) throws ManifoldCFException
writeData
in interface ILockManager
writeData
in class BaseLockManager
resourceName
- is the global name of the resource.data
- is the byte array containing the data. Pass null if you want to delete the resource completely.ManifoldCFException
protected LockPool getGlobalLockPool()
getGlobalLockPool
in class BaseLockManager