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.
|
Field Summary |
protected HashMap |
_refsByClass
An auxilarily dictionary so we can find all the objects
in the cache of a particular 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 |
_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).
ClassRefCacheMap
public ClassRefCacheMap()
ClassRefCacheMap
public ClassRefCacheMap(int size)
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.
Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.