com.sun.ejb.containers.util.cache
Class NRUSessionCache

java.lang.Object
  extended by com.sun.ejb.containers.util.cache.BaseCache
      extended by com.sun.ejb.containers.util.cache.LruCache
          extended by com.sun.ejb.containers.util.cache.LruSessionCache
              extended by com.sun.ejb.containers.util.cache.NRUSessionCache
All Implemented Interfaces:
Cache, EJBCacheStatsProvider, StatsProvider

public class NRUSessionCache
extends LruSessionCache


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.ejb.containers.util.cache.LruSessionCache
LruSessionCache.LruSessionCacheItem
 
Nested classes/interfaces inherited from class com.sun.ejb.containers.util.cache.LruCache
LruCache.LruCacheItem
 
Nested classes/interfaces inherited from class com.sun.ejb.containers.util.cache.BaseCache
BaseCache.CacheItem
 
Field Summary
protected  boolean doOrdering
           
protected  int orderingThreshold
           
 
Fields inherited from class com.sun.ejb.containers.util.cache.LruSessionCache
backingStore, cacheIdleTimeoutInSeconds, configData, confMaxCacheSize, container, loadCountLock, loadFromBackupCount, numActivated, passivationCount, passivationCountLock, removalTimeoutInSeconds, removeIfIdle
 
Fields inherited from class com.sun.ejb.containers.util.cache.LruCache
_logger, cacheName, head, listSize, NO_TIMEOUT, tail, timeout, trimCount
 
Fields inherited from class com.sun.ejb.containers.util.cache.BaseCache
_rb, addCount, addCountLk, bucketLocks, buckets, entryCount, entryCountLk, hitCount, hitCountLk, listeners, maxBuckets, missCount, missCountLk, overflowCount, overflowCountLk, refreshCount, refreshCountLk, refreshFlags, removalCount, removalCountLk, threshold
 
Constructor Summary
NRUSessionCache(java.lang.String cacheName, SFSBContainerCallback container, int cacheIdleTime, int removalTime)
           
 
Method Summary
 void init(int maxEntries, float loadFactor, java.util.Properties props)
          initialize the 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
 void trimTimedoutItems(int maxCount)
          trim the timedOut entries from the cache.
 
Methods inherited from class com.sun.ejb.containers.util.cache.LruSessionCache
appendStats, createItem, destroy, eligibleForRemovalFromCache, getCacheHits, getCacheMisses, getLoadFromBackupCount, getMaxCacheSize, getNumBeansInCache, getNumExpiredSessionsRemoved, getNumPassivationErrors, getNumPassivations, getNumPassivationSuccess, getNumVictimsAccessed, incrementLoadFromBackupCount, lookupEJB, passivateEJB, remove, remove, setBackingStore, setConfigData, setMaxCacheSize, setShutdownState, setStatefulSessionStoreMonitor, setUndeployedState, shutdown, trimItem, trimUnSortedTimedoutItems, values
 
Methods inherited from class com.sun.ejb.containers.util.cache.LruCache
getStatByName, getStats, setCacheName, trimExpiredEntries, trimLru
 
Methods inherited from class com.sun.ejb.containers.util.cache.BaseCache
_put, _remove, _removeItem, add, add, addCacheListener, clear, clearStats, contains, decrementEntryCount, elements, eq, get, get, getAll, getEntryCount, getIndex, getIndex, handleOverflow, hash, incrementAddCount, incrementEntryCount, incrementHitCount, incrementMissCount, incrementOverflowCount, incrementRefreshCount, incrementRemovalCount, init, isEmpty, isThresholdReached, keys, loadValue, notifyRefresh, put, put, remove, remove, removeAll, waitRefresh
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doOrdering

protected boolean doOrdering

orderingThreshold

protected int orderingThreshold
Constructor Detail

NRUSessionCache

public NRUSessionCache(java.lang.String cacheName,
                       SFSBContainerCallback container,
                       int cacheIdleTime,
                       int removalTime)
Method Detail

init

public void init(int maxEntries,
                 float loadFactor,
                 java.util.Properties props)
Description copied from class: BaseCache
initialize the cache

Specified by:
init in interface Cache
Overrides:
init in class BaseCache
Parameters:
maxEntries - maximum number of entries expected in the cache
loadFactor - the load factor
props - opaque list of properties for a given cache implementation

itemAdded

protected BaseCache.CacheItem itemAdded(BaseCache.CacheItem item)
Description copied from class: LruCache
/** this item is just added to the cache

Overrides:
itemAdded in class LruCache
Parameters:
item - CacheItem that was created
Returns:
a overflow item; may be null this function checks if adding the new item results in a overflow; if so, it returns the item to be removed. Cache bucket is already synchronized by the caller

itemAccessed

protected void itemAccessed(BaseCache.CacheItem item)
Description copied from class: LruCache
this item is accessed

Overrides:
itemAccessed in class LruSessionCache
Parameters:
item - CacheItem accessed Cache bucket is already synchronized by the caller

itemRefreshed

protected void itemRefreshed(BaseCache.CacheItem item,
                             int oldSize)
Description copied from class: LruCache
item value has been refreshed

Overrides:
itemRefreshed in class LruCache
Parameters:
item - CacheItem that was refreshed
oldSize - size of the previous value that was refreshed Cache bucket is already synchronized by the caller

itemRemoved

protected void itemRemoved(BaseCache.CacheItem item)
Description copied from class: LruCache
item value has been removed from the cache

Overrides:
itemRemoved in class LruCache
Parameters:
item - CacheItem that was just removed Cache bucket is already synchronized by the caller

trimTimedoutItems

public void trimTimedoutItems(int maxCount)
Description copied from class: LruSessionCache
trim the timedOut entries from the cache. This call is to be scheduled by a thread managed by the container. In this case a sorted LRU list exists based on access time and this list is scanned

Overrides:
trimTimedoutItems in class LruSessionCache


Copyright © 2012 GlassFish Community. All Rights Reserved.