Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ojb.odmg.locking
Interface LockManager  view LockManager download LockManager.java

All Known Implementing Classes:
LockManagerDefaultImpl

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.


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

Method Detail

readLock

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


writeLock

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


upgradeLock

public boolean upgradeLock(ojb.odmg.TransactionImpl tx,
                           java.lang.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

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


checkRead

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


checkWrite

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