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

Quick Search    Search Deep

ojb.server.lockstrategy
Class RWSerializableStrategy  view RWSerializableStrategy download RWSerializableStrategy.java

java.lang.Object
  extended byojb.server.lockstrategy.RWSerializableStrategy
All Implemented Interfaces:
ReaderWriterLock

public class RWSerializableStrategy
extends java.lang.Object
implements ReaderWriterLock


Field Summary
private  java.util.Set readers
           
private  org.odmg.Transaction writer
           
 
Fields inherited from interface ojb.server.lockstrategy.ReaderWriterLock
RW_READ_COMMITTED, RW_READ_UNCOMMITTED, RW_REPEATABLE_READ, RW_SERIALIZABLE
 
Constructor Summary
RWSerializableStrategy()
           
 
Method Summary
 boolean checkRead(org.odmg.Transaction tx)
          checkRead -- Identify if Read access is granted.
 boolean checkWrite(org.odmg.Transaction tx)
          checkWrite -- Determine if Write access is granted.
 java.lang.String getLockType(org.odmg.Transaction t)
          getLockType - Returns an "R" if it is a Read lock, "W" if it is a Write lock, or "0" (zero) if it isn't locked.
 int getStrategy()
          getStrategy -- Return ReaderWriterLock.RW_SERIALIZABLE
 boolean read(org.odmg.Transaction r)
          read -- Acquire a Read lock for the given Transaction.
 boolean release(org.odmg.Transaction t)
          release -- Release the hold on the object.
 boolean upgrade(org.odmg.Transaction u)
          upgrade -- Try to upgrade the lock to Write.
 boolean write(org.odmg.Transaction w)
          write -- Acquire a Write lock for the given transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readers

private java.util.Set readers

writer

private org.odmg.Transaction writer
Constructor Detail

RWSerializableStrategy

public RWSerializableStrategy()
Method Detail

read

public boolean read(org.odmg.Transaction r)
read -- Acquire a Read lock for the given Transaction.

Specified by:
read in interface ReaderWriterLock

write

public boolean write(org.odmg.Transaction w)
write -- Acquire a Write lock for the given transaction.

Specified by:
write in interface ReaderWriterLock

upgrade

public boolean upgrade(org.odmg.Transaction u)
upgrade -- Try to upgrade the lock to Write.

Specified by:
upgrade in interface ReaderWriterLock

release

public boolean release(org.odmg.Transaction t)
release -- Release the hold on the object.

Specified by:
release in interface ReaderWriterLock

getLockType

public java.lang.String getLockType(org.odmg.Transaction t)
getLockType - Returns an "R" if it is a Read lock, "W" if it is a Write lock, or "0" (zero) if it isn't locked.

Specified by:
getLockType in interface ReaderWriterLock

getStrategy

public int getStrategy()
getStrategy -- Return ReaderWriterLock.RW_SERIALIZABLE

Specified by:
getStrategy in interface ReaderWriterLock

checkRead

public boolean checkRead(org.odmg.Transaction tx)
checkRead -- Identify if Read access is granted.

Specified by:
checkRead in interface ReaderWriterLock

checkWrite

public boolean checkWrite(org.odmg.Transaction tx)
checkWrite -- Determine if Write access is granted.

Specified by:
checkWrite in interface ReaderWriterLock