ehcache

net.sf.ehcache.store
Class MemoryStore.SpoolingLRUMap

java.lang.Object
  extended bynet.sf.ehcache.store.MemoryStore.SpoolingLRUMap
All Implemented Interfaces:
java.io.Externalizable, java.util.Map, java.io.Serializable
Enclosing class:
MemoryStore

public class MemoryStore.SpoolingLRUMap
extends java.lang.Object
implements java.io.Externalizable, java.util.Map

A Map implementation that delegates to Apache Commons LRUMap.

This is used if LinkedHashMap is not found in the classpath. LinkedHashMap is part of JDK

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
MemoryStore.SpoolingLRUMap()
          Constructor.
 
Method Summary
 void clear()
          delegate to the LRUMap
 boolean containsKey(java.lang.Object o)
          delegate to the LRUMap
 boolean containsValue(java.lang.Object o)
          delegate to the LRUMap
 java.util.Set entrySet()
          delegate to the LRUMap
 boolean equals(java.lang.Object o)
          delegate to the LRUMap
 java.lang.Object get(java.lang.Object o)
          delegate to the LRUMap
 int hashCode()
          delegate to the LRUMap
 boolean isEmpty()
          delegate to the LRUMap
 java.util.Set keySet()
          delegate to the LRUMap
protected  void processRemovedLRU(java.lang.Object key, java.lang.Object value)
          Called after the element has been removed.
 java.lang.Object put(java.lang.Object o, java.lang.Object o1)
          delegate to the LRUMap
 void putAll(java.util.Map map)
          delegate to the LRUMap
 void readExternal(java.io.ObjectInput objectInput)
          delegate to the LRUMap
 java.lang.Object remove(java.lang.Object o)
          delegate to the LRUMap
 int size()
          delegate to the LRUMap
 java.util.Collection values()
          delegate to the LRUMap
 void writeExternal(java.io.ObjectOutput objectOutput)
          delegate to the LRUMap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryStore.SpoolingLRUMap

public MemoryStore.SpoolingLRUMap()
Constructor. The maximum size is set to Cache.getMaxElementsInMemory(). If the LRUMap gets bigger than this, processRemovedLRU(java.lang.Object, java.lang.Object) is called.

Method Detail

clear

public void clear()
delegate to the LRUMap

Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object o)
delegate to the LRUMap

Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object o)
delegate to the LRUMap

Specified by:
containsValue in interface java.util.Map

entrySet

public java.util.Set entrySet()
delegate to the LRUMap

Specified by:
entrySet in interface java.util.Map

equals

public boolean equals(java.lang.Object o)
delegate to the LRUMap

Specified by:
equals in interface java.util.Map

hashCode

public int hashCode()
delegate to the LRUMap

Specified by:
hashCode in interface java.util.Map

isEmpty

public boolean isEmpty()
delegate to the LRUMap

Specified by:
isEmpty in interface java.util.Map

keySet

public java.util.Set keySet()
delegate to the LRUMap

Specified by:
keySet in interface java.util.Map

putAll

public void putAll(java.util.Map map)
delegate to the LRUMap

Specified by:
putAll in interface java.util.Map

readExternal

public void readExternal(java.io.ObjectInput objectInput)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
delegate to the LRUMap

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

remove

public java.lang.Object remove(java.lang.Object o)
delegate to the LRUMap

Specified by:
remove in interface java.util.Map

size

public int size()
delegate to the LRUMap

Specified by:
size in interface java.util.Map

values

public java.util.Collection values()
delegate to the LRUMap

Specified by:
values in interface java.util.Map

writeExternal

public void writeExternal(java.io.ObjectOutput objectOutput)
                   throws java.io.IOException
delegate to the LRUMap

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

get

public java.lang.Object get(java.lang.Object o)
delegate to the LRUMap

Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object o,
                            java.lang.Object o1)
delegate to the LRUMap

Specified by:
put in interface java.util.Map

processRemovedLRU

protected void processRemovedLRU(java.lang.Object key,
                                 java.lang.Object value)
Called after the element has been removed.

Our choices are to do nothing or spool the element to disk.

Parameters:
key -
value -

ehcache