|
Java EE 5 SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.appserv.util.cache.BaseCache
com.sun.appserv.util.cache.MultiLruCache
com.sun.appserv.util.cache.BoundedMultiLruCache
public class BoundedMultiLruCache
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sun.appserv.util.cache.BaseCache |
|---|
BaseCache.CacheItem |
| Field Summary | |
|---|---|
protected long |
currentSize
|
protected long |
maxSize
|
| Fields inherited from class com.sun.appserv.util.cache.MultiLruCache |
|---|
DEFAULT_HASHTABLE_SEGMENT_SIZE, listsLength, LRU_HEAD, LRU_TAIL |
| Fields inherited from class com.sun.appserv.util.cache.BaseCache |
|---|
_rb, bucketLocks, buckets, entryCount, listeners, maxBuckets, refreshFlags, threshold |
| Constructor Summary | |
|---|---|
BoundedMultiLruCache()
|
|
| Method Summary | |
|---|---|
protected void |
decrementCurrentSize(int size)
|
Object |
getStatByName(String key)
get the desired statistic counter |
Map |
getStats()
get the stats snapshot |
protected void |
incrementCurrentSize(int size)
synchronized counter updates |
void |
init(int maxCapacity,
Properties props)
initialize the LRU cache |
protected boolean |
isThresholdReached()
has cache reached its threshold |
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 |
| Methods inherited from class com.sun.appserv.util.cache.MultiLruCache |
|---|
createItem, handleOverflow, incrementTrimIndex, itemAccessed, trimLru |
| Methods inherited from class com.sun.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, keys, loadValue, notifyRefresh, put, put, remove, remove, remove, removeAll, trimExpiredEntries, trimItem, values, waitRefresh |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long maxSize
protected long currentSize
| Constructor Detail |
|---|
public BoundedMultiLruCache()
| Method Detail |
|---|
public void init(int maxCapacity,
Properties props)
throws Exception
init in interface Cacheinit in class MultiLruCachemaxCapacity - maximum number of entries this cache may holdprops - opaque list of properties for a given cache implementation
Exceptionprotected BaseCache.CacheItem itemAdded(BaseCache.CacheItem item)
itemAdded in class MultiLruCacheitem - CacheItem that was created
protected void itemRefreshed(BaseCache.CacheItem item,
int oldSize)
itemRefreshed in class MultiLruCacheitem - 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)
itemRemoved in class MultiLruCacheitem - CacheItem that was just removed
Cache bucket is already synchronized by the callerprotected boolean isThresholdReached()
isThresholdReached in class BaseCacheprotected final void incrementCurrentSize(int size)
protected final void decrementCurrentSize(int size)
public Object getStatByName(String key)
getStatByName in interface CachegetStatByName in class MultiLruCachekey - to corresponding stat
public Map getStats()
MultiLruCache
getStats in interface CachegetStats in class MultiLruCache
|
Java EE 5 SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved.