Class LHMLRUMemoryCache<K,V>
java.lang.Object
org.apache.commons.jcs3.engine.memory.AbstractMemoryCache<K,V>
org.apache.commons.jcs3.engine.memory.lru.LHMLRUMemoryCache<K,V>
- All Implemented Interfaces:
IMemoryCache<K,V>
This is a test memory manager using the jdk1.4 LinkedHashMap.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classImplementation of removeEldestEntry in LinkedHashMap -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a synchronized LHMSpoolervoidDump the cache entries from first to last for debugging.intfreeElements(int numberToFree) This can't be implemented.This returns semi-structured information on the memory cache, such as the size, put count, hit count, and miss count.voidinitialize(CompositeCache<K, V> hub) For post reflection creation initializationprotected voidUpdate control structures after get (guarded by the lock)protected voidRemoves all cached items from the cache control structures.protected voidRemove element from control structure (guarded by the lock)voidupdate(ICacheElement<K, V> ce) Puts an item to the cache.Methods inherited from class org.apache.commons.jcs3.engine.memory.AbstractMemoryCache
dispose, dumpMap, get, getCacheAttributes, getCacheName, getCompositeCache, getKeySet, getMultiple, getQuiet, getSize, remove, removeAll, removeByGroup, removeByHierarchy, setCacheAttributes, waterfal
-
Constructor Details
-
LHMLRUMemoryCache
public LHMLRUMemoryCache()
-
-
Method Details
-
initialize
For post reflection creation initialization- Specified by:
initializein interfaceIMemoryCache<K,V> - Overrides:
initializein classAbstractMemoryCache<K,V> - Parameters:
hub-
-
createMap
Returns a synchronized LHMSpooler- Specified by:
createMapin classAbstractMemoryCache<K,V> - Returns:
- Collections.synchronizedMap( new LHMSpooler() )
-
update
Puts an item to the cache.- Specified by:
updatein interfaceIMemoryCache<K,V> - Specified by:
updatein classAbstractMemoryCache<K,V> - Parameters:
ce- Description of the Parameter- Throws:
IOException
-
lockedGetElement
Update control structures after get (guarded by the lock)- Specified by:
lockedGetElementin classAbstractMemoryCache<K,V> - Parameters:
me- the memory element descriptor
-
lockedRemoveElement
Remove element from control structure (guarded by the lock)- Specified by:
lockedRemoveElementin classAbstractMemoryCache<K,V> - Parameters:
me- the memory element descriptor
-
lockedRemoveAll
Removes all cached items from the cache control structures. (guarded by the lock)- Specified by:
lockedRemoveAllin classAbstractMemoryCache<K,V>
-
getStatistics
This returns semi-structured information on the memory cache, such as the size, put count, hit count, and miss count.- Specified by:
getStatisticsin interfaceIMemoryCache<K,V> - Overrides:
getStatisticsin classAbstractMemoryCache<K,V> - Returns:
- IStats
-
dumpCacheEntries
Dump the cache entries from first to last for debugging. -
freeElements
This can't be implemented.- Parameters:
numberToFree-- Returns:
- 0
- Throws:
IOException
-