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 class
Implementation of removeEldestEntry in LinkedHashMap -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a synchronized LHMSpoolervoid
Dump the cache entries from first to last for debugging.int
freeElements
(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.void
initialize
(CompositeCache<K, V> hub) For post reflection creation initializationprotected void
Update control structures after get (guarded by the lock)protected void
Removes all cached items from the cache control structures.protected void
Remove element from control structure (guarded by the lock)void
update
(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:
initialize
in interfaceIMemoryCache<K,
V> - Overrides:
initialize
in classAbstractMemoryCache<K,
V> - Parameters:
hub
-
-
createMap
Returns a synchronized LHMSpooler- Specified by:
createMap
in classAbstractMemoryCache<K,
V> - Returns:
- Collections.synchronizedMap( new LHMSpooler() )
-
update
Puts an item to the cache.- Specified by:
update
in interfaceIMemoryCache<K,
V> - Specified by:
update
in classAbstractMemoryCache<K,
V> - Parameters:
ce
- Description of the Parameter- Throws:
IOException
-
lockedGetElement
Update control structures after get (guarded by the lock)- Specified by:
lockedGetElement
in classAbstractMemoryCache<K,
V> - Parameters:
me
- the memory element descriptor
-
lockedRemoveElement
Remove element from control structure (guarded by the lock)- Specified by:
lockedRemoveElement
in 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:
lockedRemoveAll
in 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:
getStatistics
in interfaceIMemoryCache<K,
V> - Overrides:
getStatistics
in 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
-