org.apache.ojb.odmg.locking
Interface LockMap

All Superinterfaces:
Configurable
All Known Implementing Classes:
InMemoryLockMapImpl, PersistentLockMapImpl, RemoteLockMapImpl

public interface LockMap
extends Configurable


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.
 java.util.Collection getReaders(java.lang.Object obj)
          returns a collection of Reader LockEntries for object obj.
 LockEntry getWriter(java.lang.Object obj)
          returns the LockEntry for the Writer of object obj.
 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.
 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.
 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 interface org.apache.ojb.broker.util.configuration.Configurable
configure
 

Method Detail

getWriter

public LockEntry getWriter(java.lang.Object obj)
returns the LockEntry for the Writer of object obj. * If now writer exists, null is returned.


getReaders

public java.util.Collection getReaders(java.lang.Object obj)
returns a collection of Reader LockEntries for object obj. * If now LockEntries could be found an empty Vector is returned.


addReader

public boolean addReader(TransactionImpl tx,
                         java.lang.Object obj)
Add a reader lock entry for transaction tx on object obj * to the persistent storage.


removeReader

public void removeReader(TransactionImpl tx,
                         java.lang.Object obj)
remove a reader lock entry for transaction tx on object obj * from the persistent storage.


removeWriter

public void removeWriter(LockEntry writer)
remove a writer lock entry for transaction tx on object obj * from the persistent storage.


upgradeLock

public boolean upgradeLock(LockEntry reader)
upgrade a reader lock entry for transaction tx on object obj * and write it to the persistent storage.


setWriter

public 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.


hasReadLock

public 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.



Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14