org.ajax4jsf.cache
Class LRUMapCache

java.lang.Object
  extended by java.util.AbstractMap
      extended by org.apache.commons.collections.map.AbstractHashedMap
          extended by org.apache.commons.collections.map.AbstractLinkedMap
              extended by org.apache.commons.collections.map.LRUMap
                  extended by org.ajax4jsf.cache.LRUMapCache
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map, org.ajax4jsf.cache.Cache, org.apache.commons.collections.BoundedMap, org.apache.commons.collections.IterableMap, org.apache.commons.collections.OrderedMap

public class LRUMapCache
extends org.apache.commons.collections.map.LRUMap
implements org.ajax4jsf.cache.Cache

Author:
Nick - mailto:nbelaevski@exadel.com created 01.05.2007
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.collections.map.AbstractLinkedMap
org.apache.commons.collections.map.AbstractLinkedMap.EntrySetIterator, org.apache.commons.collections.map.AbstractLinkedMap.KeySetIterator, org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry, org.apache.commons.collections.map.AbstractLinkedMap.LinkIterator, org.apache.commons.collections.map.AbstractLinkedMap.LinkMapIterator, org.apache.commons.collections.map.AbstractLinkedMap.ValuesIterator
 
Nested classes/interfaces inherited from class org.apache.commons.collections.map.AbstractHashedMap
org.apache.commons.collections.map.AbstractHashedMap.EntrySet, org.apache.commons.collections.map.AbstractHashedMap.HashEntry, org.apache.commons.collections.map.AbstractHashedMap.HashIterator, org.apache.commons.collections.map.AbstractHashedMap.HashMapIterator, org.apache.commons.collections.map.AbstractHashedMap.KeySet, org.apache.commons.collections.map.AbstractHashedMap.Values
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.apache.commons.collections.map.LRUMap
DEFAULT_MAX_SIZE
 
Fields inherited from class org.apache.commons.collections.map.AbstractLinkedMap
header
 
Fields inherited from class org.apache.commons.collections.map.AbstractHashedMap
data, DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD, entrySet, GETKEY_INVALID, GETVALUE_INVALID, keySet, loadFactor, MAXIMUM_CAPACITY, modCount, NO_NEXT_ENTRY, NO_PREVIOUS_ENTRY, NULL, REMOVE_INVALID, SETVALUE_INVALID, size, threshold, values
 
Constructor Summary
LRUMapCache(org.ajax4jsf.cache.CacheLoader cacheLoader)
           
LRUMapCache(org.ajax4jsf.cache.CacheLoader cacheLoader, int initialSize)
           
 
Method Summary
 void addListener(org.ajax4jsf.cache.CacheListener listener)
           
 void evict()
           
 java.lang.Object get(java.lang.Object key, java.lang.Object context)
           
 org.ajax4jsf.cache.CacheEntry getCacheEntry(java.lang.Object key)
           
 void load(java.lang.Object key, java.lang.Object context)
           
 java.lang.Object peek(java.lang.Object key)
           
 void removeListener(org.ajax4jsf.cache.CacheListener listener)
           
 
Methods inherited from class org.apache.commons.collections.map.LRUMap
addMapping, clone, doReadObject, doWriteObject, get, isFull, isScanUntilRemovable, maxSize, moveToMRU, removeLRU, reuseMapping, updateEntry
 
Methods inherited from class org.apache.commons.collections.map.AbstractLinkedMap
addEntry, clear, containsValue, createEntry, createEntrySetIterator, createKeySetIterator, createValuesIterator, entryAfter, entryBefore, firstKey, getEntry, init, lastKey, mapIterator, nextKey, orderedMapIterator, previousKey, removeEntry
 
Methods inherited from class org.apache.commons.collections.map.AbstractHashedMap
calculateNewCapacity, calculateThreshold, checkCapacity, containsKey, convertKey, destroyEntry, ensureCapacity, entryHashCode, entryKey, entryNext, entrySet, entryValue, equals, getEntry, hash, hashCode, hashIndex, isEmpty, isEqualKey, isEqualValue, keySet, put, putAll, remove, removeMapping, reuseEntry, size, toString, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ajax4jsf.cache.Cache
clear, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

LRUMapCache

public LRUMapCache(org.ajax4jsf.cache.CacheLoader cacheLoader,
                   int initialSize)

LRUMapCache

public LRUMapCache(org.ajax4jsf.cache.CacheLoader cacheLoader)
Method Detail

addListener

public void addListener(org.ajax4jsf.cache.CacheListener listener)
Specified by:
addListener in interface org.ajax4jsf.cache.Cache

evict

public void evict()
Specified by:
evict in interface org.ajax4jsf.cache.Cache

get

public java.lang.Object get(java.lang.Object key,
                            java.lang.Object context)
                     throws org.ajax4jsf.cache.CacheException
Specified by:
get in interface org.ajax4jsf.cache.Cache
Throws:
org.ajax4jsf.cache.CacheException

getCacheEntry

public org.ajax4jsf.cache.CacheEntry getCacheEntry(java.lang.Object key)
Specified by:
getCacheEntry in interface org.ajax4jsf.cache.Cache

load

public void load(java.lang.Object key,
                 java.lang.Object context)
          throws org.ajax4jsf.cache.CacheException
Specified by:
load in interface org.ajax4jsf.cache.Cache
Throws:
org.ajax4jsf.cache.CacheException

peek

public java.lang.Object peek(java.lang.Object key)
Specified by:
peek in interface org.ajax4jsf.cache.Cache

removeListener

public void removeListener(org.ajax4jsf.cache.CacheListener listener)
Specified by:
removeListener in interface org.ajax4jsf.cache.Cache


Copyright © 2007. All Rights Reserved.