org.apache.ojb.otm.lock
Class ObjectLock

java.lang.Object
  extended by org.apache.ojb.otm.lock.ObjectLock

public class ObjectLock
extends Object

Represents the locks held for an object. The basic assertion is that at any given point in time, there can be multiple readers, but just one writer.

Author:
Raghu Rajah

Constructor Summary
ObjectLock(Identity oid)
           
 
Method Summary
 boolean doesReaderExists()
           
 Collection getReaders()
           
 Identity getTargetIdentity()
           
 Transaction getWriter()
           
 boolean isFree()
           
 boolean isReader(Transaction tx)
           
 void readLock(Transaction tx)
           
 void releaseLock(Transaction tx)
           
 void waitForTx(Transaction tx)
           
 void writeLock(Transaction tx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectLock

public ObjectLock(Identity oid)
Method Detail

getTargetIdentity

public Identity getTargetIdentity()

getWriter

public Transaction getWriter()

isReader

public boolean isReader(Transaction tx)

doesReaderExists

public boolean doesReaderExists()

getReaders

public Collection getReaders()

readLock

public void readLock(Transaction tx)

writeLock

public void writeLock(Transaction tx)
               throws LockingException
Throws:
LockingException

releaseLock

public void releaseLock(Transaction tx)

waitForTx

public void waitForTx(Transaction tx)
               throws LockingException
Throws:
LockingException

isFree

public boolean isFree()


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