public interface ILockManager
Modifier and Type | Method and Description |
---|---|
boolean |
checkGlobalFlag(String flagName)
Check the condition of a specified flag.
|
boolean |
checkServiceActive(String serviceType,
String serviceName)
Check whether a service is active or not.
|
boolean |
cleanupInactiveService(String serviceType,
IServiceCleanup cleanup)
Clean up any inactive services found.
|
void |
clearGlobalFlag(String flagName)
Clear a flag.
|
void |
clearLocks()
Clear all outstanding locks in the system.
|
int |
countActiveServices(String serviceType)
Count all active services of a given type.
|
void |
endServiceActivity(String serviceType,
String serviceName)
End service activity.
|
void |
enterCriticalSections(String[] readSectionKeys,
String[] nonExSectionKeys,
String[] writeSectionKeys)
Enter multiple critical sections simultaneously.
|
void |
enterLocks(String[] readLocks,
String[] nonExWriteLocks,
String[] writeLocks)
Enter multiple locks simultaneously.
|
void |
enterLocksNoWait(String[] readLocks,
String[] nonExWriteLocks,
String[] writeLocks)
Enter multiple locks simultaneously.
|
void |
enterNonExWriteCriticalSection(String sectionKey)
Enter a named, non-exclusive write critical section (NOT a lock).
|
void |
enterNonExWriteLock(String lockKey)
Enter a non-exclusive write-locked area (blocking out all readers, but letting in other "writers").
|
void |
enterNonExWriteLockNoWait(String lockKey)
Enter a non-exclusive write-locked area (blocking out all readers, but letting in other "writers").
|
void |
enterReadCriticalSection(String sectionKey)
Enter a named, read critical section (NOT a lock).
|
void |
enterReadLock(String lockKey)
Enter a read-only locked area (i.e., block ONLY if there's a writer).
|
void |
enterReadLockNoWait(String lockKey)
Enter a read-only locked area (i.e., block ONLY if there's a writer).
|
void |
enterWriteCriticalSection(String sectionKey)
Enter a named, exclusive write critical section (NOT a lock).
|
void |
enterWriteLock(String lockKey)
Enter a write locked code area (i.e., block out both readers and other writers).
|
void |
enterWriteLockNoWait(String lockKey)
Enter a write locked code area (i.e., block out both readers and other writers),
but do not wait if the lock cannot be obtained.
|
ManifoldCFConfiguration |
getSharedConfiguration()
Get the current shared configuration.
|
void |
leaveCriticalSections(String[] readSectionKeys,
String[] nonExSectionKeys,
String[] writeSectionKeys)
Leave multiple critical sections simultaneously.
|
void |
leaveLocks(String[] readLocks,
String[] nonExWriteLocks,
String[] writeLocks)
Leave multiple locks.
|
void |
leaveNonExWriteCriticalSection(String sectionKey)
Leave a named, non-exclusive write critical section (NOT a lock).
|
void |
leaveNonExWriteLock(String lockKey)
Leave a non-exclusive write locked code area.
|
void |
leaveReadCriticalSection(String sectionKey)
Leave a named, read critical section (NOT a lock).
|
void |
leaveReadLock(String lockKey)
Leave a read-locked code area.
|
void |
leaveWriteCriticalSection(String sectionKey)
Leave a named, exclusive write critical section (NOT a lock).
|
void |
leaveWriteLock(String lockKey)
Leave a write locked code area.
|
byte[] |
readData(String resourceName)
Read data from a shared data resource.
|
String |
registerServiceBeginServiceActivity(String serviceType,
String serviceName,
byte[] initialData,
IServiceCleanup cleanup)
Register a service and begin service activity.
|
String |
registerServiceBeginServiceActivity(String serviceType,
String serviceName,
IServiceCleanup cleanup)
Register a service and begin service activity.
|
byte[] |
retrieveServiceData(String serviceType,
String serviceName)
Retrieve service data for a service.
|
void |
scanServiceData(String serviceType,
IServiceDataAcceptor dataAcceptor)
Scan service data for a service type.
|
void |
setGlobalFlag(String flagName)
Raise a flag.
|
void |
timedWait(int time)
Wait for a time before retrying a lock.
|
void |
updateServiceData(String serviceType,
String serviceName,
byte[] serviceData)
Set service data for a service.
|
void |
writeData(String resourceName,
byte[] data)
Write data to a shared data resource.
|
static final String _rcsid
String registerServiceBeginServiceActivity(String serviceType, String serviceName, IServiceCleanup cleanup) throws ManifoldCFException
serviceType
- is the type of service.serviceName
- is the name of the service to register. If null is passed, a transient unique service name will be
created, and will be returned to the caller.cleanup
- is called to clean up either the current service, or all services of this type, if no other active service exists.
May be null. Local service cleanup is never called if the serviceName argument is null.ManifoldCFException
String registerServiceBeginServiceActivity(String serviceType, String serviceName, byte[] initialData, IServiceCleanup cleanup) throws ManifoldCFException
serviceType
- is the type of service.serviceName
- is the name of the service to register. If null is passed, a transient unique service name will be
created, and will be returned to the caller.initialData
- is the initial service data for this service.cleanup
- is called to clean up either the current service, or all services of this type, if no other active service exists.
May be null. Local service cleanup is never called if the serviceName argument is null.ManifoldCFException
void updateServiceData(String serviceType, String serviceName, byte[] serviceData) throws ManifoldCFException
serviceType
- is the type of service.serviceName
- is the name of the service.serviceData
- is the data to update to (may be null).
This updates the service's transient data (or deletes it). If the service is not active, an exception is thrown.ManifoldCFException
byte[] retrieveServiceData(String serviceType, String serviceName) throws ManifoldCFException
serviceType
- is the type of service.serviceName
- is the name of the service.ManifoldCFException
void scanServiceData(String serviceType, IServiceDataAcceptor dataAcceptor) throws ManifoldCFException
serviceType
- is the type of service.dataAcceptor
- is the object that will be notified of each item of data for each service name found.ManifoldCFException
int countActiveServices(String serviceType) throws ManifoldCFException
serviceType
- is the service type.ManifoldCFException
boolean cleanupInactiveService(String serviceType, IServiceCleanup cleanup) throws ManifoldCFException
serviceType
- is the service type.cleanup
- is the object to call to clean up an inactive service.ManifoldCFException
void endServiceActivity(String serviceType, String serviceName) throws ManifoldCFException
serviceType
- is the type of service.serviceName
- is the name of the service to exit.ManifoldCFException
boolean checkServiceActive(String serviceType, String serviceName) throws ManifoldCFException
serviceType
- is the type of service.serviceName
- is the name of the service to check on.ManifoldCFException
ManifoldCFConfiguration getSharedConfiguration() throws ManifoldCFException
configurationData
- is the globally-shared configuration information.ManifoldCFException
void setGlobalFlag(String flagName) throws ManifoldCFException
flagName
- is the name of the flag to set.ManifoldCFException
void clearGlobalFlag(String flagName) throws ManifoldCFException
flagName
- is the name of the flag to clear.ManifoldCFException
boolean checkGlobalFlag(String flagName) throws ManifoldCFException
flagName
- is the name of the flag to check.ManifoldCFException
byte[] readData(String resourceName) throws ManifoldCFException
resourceName
- is the global name of the resource.ManifoldCFException
void writeData(String resourceName, byte[] data) throws ManifoldCFException
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
void timedWait(int time) throws ManifoldCFException
time
- is the amount of time to wait, in milliseconds. Zero is a legal
value, and will wait no time, but will give up the current timeslice to another
thread.ManifoldCFException
void enterWriteLock(String lockKey) throws ManifoldCFException
lockKey
- is the name of the lock.ManifoldCFException
void enterWriteLockNoWait(String lockKey) throws ManifoldCFException, LockException
lockKey
- is the name of the lock.ManifoldCFException
LockException
void leaveWriteLock(String lockKey) throws ManifoldCFException
lockKey
- is the name of the lock.ManifoldCFException
void enterNonExWriteLock(String lockKey) throws ManifoldCFException
lockKey
- is the name of the lock.ManifoldCFException
void enterNonExWriteLockNoWait(String lockKey) throws ManifoldCFException, LockException
lockKey
- is the name of the lock.ManifoldCFException
LockException
void leaveNonExWriteLock(String lockKey) throws ManifoldCFException
lockKey
- is the name of the lock.ManifoldCFException
void enterReadLock(String lockKey) throws ManifoldCFException
lockKey
- is the name of the lock.ManifoldCFException
void enterReadLockNoWait(String lockKey) throws ManifoldCFException, LockException
lockKey
- is the name of the lock.ManifoldCFException
LockException
void leaveReadLock(String lockKey) throws ManifoldCFException
lockKey
- is the name of the lock.ManifoldCFException
void enterLocks(String[] readLocks, String[] nonExWriteLocks, String[] writeLocks) throws ManifoldCFException
readLocks
- is an array of read lock names, or null if there are no read locks desired.nonExWriteLocks
- is an array of non-ex write lock names, or null if none desired.writeLocks
- is an array of write lock names, or null if there are none desired.ManifoldCFException
void enterLocksNoWait(String[] readLocks, String[] nonExWriteLocks, String[] writeLocks) throws ManifoldCFException, LockException
readLocks
- is an array of read lock names, or null if there are no read locks desired.nonExWriteLocks
- is an array of non-ex write lock names, or null if none desired.writeLocks
- is an array of write lock names, or null if there are none desired.ManifoldCFException
LockException
void leaveLocks(String[] readLocks, String[] nonExWriteLocks, String[] writeLocks) throws ManifoldCFException
readLocks
- is an array of read lock names, or null if there are no read locks desired.nonExWriteLocks
- is an array of non-ex write lock names, or null if none desired.writeLocks
- is an array of write lock names, or null if there are none desired.ManifoldCFException
void clearLocks() throws ManifoldCFException
ManifoldCFException
void enterReadCriticalSection(String sectionKey) throws ManifoldCFException
sectionKey
- is the name of the section to enter. Only one thread can be in any given named
section at a time.ManifoldCFException
void leaveReadCriticalSection(String sectionKey) throws ManifoldCFException
sectionKey
- is the name of the section to leave. Only one thread can be in any given named
section at a time.ManifoldCFException
void enterNonExWriteCriticalSection(String sectionKey) throws ManifoldCFException
sectionKey
- is the name of the section to enter. Only one thread can be in any given named
section at a time.ManifoldCFException
void leaveNonExWriteCriticalSection(String sectionKey) throws ManifoldCFException
sectionKey
- is the name of the section to leave. Only one thread can be in any given named
section at a time.ManifoldCFException
void enterWriteCriticalSection(String sectionKey) throws ManifoldCFException
sectionKey
- is the name of the section to enter. Only one thread can be in any given named
section at a time.ManifoldCFException
void leaveWriteCriticalSection(String sectionKey) throws ManifoldCFException
sectionKey
- is the name of the section to leave. Only one thread can be in any given named
section at a time.ManifoldCFException
void enterCriticalSections(String[] readSectionKeys, String[] nonExSectionKeys, String[] writeSectionKeys) throws ManifoldCFException
readSectionKeys
- is an array of read section descriptors, or null if there are no read sections desired.nonExSectionKeys
- is an array of non-ex write section descriptors, or null if none desired.writeSectionKeys
- is an array of write section descriptors, or null if there are none desired.ManifoldCFException
void leaveCriticalSections(String[] readSectionKeys, String[] nonExSectionKeys, String[] writeSectionKeys) throws ManifoldCFException
readSectionKeys
- is an array of read section descriptors, or null if there are no read sections desired.nonExSectionKeys
- is an array of non-ex write section descriptors, or null if none desired.writeSectionKeys
- is an array of write section descriptors, or null if there are none desired.ManifoldCFException