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

java.lang.Object
  extended by com.sun.ejb.containers.util.cache.BaseCache
      extended by com.sun.ejb.containers.util.cache.UnboundedEJBObjectCache
All Implemented Interfaces:
Cache, EJBObjectCache

public class UnboundedEJBObjectCache
extends BaseCache
implements EJBObjectCache

An EJB(Local)Object cache that does not impose any limit on the number of entries

Author:
Mahesh Kannan

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.ejb.containers.util.cache.BaseCache
BaseCache.CacheItem
 
Field Summary
 
Fields inherited from class com.sun.ejb.containers.util.cache.BaseCache
_logger, _rb, addCount, addCountLk, bucketLocks, buckets, entryCount, entryCountLk, hitCount, hitCountLk, listeners, maxBuckets, missCount, missCountLk, overflowCount, overflowCountLk, refreshCount, refreshCountLk, refreshFlags, removalCount, removalCountLk, threshold
 
Constructor Summary
UnboundedEJBObjectCache(String name)
          default constructor
UnboundedEJBObjectCache(String name, long timeout)
          constructor with specified timeout
 
Method Summary
 Object get(Object key, boolean incrementRefCount)
           
 Map getStats()
          get the stats snapshot
 void init(int maxEntries, int numberOfVictimsToSelect, long timeout, float loadFactor, Properties props)
           
 Object put(Object key, Object value, boolean linkWithLru)
           
 Object remove(Object key, boolean decrementRefCount)
           
 void setEJBObjectCacheListener(EJBObjectCacheListener listener)
           
protected  void trimItem(BaseCache.CacheItem item)
          trim the item from the cache and notify listeners
 
Methods inherited from class com.sun.ejb.containers.util.cache.BaseCache
_put, _remove, _removeItem, add, add, addCacheListener, clear, clearStats, contains, createItem, decrementEntryCount, destroy, elements, eq, get, get, getAll, getEntryCount, getIndex, getIndex, getStatByName, handleOverflow, hash, incrementAddCount, incrementEntryCount, incrementHitCount, incrementMissCount, incrementOverflowCount, incrementRefreshCount, incrementRemovalCount, init, init, isEmpty, isThresholdReached, itemAccessed, itemAdded, itemRefreshed, itemRemoved, keys, loadValue, notifyRefresh, put, put, remove, remove, remove, removeAll, trimExpiredEntries, values, waitRefresh
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.appserv.util.cache.Cache
add, add, addCacheListener, clear, clearStats, contains, destroy, elements, get, getAll, getEntryCount, getIndex, getStatByName, init, init, isEmpty, keys, notifyRefresh, put, put, remove, remove, removeAll, trimExpiredEntries, values, waitRefresh
 

Constructor Detail

UnboundedEJBObjectCache

public UnboundedEJBObjectCache(String name)
default constructor


UnboundedEJBObjectCache

public UnboundedEJBObjectCache(String name,
                               long timeout)
constructor with specified timeout

Method Detail

init

public void init(int maxEntries,
                 int numberOfVictimsToSelect,
                 long timeout,
                 float loadFactor,
                 Properties props)
Specified by:
init in interface EJBObjectCache

get

public Object get(Object key,
                  boolean incrementRefCount)
Specified by:
get in interface EJBObjectCache

put

public Object put(Object key,
                  Object value,
                  boolean linkWithLru)
Specified by:
put in interface EJBObjectCache

remove

public Object remove(Object key,
                     boolean decrementRefCount)
Specified by:
remove in interface EJBObjectCache

setEJBObjectCacheListener

public void setEJBObjectCacheListener(EJBObjectCacheListener listener)
Specified by:
setEJBObjectCacheListener in interface EJBObjectCache

trimItem

protected void trimItem(BaseCache.CacheItem item)
Description copied from class: BaseCache
trim the item from the cache and notify listeners

Overrides:
trimItem in class BaseCache
Parameters:
item - to be trimmed

getStats

public Map getStats()
Description copied from class: BaseCache
get the stats snapshot

Specified by:
getStats in interface Cache
Overrides:
getStats in class BaseCache
Returns:
a Map of stats See also: Constant.java for the keys


Copyright © 2012 GlassFish Community. All Rights Reserved.