|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.tinygroup.jspengine.appserv.util.cache.BaseCache
org.tinygroup.jspengine.appserv.util.cache.MultiLruCache
public class MultiLruCache
MultiLruCache -- in-memory bounded LRU cache with multiple LRU lists Underlying Hashtable is made into logical segments, with each segment having its own LRU list.
| 嵌套类摘要 |
|---|
| 从类 org.tinygroup.jspengine.appserv.util.cache.BaseCache 继承的嵌套类/接口 |
|---|
BaseCache.CacheItem |
| 字段摘要 | |
|---|---|
static int |
DEFAULT_HASHTABLE_SEGMENT_SIZE
|
protected int[] |
listsLength
|
static int |
LRU_HEAD
|
static int |
LRU_TAIL
|
| 从类 org.tinygroup.jspengine.appserv.util.cache.BaseCache 继承的字段 |
|---|
_rb, bucketLocks, buckets, entryCount, listeners, maxBuckets, refreshFlags, threshold |
| 构造方法摘要 | |
|---|---|
MultiLruCache()
|
|
| 方法摘要 | |
|---|---|
protected BaseCache.CacheItem |
createItem(int hashCode,
Object key,
Object value,
int size)
create new item |
Object |
getStatByName(String key)
get the desired statistic counter |
Map |
getStats()
get the stats snapshot |
protected void |
handleOverflow()
cache has reached threshold so trim its size. subclasses are expected to provide a robust cache replacement algorithm. |
protected void |
incrementTrimIndex()
|
void |
init(int maxCapacity,
Properties props)
initialize the LRU cache |
protected void |
itemAccessed(BaseCache.CacheItem item)
this item is accessed |
protected BaseCache.CacheItem |
itemAdded(BaseCache.CacheItem item)
this item is just added to the cache |
protected void |
itemRefreshed(BaseCache.CacheItem item,
int oldSize)
item value has been refreshed |
protected void |
itemRemoved(BaseCache.CacheItem item)
item value has been removed from the cache |
protected BaseCache.CacheItem |
trimLru(int segment)
remove an lru item from one of the LRU lists |
| 从类 org.tinygroup.jspengine.appserv.util.cache.BaseCache 继承的方法 |
|---|
_put, _remove, _removeItem, add, add, addCacheListener, clear, clearStats, contains, decrementEntryCount, destroy, elements, eq, get, get, getAll, getEntryCount, getIndex, getIndex, hash, incrementAddCount, incrementEntryCount, incrementHitCount, incrementMissCount, incrementOverflowCount, incrementRefreshCount, incrementRemovalCount, init, isEmpty, isThresholdReached, keys, loadValue, notifyRefresh, put, put, remove, remove, remove, removeAll, trimExpiredEntries, trimItem, values, waitRefresh |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final int LRU_HEAD
public static final int LRU_TAIL
public static final int DEFAULT_HASHTABLE_SEGMENT_SIZE
protected int[] listsLength
| 构造方法详细信息 |
|---|
public MultiLruCache()
| 方法详细信息 |
|---|
public void init(int maxCapacity,
Properties props)
throws Exception
Cache 中的 initBaseCache 中的 initmaxCapacity - maximum number of entries this cache may holdprops - opaque list of properties for a given cache implementation
Exception
protected BaseCache.CacheItem createItem(int hashCode,
Object key,
Object value,
int size)
BaseCache 中的 createItemhashCode - for the entrykey - Object keyvalue - Object valuesize - size in bytes of the item
subclasses may override to provide their own CacheItem extensions
e.g. one that permits persistence.protected BaseCache.CacheItem trimLru(int segment)
the - LRU segment index to trim
protected BaseCache.CacheItem itemAdded(BaseCache.CacheItem item)
BaseCache 中的 itemAddeditem - CacheItem that was created
protected void itemAccessed(BaseCache.CacheItem item)
BaseCache 中的 itemAccesseditem - CacheItem accessed
Cache bucket is already synchronized by the caller
protected void itemRefreshed(BaseCache.CacheItem item,
int oldSize)
BaseCache 中的 itemRefresheditem - CacheItem that was refreshedoldSize - size of the previous value that was refreshed
Cache bucket is already synchronized by the callerprotected void itemRemoved(BaseCache.CacheItem item)
BaseCache 中的 itemRemoveditem - CacheItem that was just removed
Cache bucket is already synchronized by the callerprotected void handleOverflow()
BaseCache 中的 handleOverflowprotected void incrementTrimIndex()
public Object getStatByName(String key)
Cache 中的 getStatByNameBaseCache 中的 getStatByNamekey - to corresponding stat
public Map getStats()
Cache 中的 getStatsBaseCache 中的 getStats
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||