Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » util » [javadoc | source]
org.hibernate.util
public class: SoftLimitMRUCache [javadoc | source]
java.lang.Object
   org.hibernate.util.SoftLimitMRUCache

All Implemented Interfaces:
    Serializable

Cache following a "Most Recently Used" (MRY) algorithm for maintaining a bounded in-memory size; the "Least Recently Used" (LRU) entry is the first available for removal from the cache.

This implementation uses a "soft limit" to the in-memory size of the cache, meaning that all cache entries are kept within a completely java.lang.ref.SoftReference -based map with the most recently utilized entries additionally kept in a hard-reference manner to prevent those cache entries soft references from becoming enqueued by the garbage collector. Thus the actual size of this cache impl can actually grow beyond the stated max size bound as long as GC is not actively seeking soft references for enqueuement.

Field Summary
public static final  int DEFAULT_STRONG_REF_COUNT     
Constructor:
 public SoftLimitMRUCache() 
 public SoftLimitMRUCache(int strongRefCount) 
Method from org.hibernate.util.SoftLimitMRUCache Summary:
clear,   get,   put,   size,   softSize
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.util.SoftLimitMRUCache Detail:
 public synchronized  void clear() 
 public synchronized Object get(Object key) 
 public synchronized Object put(Object key,
    Object value) 
 public synchronized int size() 
 public synchronized int softSize()