public class LruSessionCache extends LruEJBCache implements EjbCacheStatsProviderDelegate
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LruSessionCache.LruSessionCacheItem |
| Modifier and Type | Field and Description |
|---|---|
protected org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> |
backingStore |
protected int |
cacheIdleTimeoutInSeconds |
protected String |
configData |
protected int |
confMaxCacheSize |
protected SFSBContainerCallback |
container |
protected Object |
loadCountLock |
protected int |
loadFromBackupCount |
protected int |
removalTimeoutInSeconds |
protected boolean |
removeIfIdle |
_logger, cacheName| Constructor and Description |
|---|
LruSessionCache(String cacheName,
SFSBContainerCallback container,
int cacheIdleTime,
int removalTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendStats(StringBuffer sbuf) |
protected com.sun.appserv.util.cache.BaseCache.CacheItem |
createItem(int hashCode,
Object sessionKey,
Object value,
int size) |
void |
destroy()
Destroys all references.
|
boolean |
eligibleForRemovalFromCache(StatefulEJBContext ctx,
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(com.sun.appserv.util.cache.BaseCache.CacheItem item) |
StatefulEJBContext |
lookupEJB(Serializable sessionKey,
SFSBContainerCallback container,
Object cookie) |
boolean |
passivateEJB(StatefulEJBContext ctx,
Serializable sessionKey) |
Object |
remove(Object sessionKey) |
Object |
remove(Object sessionKey,
boolean removeFromStore) |
void |
setBackingStore(org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> store) |
void |
setConfigData(String configData) |
void |
setMaxCacheSize(int val) |
void |
setShutdownState() |
void |
setStatefulSessionStoreMonitor(StatefulSessionStoreMonitor storeMonitor) |
void |
setUndeployedState() |
void |
shutdown() |
protected void |
trimItem(com.sun.appserv.util.cache.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
|
Iterator |
values()
get an Iterator for the values stored in the cache
|
itemAdded, setCacheName, trimLrugetStatByName, getStats, init, itemRefreshed, itemRemoved, setTimeout, trimExpiredEntries_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, waitRefreshprotected int cacheIdleTimeoutInSeconds
protected int removalTimeoutInSeconds
protected Object loadCountLock
protected int loadFromBackupCount
protected boolean removeIfIdle
protected SFSBContainerCallback container
protected org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> backingStore
protected String configData
protected int confMaxCacheSize
public LruSessionCache(String cacheName, SFSBContainerCallback container, int cacheIdleTime, int removalTime)
public void destroy()
destroy in interface com.sun.appserv.util.cache.Cachedestroy in class com.sun.appserv.util.cache.BaseCachepublic void setBackingStore(org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> store)
public void setStatefulSessionStoreMonitor(StatefulSessionStoreMonitor storeMonitor)
protected void trimItem(com.sun.appserv.util.cache.BaseCache.CacheItem item)
trimItem in class com.sun.appserv.util.cache.BaseCacheitem - to be trimmedprotected void itemAccessed(com.sun.appserv.util.cache.BaseCache.CacheItem item)
itemAccessed in class com.sun.appserv.util.cache.LruCachepublic int getLoadFromBackupCount()
protected void incrementLoadFromBackupCount()
public StatefulEJBContext lookupEJB(Serializable sessionKey, SFSBContainerCallback container, Object cookie)
public Object remove(Object sessionKey)
remove in interface com.sun.appserv.util.cache.Cacheremove in class com.sun.appserv.util.cache.BaseCachepublic boolean eligibleForRemovalFromCache(StatefulEJBContext ctx, Serializable sessionKey)
public boolean passivateEJB(StatefulEJBContext ctx, Serializable sessionKey) throws NotSerializableException
NotSerializableExceptionpublic void setShutdownState()
public void setUndeployedState()
public Iterator values()
values in interface com.sun.appserv.util.cache.Cachevalues in class com.sun.appserv.util.cache.BaseCachepublic void shutdown()
public void trimTimedoutItems(int maxTrimCount)
public void trimUnSortedTimedoutItems(int maxCount)
public int getNumVictimsAccessed()
protected com.sun.appserv.util.cache.BaseCache.CacheItem createItem(int hashCode,
Object sessionKey,
Object value,
int size)
createItem in class com.sun.appserv.util.cache.LruCachepublic void setConfigData(String configData)
public void appendStats(StringBuffer sbuf)
appendStats in interface StatsProviderpublic int getCacheHits()
getCacheHits in interface EjbCacheStatsProviderDelegatepublic int getCacheMisses()
getCacheMisses in interface EjbCacheStatsProviderDelegatepublic int getNumBeansInCache()
getNumBeansInCache in interface EjbCacheStatsProviderDelegatepublic int getNumExpiredSessionsRemoved()
getNumExpiredSessionsRemoved in interface EjbCacheStatsProviderDelegatepublic int getNumPassivationErrors()
getNumPassivationErrors in interface EjbCacheStatsProviderDelegatepublic int getNumPassivations()
getNumPassivations in interface EjbCacheStatsProviderDelegatepublic int getNumPassivationSuccess()
getNumPassivationSuccess in interface EjbCacheStatsProviderDelegatepublic void setMaxCacheSize(int val)
public int getMaxCacheSize()
getMaxCacheSize in interface EjbCacheStatsProviderDelegateCopyright © 2017–2020 Eclipse Foundation. All rights reserved.