com.opensymphony.oscache.base.algorithm
Class UnlimitedCache

java.lang.Object
  extended by java.util.AbstractMap
      extended by com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
          extended by com.opensymphony.oscache.base.algorithm.UnlimitedCache
All Implemented Interfaces:
Serializable, Cloneable, Map

public final class UnlimitedCache
extends AbstractConcurrentReadCache

A simple unlimited cache that has no upper bound to the number of cache entries it can contain.

Version:
$Revision: 427 $
Author:
Francois Beauregard, Alain Bergevin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
AbstractConcurrentReadCache.Entry, AbstractConcurrentReadCache.HashIterator, AbstractConcurrentReadCache.KeyIterator, AbstractConcurrentReadCache.ValueIterator
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
private  org.apache.commons.logging.Log log
           
private static long serialVersionUID
           
 
Fields inherited from class com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
barrierLock, count, DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_MAX_ENTRIES, entrySet, groups, keySet, lastWrite, loadFactor, maxEntries, memoryCaching, NULL, persistenceListener, table, threshold, UNLIMITED, unlimitedDiskCache, values
 
Constructor Summary
UnlimitedCache()
          Creates an unlimited cache by calling the super class's constructor with an UNLIMITED maximum number of entries.
 
Method Summary
protected  void itemPut(Object key)
          Implements itemPut with an empty implementation.
protected  void itemRemoved(Object key)
          An empty implementation.
protected  void itemRetrieved(Object key)
          Implements itemRetrieved with an empty implementation.
protected  Object removeItem()
          This method just returns null since items should never end up being removed from an unlimited cache!
 void setMaxEntries(int maxEntries)
          Overrides the setMaxEntries with an empty implementation.
 
Methods inherited from class com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
capacity, clear, clone, contains, containsKey, containsValue, elements, entrySet, findAndRemoveEntry, get, getGroup, getGroupForReading, getGroupsForReading, getMaxEntries, getPersistenceListener, getTableForReading, isEmpty, isMemoryCaching, isOverflowPersistence, isUnlimitedDiskCache, keys, keySet, loadFactor, persistClear, persistRemove, persistRemoveGroup, persistRetrieve, persistRetrieveGroup, persistStore, persistStoreGroup, put, putAll, recordModification, rehash, remove, removeForce, setMemoryCaching, setOverflowPersistence, setPersistenceListener, setUnlimitedDiskCache, size, sput, sremove, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

log

private final org.apache.commons.logging.Log log
Constructor Detail

UnlimitedCache

public UnlimitedCache()
Creates an unlimited cache by calling the super class's constructor with an UNLIMITED maximum number of entries.

Method Detail

setMaxEntries

public void setMaxEntries(int maxEntries)
Overrides the setMaxEntries with an empty implementation. This property cannot be modified and is ignored for an UnlimitedCache.

Overrides:
setMaxEntries in class AbstractConcurrentReadCache

itemRetrieved

protected void itemRetrieved(Object key)
Implements itemRetrieved with an empty implementation. The unlimited cache doesn't care that an item was retrieved.

Specified by:
itemRetrieved in class AbstractConcurrentReadCache
Parameters:
key - The cache key of the item that was retrieved.

itemPut

protected void itemPut(Object key)
Implements itemPut with an empty implementation. The unlimited cache doesn't care that an item was put in the cache.

Specified by:
itemPut in class AbstractConcurrentReadCache
Parameters:
key - The cache key of the item that was put.

removeItem

protected Object removeItem()
This method just returns null since items should never end up being removed from an unlimited cache!

Specified by:
removeItem in class AbstractConcurrentReadCache
Returns:
The key of whichever item was removed.

itemRemoved

protected void itemRemoved(Object key)
An empty implementation. The unlimited cache doesn't care that an item was removed.

Specified by:
itemRemoved in class AbstractConcurrentReadCache
Parameters:
key - The cache key of the item that was removed.


Copyright © 2011 OpenSymphony. All Rights Reserved.