public class ResourceLockManager extends AbstractServerObject<ServerContext>
Constructor and Description |
---|
ResourceLockManager(ServerContext serverCtx) |
Modifier and Type | Method and Description |
---|---|
ResourceLock |
acquireAsExclusiveLock(ResourceLock myLock)
Acquires and returns a new EXCLUSIVE lock for the given SHARED lock.
|
void |
checkIsDataSourceLockedByForeignSession(SessionId sessionId)
Checks whether there is a foreign DATA_SOURCE lock, no matter whether shared or exclusive.
|
void |
checkIsLockedByForeignSession(SessionId sessionId,
LockType lockType,
ResourceType resourceType,
java.lang.String resourceName) |
ResourceLock |
findResourceLock(LockType lockType,
ResourceType rscType,
java.lang.String resourceName)
Finds a particular lock by specifying all its parameters
|
ResourceLock |
findResourceLock(ResourceType rscType,
java.lang.String rscName)
Scans for all lockTypes and returns the strongest type found
|
ResourceLock[] |
findResourceLocks(LockType lockType,
ResourceType rscType)
Finds all matching locks either by
LockType or ResourceType or both. |
ResourceLock[] |
getLocks() |
int |
getSize() |
ResourceLock |
lockDataSource(SessionId sessionId,
java.lang.String dataSourceName)
Fetches an exclusive lock for the given data-source.
|
ResourceLock |
lockDataSourcePoolExclusive(SessionId sessionId)
Fetches an exclusive lock for the data-source pool.
|
ResourceLock |
lockDataSourcePoolShared(SessionId sessionId)
Fetches a shared lock for the data-source pool.
|
ResourceLock |
lockExclusive(SessionId sessionId,
ResourceType rscType,
java.lang.String rscName,
java.lang.String reason) |
ResourceLock |
lockShared(SessionId sessionId,
ResourceType rscType,
java.lang.String rscName,
java.lang.String reason) |
void |
releaseAllLocks() |
void |
releaseAllLocksOf(SessionId sessionId) |
void |
releaseLock(SessionId sessionId,
ResourceLock myLock)
Releases the given lock.
|
void |
retriggerLock(ResourceLock myLock) |
DumpString |
toDumpString(DumpString s)
This method allows subclasses to add values to the existing DumpString of the superclass.
|
ToString |
toString(ToString s)
This method allows subclasses to add values to the existing ToString of the superclass.
|
checkPermission, getServerConfig, getServerContext, getStatisticManager
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString
public ResourceLockManager(ServerContext serverCtx)
public void releaseLock(SessionId sessionId, ResourceLock myLock) throws NotLockOwnerException
NotLockOwnerException
- if the session is not the lock-ownerpublic void retriggerLock(ResourceLock myLock) throws StaleResourceLockException
StaleResourceLockException
public ResourceLock lockShared(SessionId sessionId, ResourceType rscType, java.lang.String rscName, java.lang.String reason) throws ResourceLockedException
ResourceLockedException
public ResourceLock lockExclusive(SessionId sessionId, ResourceType rscType, java.lang.String rscName, java.lang.String reason) throws ResourceLockedException, PermissionException
public void checkIsLockedByForeignSession(SessionId sessionId, LockType lockType, ResourceType resourceType, java.lang.String resourceName) throws ResourceLockedException
ResourceLockedException
public void checkIsDataSourceLockedByForeignSession(SessionId sessionId) throws ResourceLockedException
ResourceLockedException
public ResourceLock findResourceLock(LockType lockType, ResourceType rscType, java.lang.String resourceName)
public ResourceLock[] findResourceLocks(LockType lockType, ResourceType rscType)
LockType
or ResourceType
or both.
Both args may be null in order to find ALL_PERMISSIONS locks.public ResourceLock findResourceLock(ResourceType rscType, java.lang.String rscName)
public ResourceLock lockDataSource(SessionId sessionId, java.lang.String dataSourceName) throws ResourceLockedException, PermissionException
public ResourceLock lockDataSourcePoolExclusive(SessionId sessionId) throws ResourceLockedException, PermissionException
public ResourceLock lockDataSourcePoolShared(SessionId sessionId) throws ResourceLockedException
public ResourceLock acquireAsExclusiveLock(ResourceLock myLock) throws StaleResourceLockException, ResourceLockedException
ResourceLockedException
- if another user already holds an EXCLUSIVE lock on the same resourceStaleResourceLockException
- if myLock is not found in the lock-list.public ResourceLock[] getLocks()
public void releaseAllLocksOf(SessionId sessionId)
public void releaseAllLocks()
public int getSize()
public ToString toString(ToString s)
Dumpable
toString
in interface Dumpable
toString
in class AbstractServerObject<ServerContext>
public DumpString toDumpString(DumpString s)
Dumpable
toDumpString
in interface Dumpable
toDumpString
in class DumpableObject
Copyright © 2014 EsprIT-Systems. All Rights Reserved.