org.apache.ojb.odmg.locking
Interface LockStrategy

All Known Implementing Classes:
AbstractLockStrategy

public interface LockStrategy

this interface defines method that a Locking Strategy must implement * according to the transaction isolation level it represents. *


Method Summary
 boolean checkRead(TransactionImpl tx, java.lang.Object obj)
          checks whether the specified Object obj is read-locked by Transaction tx.
 boolean checkWrite(TransactionImpl tx, java.lang.Object obj)
          checks whether the specified Object obj is write-locked by Transaction tx.
 boolean readLock(TransactionImpl tx, java.lang.Object obj)
          acquire a read lock on Object obj for Transaction tx.
 boolean releaseLock(TransactionImpl tx, java.lang.Object obj)
          release a lock on Object obj for Transaction tx.
 boolean upgradeLock(TransactionImpl tx, java.lang.Object obj)
          acquire a lock upgrade (from read to write) lock on Object obj for Transaction tx.
 boolean writeLock(TransactionImpl tx, java.lang.Object obj)
          acquire a write lock on Object obj for Transaction tx.
 

Method Detail

readLock

public boolean readLock(TransactionImpl tx,
                        java.lang.Object obj)
acquire a read lock on Object obj for Transaction tx. * @param tx the transaction requesting the lock * @param obj the Object to be locked * @return true if successful, else false *


writeLock

public boolean writeLock(TransactionImpl tx,
                         java.lang.Object obj)
acquire a write lock on Object obj for Transaction tx. * @param tx the transaction requesting the lock * @param obj the Object to be locked * @return true if successful, else false *


upgradeLock

public boolean upgradeLock(TransactionImpl tx,
                           java.lang.Object obj)
acquire a lock upgrade (from read to write) lock on Object obj for Transaction tx. * @param tx the transaction requesting the lock * @param obj the Object to be locked * @return true if successful, else false *


releaseLock

public boolean releaseLock(TransactionImpl tx,
                           java.lang.Object obj)
release a lock on Object obj for Transaction tx. * @param tx the transaction releasing the lock * @param obj the Object to be unlocked * @return true if successful, else false *


checkRead

public boolean checkRead(TransactionImpl tx,
                         java.lang.Object obj)
checks whether the specified Object obj is read-locked by Transaction tx. * @param tx the transaction * @param obj the Object to be checked * @return true if lock exists, else false


checkWrite

public boolean checkWrite(TransactionImpl tx,
                          java.lang.Object obj)
checks whether the specified Object obj is write-locked by Transaction tx. * @param tx the transaction * @param obj the Object to be checked * @return true if lock exists, else false



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