Top Description Fields Constructors Methods
org.hibernate.util

public Class SimpleMRUCache

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
org.apache.commons.collections.map.LRUMap, java.io.Serializable, .IOException

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.

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private transient LRUMap
public static final int
private final int

Constructor Summary

AccessConstructor and Description
public
public
SimpleMRUCache(int strongReferenceCount)

Method Summary

Modifier and TypeMethod and Description
public synchronized void
public synchronized Object
get(Object key)

private void
init()

public synchronized Object
put(Object key, Object value)

private void
public synchronized int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
private transient LRUMap cache
DEFAULT_STRONG_REF_COUNTback to summary
public static final int DEFAULT_STRONG_REF_COUNT
strongReferenceCountback to summary
private final int strongReferenceCount

Constructor Detail

SimpleMRUCacheback to summary
public SimpleMRUCache()
SimpleMRUCacheback to summary
public SimpleMRUCache(int strongReferenceCount)

Method Detail

clearback to summary
public synchronized void clear()
getback to summary
public synchronized Object get(Object key)
initback to summary
private void init()
putback to summary
public synchronized Object put(Object key, Object value)
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
sizeback to summary
public synchronized int size()