NRUSessionCachepublic class NRUSessionCache extends LruSessionCache
Fields Summary |
---|
protected boolean | doOrdering | protected int | orderingThreshold |
Methods Summary |
---|
public void | init(int maxEntries, float loadFactor, java.util.Properties props)
super.init(maxEntries, loadFactor, props);
orderingThreshold = (int) (0.75 * threshold);
| protected void | itemAccessed(CacheItem item)
LruCacheItem lc = (LruCacheItem) item;
synchronized (this) {
if (lc.isTrimmed) {
lc.isTrimmed = false;
CacheItem overflow = super.itemAdded(item);
if (overflow != null) {
trimItem(overflow);
}
} else if (doOrdering) {
super.itemAccessed(item);
}
}
| protected CacheItem | itemAdded(CacheItem item)
CacheItem addedItem = super.itemAdded(item);
doOrdering = (entryCount >= orderingThreshold);
return addedItem;
| protected void | itemRefreshed(CacheItem item, int oldSize)
| protected void | itemRemoved(CacheItem item)
super.itemRemoved(item);
doOrdering = (entryCount >= orderingThreshold);
| public void | trimTimedoutItems(int maxCount)
// If we are maintaining an ordered list use
// the superclass method for trimming
if (doOrdering) {
super.trimTimedoutItems(maxCount);
} else {
// we don't have an ordered list,
// so go through the whole cache and pick victims
trimUnSortedTimedoutItems(maxCount);
}
|
|