java.lang.Object
ojb.server.lockstrategy.RWSerializableStrategy
- All Implemented Interfaces:
- ReaderWriterLock
- public class RWSerializableStrategy
- extends java.lang.Object
- implements ReaderWriterLock
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
readers
private java.util.Set readers
writer
private org.odmg.Transaction writer
RWSerializableStrategy
public RWSerializableStrategy()
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