|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.ejb.containers.util.cache.BaseCache
com.sun.ejb.containers.util.cache.LruCache
com.sun.ejb.containers.util.cache.LruSessionCache
public class LruSessionCache
| Nested Class Summary | |
|---|---|
protected static class |
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 org.glassfish.ha.store.api.BackingStore<java.io.Serializable,org.glassfish.ha.store.util.SimpleMetadata> |
backingStore
|
protected int |
cacheIdleTimeoutInSeconds
|
protected java.lang.String |
configData
|
protected int |
confMaxCacheSize
|
protected SFSBContainerCallback |
container
|
protected java.lang.Object |
loadCountLock
|
protected int |
loadFromBackupCount
|
protected int |
numActivated
|
int |
passivationCount
|
protected java.lang.Object |
passivationCountLock
|
protected int |
removalTimeoutInSeconds
|
protected boolean |
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 | |
|---|---|
LruSessionCache(java.lang.String cacheName,
SFSBContainerCallback container,
int cacheIdleTime,
int removalTime)
|
|
| Method Summary | |
|---|---|
void |
appendStats(java.lang.StringBuffer sbuf)
|
protected BaseCache.CacheItem |
createItem(int hashCode,
java.lang.Object sessionKey,
java.lang.Object value,
int size)
create new item |
void |
destroy()
Destroys all references. |
boolean |
eligibleForRemovalFromCache(StatefulEJBContext ctx,
java.io.Serializable sessionKey)
Called by StatefulSessionContainer before passivation to determine whether or not removal-timeout has elapsed for a cache item. |
int |
getCacheHits()
|
int |
getCacheMisses()
|
int |
getLoadFromBackupCount()
|
int |
getMaxCacheSize()
|
int |
getNumBeansInCache()
|
int |
getNumExpiredSessionsRemoved()
|
int |
getNumPassivationErrors()
|
int |
getNumPassivations()
|
int |
getNumPassivationSuccess()
|
int |
getNumVictimsAccessed()
|
protected void |
incrementLoadFromBackupCount()
|
protected void |
itemAccessed(BaseCache.CacheItem item)
this item is accessed |
StatefulEJBContext |
lookupEJB(java.io.Serializable sessionKey,
SFSBContainerCallback container,
java.lang.Object cookie)
|
boolean |
passivateEJB(StatefulEJBContext ctx,
java.io.Serializable sessionKey)
|
java.lang.Object |
remove(java.lang.Object sessionKey)
remove the item stored at the key. |
java.lang.Object |
remove(java.lang.Object sessionKey,
boolean removeFromStore)
|
void |
setBackingStore(org.glassfish.ha.store.api.BackingStore<java.io.Serializable,org.glassfish.ha.store.util.SimpleMetadata> store)
|
void |
setConfigData(java.lang.String configData)
|
void |
setMaxCacheSize(int val)
|
void |
setShutdownState()
|
void |
setStatefulSessionStoreMonitor(StatefulSessionStoreMonitor storeMonitor)
|
void |
setUndeployedState()
|
void |
shutdown()
|
protected void |
trimItem(BaseCache.CacheItem item)
trim the item from the cache and notify listeners |
void |
trimTimedoutItems(int maxTrimCount)
trim the timedOut entries from the cache. |
void |
trimUnSortedTimedoutItems(int maxCount)
This method picks idle items from a cache which does not have a sorted LRU list NRU cache at light loads and FIFO caches do not maintain a LRU list and hence they have to scan the entire cache and select victims |
java.util.Iterator |
values()
get an Iterator for the values stored in the cache |
| Methods inherited from class com.sun.ejb.containers.util.cache.LruCache |
|---|
getStatByName, getStats, itemAdded, itemRefreshed, itemRemoved, 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, 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 |
|---|
protected int numActivated
protected int cacheIdleTimeoutInSeconds
protected int removalTimeoutInSeconds
protected java.lang.Object loadCountLock
protected int loadFromBackupCount
protected boolean removeIfIdle
public int passivationCount
protected java.lang.Object passivationCountLock
protected SFSBContainerCallback container
protected org.glassfish.ha.store.api.BackingStore<java.io.Serializable,org.glassfish.ha.store.util.SimpleMetadata> backingStore
protected java.lang.String configData
protected int confMaxCacheSize
| Constructor Detail |
|---|
public LruSessionCache(java.lang.String cacheName,
SFSBContainerCallback container,
int cacheIdleTime,
int removalTime)
| Method Detail |
|---|
public void destroy()
destroy in interface Cachedestroy in class BaseCachepublic void setBackingStore(org.glassfish.ha.store.api.BackingStore<java.io.Serializable,org.glassfish.ha.store.util.SimpleMetadata> store)
public void setStatefulSessionStoreMonitor(StatefulSessionStoreMonitor storeMonitor)
protected void trimItem(BaseCache.CacheItem item)
trimItem in class BaseCacheitem - to be trimmedprotected void itemAccessed(BaseCache.CacheItem item)
LruCache
itemAccessed in class LruCacheitem - CacheItem accessed
Cache bucket is already synchronized by the callerpublic int getLoadFromBackupCount()
protected void incrementLoadFromBackupCount()
public StatefulEJBContext lookupEJB(java.io.Serializable sessionKey,
SFSBContainerCallback container,
java.lang.Object cookie)
public java.lang.Object remove(java.lang.Object sessionKey)
BaseCache
remove in interface Cacheremove in class BaseCachesessionKey - lookup key
public java.lang.Object remove(java.lang.Object sessionKey,
boolean removeFromStore)
public boolean eligibleForRemovalFromCache(StatefulEJBContext ctx,
java.io.Serializable sessionKey)
public boolean passivateEJB(StatefulEJBContext ctx,
java.io.Serializable sessionKey)
throws java.io.NotSerializableException
java.io.NotSerializableExceptionpublic void setShutdownState()
public void setUndeployedState()
public java.util.Iterator values()
values in interface Cachevalues in class BaseCachepublic void shutdown()
public void trimTimedoutItems(int maxTrimCount)
public void trimUnSortedTimedoutItems(int maxCount)
public int getNumVictimsAccessed()
protected BaseCache.CacheItem createItem(int hashCode,
java.lang.Object sessionKey,
java.lang.Object value,
int size)
LruCache
createItem in class LruCachehashCode - for the entrysessionKey - 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.public void setConfigData(java.lang.String configData)
public void appendStats(java.lang.StringBuffer sbuf)
appendStats in interface StatsProviderpublic int getCacheHits()
getCacheHits in interface EJBCacheStatsProviderpublic int getCacheMisses()
getCacheMisses in interface EJBCacheStatsProviderpublic int getNumBeansInCache()
getNumBeansInCache in interface EJBCacheStatsProviderpublic int getNumExpiredSessionsRemoved()
getNumExpiredSessionsRemoved in interface EJBCacheStatsProviderpublic int getNumPassivationErrors()
getNumPassivationErrors in interface EJBCacheStatsProviderpublic int getNumPassivations()
getNumPassivations in interface EJBCacheStatsProviderpublic int getNumPassivationSuccess()
getNumPassivationSuccess in interface EJBCacheStatsProviderpublic void setMaxCacheSize(int val)
public int getMaxCacheSize()
getMaxCacheSize in interface EJBCacheStatsProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||