SolarMetric Kodo JDO 3.4.1 generated on May 30 2006

kodo.datacache
Class ClassRefCacheMap

java.lang.Object
  |
  +--kodo.util.CacheMap
        |
        +--kodo.datacache.ClassRefCacheMap
All Implemented Interfaces:
Map

public class ClassRefCacheMap
extends CacheMap

A map that keeps hard references to a fixed number of elements and moves expired references to a soft reference map. Additionally, objects that are pinned are not counted towards the max size of the map. This implementation is thread-safe.


Inner classes inherited from class java.util.Map
Map.Entry
 
Field Summary
protected  HashMap _refsByClass
          An auxilarily dictionary so we can find all the objects in the cache of a particular class.
 
Fields inherited from class kodo.util.CacheMap
_lruMap, _pinnedMap, _softMap
 
Constructor Summary
ClassRefCacheMap()
           
ClassRefCacheMap(int size)
           
 
Method Summary
 void clear()
          Removes pinned objects as well as unpinned ones.
protected  void entryHardRefAdded(Object key, Object value)
           
protected  void entryRemoved(Object key, Object value)
           
protected  void entryWeakRefAdded(Object key, Object value)
           
 void removeAll(Class cls)
          Removes all objects of the specified instantiable class.
 
Methods inherited from class kodo.util.CacheMap
containsKey, containsValue, entrySet, get, getCacheSize, getPinnedKeys, getSoftReferenceSize, getStatistics, isEmpty, keyRemoved, keySet, pin, put, putAll, remove, setCacheSize, setSoftReferenceSize, size, unpin, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

_refsByClass

protected final HashMap _refsByClass
An auxilarily dictionary so we can find all the objects in the cache of a particular class. The dict keys are classes and the values are ReferenceCollections (hashsets of OIDs). Each ReferenceCollection holds refs to OIDs that are either hard refs (for pinned/lru) or weak refs (for OIDs in the softmap).
Constructor Detail

ClassRefCacheMap

public ClassRefCacheMap()

ClassRefCacheMap

public ClassRefCacheMap(int size)
Method Detail

entryRemoved

protected void entryRemoved(Object key,
                            Object value)
Overrides:
entryRemoved in class CacheMap

entryWeakRefAdded

protected void entryWeakRefAdded(Object key,
                                 Object value)
Overrides:
entryWeakRefAdded in class CacheMap

entryHardRefAdded

protected void entryHardRefAdded(Object key,
                                 Object value)
Overrides:
entryHardRefAdded in class CacheMap

clear

public void clear()
Description copied from class: CacheMap
Removes pinned objects as well as unpinned ones.
Overrides:
clear in class CacheMap

removeAll

public void removeAll(Class cls)
Removes all objects of the specified instantiable class. Does not remove sub classes of the specified class.

SolarMetric Kodo JDO 3.4.1 generated on May 30 2006

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.