|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.odmg.locking.InMemoryLockMapImpl
We use a HashMap and synchronize blocks of access for a get "check" then put operation. We cannot use the hashtable as you could check in one synchronized call then put in another while a different thread is doing the same thing.
Constructor Summary | |
InMemoryLockMapImpl()
|
Method Summary | |
boolean |
addReader(TransactionImpl tx,
java.lang.Object obj)
Add a reader lock entry for transaction tx on object obj to the persistent storage. |
(package private) void |
addReaderInternal(LockEntry reader)
|
void |
configure(Configuration pConfig)
configure an object using the Configuration pConfig |
java.util.Collection |
getReaders(Identity oid)
|
java.util.Collection |
getReaders(java.lang.Object obj)
returns a collection of Reader LockEntries for object obj. |
(package private) int |
getSize()
|
LockEntry |
getWriter(Identity oid)
|
LockEntry |
getWriter(java.lang.Object obj)
returns the LockEntry for the Writer of object obj. |
(package private) boolean |
hasReadLock(LockEntry entry)
|
boolean |
hasReadLock(TransactionImpl tx,
java.lang.Object obj)
check if there is a reader lock entry for transaction tx on object obj in the persistent storage. |
void |
removeReader(TransactionImpl tx,
java.lang.Object obj)
remove a reader lock entry for transaction tx on object obj from the persistent storage. |
(package private) void |
removeReaderByLock(LockEntry lock)
|
void |
removeWriter(LockEntry writer)
remove a writer lock entry for transaction tx on object obj from the persistent storage. |
boolean |
setWriter(TransactionImpl tx,
java.lang.Object obj)
generate a writer lock entry for transaction tx on object obj and write it to the persistent storage. |
(package private) void |
setWriterByLock(LockEntry writer)
|
boolean |
upgradeLock(LockEntry reader)
upgrade a reader lock entry for transaction tx on object obj and write it to the persistent storage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InMemoryLockMapImpl()
Method Detail |
public LockEntry getWriter(java.lang.Object obj)
getWriter
in interface LockMap
public LockEntry getWriter(Identity oid)
public java.util.Collection getReaders(java.lang.Object obj)
getReaders
in interface LockMap
public java.util.Collection getReaders(Identity oid)
public boolean addReader(TransactionImpl tx, java.lang.Object obj)
addReader
in interface LockMap
void addReaderInternal(LockEntry reader)
public void removeReader(TransactionImpl tx, java.lang.Object obj)
removeReader
in interface LockMap
void removeReaderByLock(LockEntry lock)
public void removeWriter(LockEntry writer)
removeWriter
in interface LockMap
public boolean upgradeLock(LockEntry reader)
upgradeLock
in interface LockMap
public boolean setWriter(TransactionImpl tx, java.lang.Object obj)
setWriter
in interface LockMap
void setWriterByLock(LockEntry writer)
public boolean hasReadLock(TransactionImpl tx, java.lang.Object obj)
hasReadLock
in interface LockMap
boolean hasReadLock(LockEntry entry)
public void configure(Configuration pConfig) throws ConfigurationException
Configurable
configure
in interface Configurable
pConfig
- the Configuration object used to configure current instance
ConfigurationException
int getSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |