com.macvu.tiles.cache
Class LRUCacheService
java.lang.Object
com.macvu.tiles.cache.LRUCacheService
- All Implemented Interfaces:
- CacheService
public class LRUCacheService
- extends java.lang.Object
- implements CacheService
User: MVu
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected org.apache.commons.logging.Log logger
LRUCacheService
public LRUCacheService()
LRUCacheService
public LRUCacheService(int maxCacheSize)
initiateCacheMap
protected void initiateCacheMap()
invalidateCache
public void invalidateCache()
getMaxCacheSize
public int getMaxCacheSize()
setMaxCacheSize
public void setMaxCacheSize(int maxCacheSize)
- Set the maximum cache size. If max size is reach, the least recent used item is remove before another item can be
placed on the cache. NOTE: cache is clear when the size is change.
- Parameters:
maxCacheSize
- size of the cache.
store
public boolean store(java.io.Serializable key,
java.io.Serializable result)
- add result to cache map
- Specified by:
store
in interface CacheService
- Parameters:
key
- result
-
retrieve
public java.io.Serializable retrieve(java.io.Serializable key)
- get result from cache map
- Specified by:
retrieve
in interface CacheService
- Parameters:
key
-
- Returns:
Copyright © 2005 MacVu group. All Rights Reserved.