| java.lang.Object org.apache.ojb.odmg.locking.AbstractLockStrategy
All known Subclasses: org.apache.ojb.odmg.locking.RepeatableReadStrategy, org.apache.ojb.odmg.locking.SerializableStrategy, org.apache.ojb.odmg.locking.ReadCommittedStrategy, org.apache.ojb.odmg.locking.ReadUncommittedStrategy,
AbstractLockStrategy | abstract public class AbstractLockStrategy implements LockStrategy(Code) | | The base class of all LockingStrategies. It provides the basic
infrastructure to read and write locks to the persistent storage.
author: Thomas Mahler |
Method Summary | |
protected boolean | addReader(TransactionImpl tx, Object obj) Add a reader lock entry for transaction tx on object obj
to the persistent storage. | protected Collection | getReaders(Object obj) returns a collection of Reader LockEntries for object obj. | protected LockEntry | getWriter(Object obj) returns the LockEntry for the Writer of object obj. | protected boolean | hasReadLock(TransactionImpl tx, Object obj) check if there is a reader lock entry for transaction tx on object obj
in the persistent storage. | protected void | removeReader(TransactionImpl tx, Object obj) remove a reader lock entry for transaction tx on object obj
from the persistent storage. | protected void | removeWriter(LockEntry writer) remove a writer lock entry for transaction tx on object obj
from the persistent storage. | protected boolean | setWriter(TransactionImpl tx, Object obj) generate a writer lock entry for transaction tx on object obj
and write it to the persistent storage. | protected boolean | upgradeLock(LockEntry reader) upgrade a reader lock entry for transaction tx on object obj
and write it to the persistent storage. |
DEFAULT_LOCK_TIMEOUT | public static long DEFAULT_LOCK_TIMEOUT(Code) | | the timeout for lock entries
|
AbstractLockStrategy | public AbstractLockStrategy()(Code) | | |
addReader | protected boolean addReader(TransactionImpl tx, Object obj)(Code) | | Add a reader lock entry for transaction tx on object obj
to the persistent storage.
|
getReaders | protected Collection getReaders(Object obj)(Code) | | returns a collection of Reader LockEntries for object obj.
If now LockEntries could be found an empty Vector is returned.
|
getWriter | protected LockEntry getWriter(Object obj)(Code) | | returns the LockEntry for the Writer of object obj.
If now writer exists, null is returned.
|
hasReadLock | protected boolean hasReadLock(TransactionImpl tx, Object obj)(Code) | | check if there is a reader lock entry for transaction tx on object obj
in the persistent storage.
|
removeReader | protected void removeReader(TransactionImpl tx, Object obj)(Code) | | remove a reader lock entry for transaction tx on object obj
from the persistent storage.
|
removeWriter | protected void removeWriter(LockEntry writer)(Code) | | remove a writer lock entry for transaction tx on object obj
from the persistent storage.
|
setWriter | protected boolean setWriter(TransactionImpl tx, Object obj)(Code) | | generate a writer lock entry for transaction tx on object obj
and write it to the persistent storage.
|
upgradeLock | protected boolean upgradeLock(LockEntry reader)(Code) | | upgrade a reader lock entry for transaction tx on object obj
and write it to the persistent storage.
|
|
|