java.lang.Object
org.hibernate.util.SimpleMRUCache
- All Implemented Interfaces:
- java.io.Serializable
- public class SimpleMRUCache
- extends java.lang.Object
- implements java.io.Serializable
Cache following a "Most Recently Used" (MRU) 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 bounded MRU Map to limit the in-memory size of
the cache. Thus the size of this cache never grows beyond the stated size.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_STRONG_REF_COUNT
public static final int DEFAULT_STRONG_REF_COUNT
- See Also:
- Constant Field Values
strongReferenceCount
private final int strongReferenceCount
cache
private transient org.apache.commons.collections.LRUMap cache
SimpleMRUCache
public SimpleMRUCache()
SimpleMRUCache
public SimpleMRUCache(int strongReferenceCount)
get
public java.lang.Object get(java.lang.Object key)
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
size
public int size()
init
private void init()
readObject
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
clear
public void clear()