2.17.2: 2011-06-17

net.sf.basedb.util
Class StaticCache.LockEntry

java.lang.Object
  extended by net.sf.basedb.util.StaticCache.LockEntry
All Implemented Interfaces:
ReadWriteLock
Enclosing class:
StaticCache

static class StaticCache.LockEntry
extends Object
implements ReadWriteLock

Keeps track of a locked cached entry. The 'key' is the same key instance that was used to create the entry in the first place. It is important that all active maintainers of a lock also keeps a strong reference to the key since the lock entry may otherwise be reclaimed by the garbage collector.


Field Summary
private  WeakReference<String> keyRef
           
private  ReadWriteLock rwLock
           
 
Constructor Summary
StaticCache.LockEntry(ReadWriteLock rwLock, String key)
           
 
Method Summary
 String getKey()
           
 Lock readLock()
           
 String toString()
           
 Lock writeLock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rwLock

private ReadWriteLock rwLock

keyRef

private WeakReference<String> keyRef
Constructor Detail

StaticCache.LockEntry

StaticCache.LockEntry(ReadWriteLock rwLock,
                      String key)
Method Detail

writeLock

public Lock writeLock()
Specified by:
writeLock in interface ReadWriteLock

readLock

public Lock readLock()
Specified by:
readLock in interface ReadWriteLock

getKey

public String getKey()

toString

public String toString()
Overrides:
toString in class Object

2.17.2: 2011-06-17