org.apache.ojb.odmg.locking
Class LockManagerDefaultImpl

java.lang.Object
  extended by org.apache.ojb.odmg.locking.LockManagerDefaultImpl
All Implemented Interfaces:
LockManager

Deprecated.

public class LockManagerDefaultImpl
extends Object
implements LockManager

The OJB default implementation of a Locking mechanism. This Implementation supports 4 transaction isolation levels as specified in the interface IsolationLevels: public final int IL_READ_UNCOMMITTED = 0; public final int IL_READ_COMMITTED = 1; public final int IL_REPEATABLE_READ = 2; public final int IL_SERIALIZABLE = 3; Isolationlevels can be adjusted per class. The proper lockhandling is done in the respective LockStrategy implementation. This default implementation provides persistent Locks that are stored in a special database table. To keep the locks in the database and not in memory allows to use them accross multiple distributed ODMG clients. Of course this solution causes a lot of database reads and writes even if no real application data is written to the database. This solution may thus not be suited for all environments. As the LockManager is pluggable its possible to replace the default implementation by user defined implementations. A different solution might be to implement the LockManager as an additional standalone server, that allows to elminate additional db reads and writes.

Author:
thma

Field Summary
private  Logger log
          Deprecated.  
 
Constructor Summary
LockManagerDefaultImpl()
          Deprecated.  
 
Method Summary
 boolean checkRead(TransactionImpl tx, Identity oid, Object obj)
          Deprecated. checks if there is a readlock for transaction tx on object obj.
 boolean checkRead(TransactionImpl tx, Object obj)
          Deprecated. checks if there is a readlock for transaction tx on object obj.
 boolean checkWrite(TransactionImpl tx, Identity oid, Object obj)
          Deprecated. checks if there is a writelock for transaction tx on object obj.
 boolean checkWrite(TransactionImpl tx, Object obj)
          Deprecated. checks if there is a writelock for transaction tx on object obj.
 boolean readLock(TransactionImpl tx, Identity oid, Object obj)
          Deprecated. aquires a readlock for transaction tx on object obj.
 boolean readLock(TransactionImpl tx, Object obj)
          Deprecated. aquires a readlock for transaction tx on object obj.
 boolean releaseLock(TransactionImpl tx, Identity oid, Object obj)
          Deprecated. releases a lock for transaction tx on object obj.
 boolean releaseLock(TransactionImpl tx, Object obj)
          Deprecated. releases a lock for transaction tx on object obj.
 boolean upgradeLock(TransactionImpl tx, Identity oid, Object obj)
          Deprecated. upgrades readlock for transaction tx on object obj to a writelock.
 boolean upgradeLock(TransactionImpl tx, Object obj)
          Deprecated. upgrades readlock for transaction tx on object obj to a writelock.
 boolean writeLock(TransactionImpl tx, Identity oid, Object obj)
          Deprecated. aquires a writelock for transaction tx on object obj.
 boolean writeLock(TransactionImpl tx, Object obj)
          Deprecated. aquires a writelock for transaction tx on object obj.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private Logger log
Deprecated. 
Constructor Detail

LockManagerDefaultImpl

public LockManagerDefaultImpl()
Deprecated. 
Method Detail

readLock

public boolean readLock(TransactionImpl tx,
                        Object obj)
Deprecated. 
aquires a readlock for transaction tx on object obj. Returns true if successful, else false.

Specified by:
readLock in interface LockManager

readLock

public boolean readLock(TransactionImpl tx,
                        Identity oid,
                        Object obj)
Deprecated. 
Description copied from interface: LockManager
aquires a readlock for transaction tx on object obj. Returns true if successful, else false.

Specified by:
readLock in interface LockManager

writeLock

public boolean writeLock(TransactionImpl tx,
                         Object obj)
Deprecated. 
aquires a writelock for transaction tx on object obj. Returns true if successful, else false.

Specified by:
writeLock in interface LockManager

writeLock

public boolean writeLock(TransactionImpl tx,
                         Identity oid,
                         Object obj)
Deprecated. 
Description copied from interface: LockManager
aquires a writelock for transaction tx on object obj. Returns true if successful, else false.

Specified by:
writeLock in interface LockManager

upgradeLock

public boolean upgradeLock(TransactionImpl tx,
                           Object obj)
Deprecated. 
upgrades readlock for transaction tx on object obj to a writelock. If no readlock existed a writelock is acquired anyway. Returns true if successful, else false.

Specified by:
upgradeLock in interface LockManager

upgradeLock

public boolean upgradeLock(TransactionImpl tx,
                           Identity oid,
                           Object obj)
Deprecated. 
Description copied from interface: LockManager
upgrades readlock for transaction tx on object obj to a writelock. If no readlock existed a writelock is acquired anyway. Returns true if successful, else false.

Specified by:
upgradeLock in interface LockManager

releaseLock

public boolean releaseLock(TransactionImpl tx,
                           Object obj)
Deprecated. 
releases a lock for transaction tx on object obj. Returns true if successful, else false.

Specified by:
releaseLock in interface LockManager

releaseLock

public boolean releaseLock(TransactionImpl tx,
                           Identity oid,
                           Object obj)
Deprecated. 
Description copied from interface: LockManager
releases a lock for transaction tx on object obj. Returns true if successful, else false.

Specified by:
releaseLock in interface LockManager

checkRead

public boolean checkRead(TransactionImpl tx,
                         Object obj)
Deprecated. 
checks if there is a readlock for transaction tx on object obj. Returns true if so, else false.

Specified by:
checkRead in interface LockManager

checkRead

public boolean checkRead(TransactionImpl tx,
                         Identity oid,
                         Object obj)
Deprecated. 
Description copied from interface: LockManager
checks if there is a readlock for transaction tx on object obj. Returns true if so, else false.

Specified by:
checkRead in interface LockManager

checkWrite

public boolean checkWrite(TransactionImpl tx,
                          Object obj)
Deprecated. 
checks if there is a writelock for transaction tx on object obj. Returns true if so, else false.

Specified by:
checkWrite in interface LockManager

checkWrite

public boolean checkWrite(TransactionImpl tx,
                          Identity oid,
                          Object obj)
Deprecated. 
Description copied from interface: LockManager
checks if there is a writelock for transaction tx on object obj. Returns true if so, else false.

Specified by:
checkWrite in interface LockManager


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