org.apache.ojb.odmg.locking
Class InMemoryLockMapImpl

java.lang.Object
  extended by org.apache.ojb.odmg.locking.InMemoryLockMapImpl
All Implemented Interfaces:
Configurable, LockMap

Deprecated.

public class InMemoryLockMapImpl
extends Object
implements LockMap

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.

Version:
$Id: InMemoryLockMapImpl.java,v 1.1 2007-08-24 22:17:28 ewestfal Exp $
Author:
Matthew Baird update for use of Hashmap with synchronization. implemented timed out lock removal algo., Thomas Mahler original author.

Constructor Summary
InMemoryLockMapImpl()
          Deprecated.  
 
Method Summary
 boolean addReader(TransactionImpl tx, Object obj)
          Deprecated. Add a reader lock entry for transaction tx on object obj to the persistent storage.
 void configure(Configuration pConfig)
          Deprecated. configure an object using the Configuration pConfig
 Collection getReaders(Identity oid)
          Deprecated.  
 Collection getReaders(Object obj)
          Deprecated. returns a collection of Reader LockEntries for object obj.
 LockEntry getWriter(Identity oid)
          Deprecated.  
 LockEntry getWriter(Object obj)
          Deprecated. returns the LockEntry for the Writer of object obj.
 boolean hasReadLock(TransactionImpl tx, Object obj)
          Deprecated. check if there is a reader lock entry for transaction tx on object obj in the persistent storage.
 void removeReader(TransactionImpl tx, Object obj)
          Deprecated. remove a reader lock entry for transaction tx on object obj from the persistent storage.
 void removeWriter(LockEntry writer)
          Deprecated. remove a writer lock entry for transaction tx on object obj from the persistent storage.
 boolean setWriter(TransactionImpl tx, Object obj)
          Deprecated. generate a writer lock entry for transaction tx on object obj and write it to the persistent storage.
 boolean upgradeLock(LockEntry reader)
          Deprecated. 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

InMemoryLockMapImpl

public InMemoryLockMapImpl()
Deprecated. 
Method Detail

getWriter

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

Specified by:
getWriter in interface LockMap

getWriter

public LockEntry getWriter(Identity oid)
Deprecated. 

getReaders

public Collection getReaders(Object obj)
Deprecated. 
returns a collection of Reader LockEntries for object obj. If no LockEntries could be found an empty Vector is returned.

Specified by:
getReaders in interface LockMap

getReaders

public Collection getReaders(Identity oid)
Deprecated. 

addReader

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

Specified by:
addReader in interface LockMap

removeReader

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

Specified by:
removeReader in interface LockMap

removeWriter

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

Specified by:
removeWriter in interface LockMap

upgradeLock

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

Specified by:
upgradeLock in interface LockMap

setWriter

public boolean setWriter(TransactionImpl tx,
                         Object obj)
Deprecated. 
generate a writer lock entry for transaction tx on object obj and write it to the persistent storage.

Specified by:
setWriter in interface LockMap

hasReadLock

public boolean hasReadLock(TransactionImpl tx,
                           Object obj)
Deprecated. 
check if there is a reader lock entry for transaction tx on object obj in the persistent storage.

Specified by:
hasReadLock in interface LockMap

configure

public void configure(Configuration pConfig)
               throws ConfigurationException
Deprecated. 
Description copied from interface: Configurable
configure an object using the Configuration pConfig

Specified by:
configure in interface Configurable
Parameters:
pConfig - the Configuration object used to configure current instance
Throws:
ConfigurationException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.