public class LockManagerInMemoryImpl extends java.lang.Object implements LockManager
LockManager interface supports a simple, fast, non-blocking
pessimistic locking for single JVM applications.DEFAULT_BLOCK_TIMEOUT, DEFAULT_LOCK_TIMEOUTIL_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 and Description |
|---|
LockManagerInMemoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
long |
getBlockTimeout()
NOOP
|
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.
|
int |
lockedObjects() |
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.
|
boolean |
removeReader(java.lang.Object key,
java.lang.Object resourceId)
Remove an read lock.
|
boolean |
removeWriter(java.lang.Object key,
java.lang.Object resourceId)
Remove an write lock.
|
void |
setBlockTimeout(long timeout)
NOOP
|
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.
|
public long getLockTimeout()
LockManagergetLockTimeout in interface LockManagerpublic void setLockTimeout(long timeout)
LockManagersetLockTimeout in interface LockManagertimeout - The lock timeout in ms of acquired read/write/upgrade locks.public long getBlockTimeout()
getBlockTimeout in interface LockManagerpublic void setBlockTimeout(long timeout)
setBlockTimeout in interface LockManagertimeout - The time to wait for acquire a lock.public java.lang.String getLockInfo()
LockManagergetLockInfo in interface LockManagerpublic boolean readLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
LockManagerreadLock in interface LockManagerkey - The owner key of the lock.resourceId - The resource to lock.isolationLevel - The isolation level of the lock.public boolean removeReader(java.lang.Object key,
java.lang.Object resourceId)
public boolean removeWriter(java.lang.Object key,
java.lang.Object resourceId)
public boolean releaseLock(java.lang.Object key,
java.lang.Object resourceId)
LockManagerreleaseLock in interface LockManagerkey - The owner key of the lock.resourceId - The resource to release.public void releaseLocks(java.lang.Object key)
LockManagerreleaseLocks in interface LockManagerkey - The owner key to release all associated locks.LockManager.releaseLocks(Object)public boolean writeLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
LockManagerwriteLock in interface LockManagerkey - 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)
LockManagerupgradeLock in interface LockManagerkey - The owner key of the lock.resourceId - The resource to lock.isolationLevel - The isolation level of the lock.public boolean hasWrite(java.lang.Object key,
java.lang.Object resourceId)
LockManagerhasWrite in interface LockManagerkey - The owner key of the lock.resourceId - The resource to check.LockManager.hasWrite(Object, Object)public boolean hasUpgrade(java.lang.Object key,
java.lang.Object resourceId)
LockManagerhasUpgrade in interface LockManagerkey - The owner key of the lock.resourceId - The resource to check.public boolean hasRead(java.lang.Object key,
java.lang.Object resourceId)
LockManagerhasRead in interface LockManagerkey - The owner key of the lock.resourceId - The resource to check.LockManager.hasRead(Object, Object)public int lockedObjects()
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30