org.fjank.jcache.persistence
Class ReadWriteLock

java.lang.Object
  extended byorg.fjank.jcache.persistence.ReadWriteLock

public class ReadWriteLock
extends java.lang.Object

This class coordinates concurrent calls to an object's get and set methods so that calls to the object set methods do not interfere with each other or with calls to the object's get methods.

Only a single instance of this class should be created per specific resource that requires Read/Write lock protection.

The invariant required by this class is that the method done must be called, and only be called, after a previous call to either the method readLock or writeLock. This class coordinates concurrent calls to an object's get and set methods so that calls to the object set methods do not interfere with each other or with calls to the object's get methods.

Only a single instance of this class should be created per specific resource that requires Read/Write lock protection.

The invariant required by this class is that the method done must be called, and only be called, after a previous call to either the method readLock or writeLock. todo we will use oswego instead, so this can be deleted.


Constructor Summary
ReadWriteLock()
          Default constructor.
 
Method Summary
 void done()
          finishes this lock
 void readLock()
          adds a new readlock
 void writeLock()
          Unsynchronized writeLock. todo rewrite me.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadWriteLock

public ReadWriteLock()
Default constructor.

Method Detail

readLock

public void readLock()
adds a new readlock


writeLock

public void writeLock()
Unsynchronized writeLock. todo rewrite me.


done

public void done()
          throws DiskCacheException
finishes this lock

Throws:
DiskCacheException - if exceptioins occur.


Copyright © 2002-2004 Hosted by SourceForge. All Rights Reserved.