org.apache.ojb.otm.lock
Class ObjectLock

java.lang.Object
  extended byorg.apache.ojb.otm.lock.ObjectLock

public class ObjectLock
extends java.lang.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()
           
 java.util.Collection getReaders()
           
 Identity getTargetIdentity()
           
 Transaction getWriter()
           
 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 java.util.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


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