org.apache.ojb.odmg.locking
Interface LockManager

All Known Implementing Classes:
LockManagerDefaultImpl, LockManagerOdmgImpl

public interface LockManager

This interface declares the functionality of the OJB internal Locking mechanism. A default implementaion LockManagerDefaultImpl is provided. This implementaion keeps distributed locks in the database. The locking mechanisms thus involves a lot of database lookups and writes. For some environments this solution may not be adequate. OJB allows to provide user defined implementations of this interface. To activate a user defined LockManagerDefaultImpl it must be configured in the OJB.properties file.

Author:
thma

Method Summary
 boolean checkRead(TransactionImpl tx, Identity oid, Object obj)
          checks if there is a readlock for transaction tx on object obj.
 boolean checkRead(TransactionImpl tx, Object obj)
          checks if there is a readlock for transaction tx on object obj.
 boolean checkWrite(TransactionImpl tx, Identity oid, Object obj)
          checks if there is a writelock for transaction tx on object obj.
 boolean checkWrite(TransactionImpl tx, Object obj)
          checks if there is a writelock for transaction tx on object obj.
 boolean readLock(TransactionImpl tx, Identity oid, Object obj)
          aquires a readlock for transaction tx on object obj.
 boolean readLock(TransactionImpl tx, Object obj)
          aquires a readlock for transaction tx on object obj.
 boolean releaseLock(TransactionImpl tx, Identity oid, Object obj)
          releases a lock for transaction tx on object obj.
 boolean releaseLock(TransactionImpl tx, Object obj)
          releases a lock for transaction tx on object obj.
 boolean upgradeLock(TransactionImpl tx, Identity oid, Object obj)
          upgrades readlock for transaction tx on object obj to a writelock.
 boolean upgradeLock(TransactionImpl tx, Object obj)
          upgrades readlock for transaction tx on object obj to a writelock.
 boolean writeLock(TransactionImpl tx, Identity oid, Object obj)
          aquires a writelock for transaction tx on object obj.
 boolean writeLock(TransactionImpl tx, Object obj)
          aquires a writelock for transaction tx on object obj.
 

Method Detail

readLock

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


readLock

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


writeLock

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


writeLock

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


upgradeLock

boolean upgradeLock(TransactionImpl tx,
                    Object obj)
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.


upgradeLock

boolean upgradeLock(TransactionImpl tx,
                    Identity oid,
                    Object obj)
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.


releaseLock

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


releaseLock

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


checkRead

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


checkRead

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


checkWrite

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


checkWrite

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



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