|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.locking.LockManagerCommonsImpl
public class LockManagerCommonsImpl
A LockManager
implementation based on apache's commons-transaction
locking part.
Field Summary |
---|
Fields inherited from interface org.apache.ojb.broker.locking.LockManager |
---|
DEFAULT_BLOCK_TIMEOUT, DEFAULT_LOCK_TIMEOUT |
Fields inherited from interface org.apache.ojb.broker.locking.IsolationLevels |
---|
IL_DEFAULT, IL_NONE, IL_OPTIMISTIC, IL_READ_COMMITTED, IL_READ_UNCOMMITTED, IL_REPEATABLE_READ, IL_SERIALIZABLE, LITERAL_IL_NONE, LITERAL_IL_OPTIMISTIC, LITERAL_IL_READ_COMMITTED, LITERAL_IL_READ_UNCOMMITTED, LITERAL_IL_REPEATABLE_READ, LITERAL_IL_SERIALIZABLE |
Constructor Summary | |
---|---|
LockManagerCommonsImpl()
|
Method Summary | |
---|---|
long |
getBlockTimeout()
The maximal time to wait for acquire a lock. |
java.lang.String |
getLockInfo()
Returns info about the used lock manager implementation and the state of the lock manager. |
long |
getLockTimeout()
Get the current used lock timeout value in milliseconds. |
boolean |
hasRead(java.lang.Object key,
java.lang.Object resourceId)
Checks if there is a read lock for owner key on resource object. |
boolean |
hasUpgrade(java.lang.Object key,
java.lang.Object resourceId)
Checks if there is a upgrade lock for lock key on resource object. |
boolean |
hasWrite(java.lang.Object key,
java.lang.Object resourceId)
Checks if there is a write lock for lock key on resource object. |
boolean |
readLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
Acquires a readlock for lock key on resource object. |
boolean |
releaseLock(java.lang.Object key,
java.lang.Object resourceId)
Releases a lock for lock key on resource object. |
void |
releaseLocks(java.lang.Object key)
Release all resource locks hold by the specified owner key. |
void |
setBlockTimeout(long blockTimeout)
Set the maximal time to wait for acquire a lock in milliseconds. |
void |
setLockTimeout(long timeout)
Set the lock timeout value in milliseconds. |
boolean |
upgradeLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
Acquire an upgrade lock. |
boolean |
writeLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
Acquires a write lock for lock key on resource object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockManagerCommonsImpl()
Method Detail |
---|
public long getLockTimeout()
LockManager
getLockTimeout
in interface LockManager
public void setLockTimeout(long timeout)
LockManager
setLockTimeout
in interface LockManager
timeout
- The lock timeout in ms of acquired read/write/upgrade locks.public long getBlockTimeout()
LockManager
getBlockTimeout
in interface LockManager
public void setBlockTimeout(long blockTimeout)
LockManager
setBlockTimeout
in interface LockManager
blockTimeout
- The time to wait for acquire a lock.public java.lang.String getLockInfo()
LockManager
getLockInfo
in interface LockManager
public boolean readLock(java.lang.Object key, java.lang.Object resourceId, int isolationLevel)
LockManager
readLock
in interface LockManager
key
- The owner key of the lock.resourceId
- The resource to lock.isolationLevel
- The isolation level of the lock.
public boolean writeLock(java.lang.Object key, java.lang.Object resourceId, int isolationLevel)
LockManager
writeLock
in interface LockManager
key
- The owner key of the lock.resourceId
- The resource to lock.isolationLevel
- The isolation level of the lock.
public boolean upgradeLock(java.lang.Object key, java.lang.Object resourceId, int isolationLevel)
LockManager
upgradeLock
in interface LockManager
key
- The owner key of the lock.resourceId
- The resource to lock.isolationLevel
- The isolation level of the lock.
public boolean releaseLock(java.lang.Object key, java.lang.Object resourceId)
LockManager
releaseLock
in interface LockManager
key
- The owner key of the lock.resourceId
- The resource to release.
public void releaseLocks(java.lang.Object key)
LockManager
releaseLocks
in interface LockManager
key
- The owner key to release all associated locks.public boolean hasRead(java.lang.Object key, java.lang.Object resourceId)
LockManager
hasRead
in interface LockManager
key
- The owner key of the lock.resourceId
- The resource to check.
public boolean hasWrite(java.lang.Object key, java.lang.Object resourceId)
LockManager
hasWrite
in interface LockManager
key
- The owner key of the lock.resourceId
- The resource to check.
public boolean hasUpgrade(java.lang.Object key, java.lang.Object resourceId)
LockManager
hasUpgrade
in interface LockManager
key
- The owner key of the lock.resourceId
- The resource to check.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |