com.opensymphony.oscache.base.algorithm
Class UnlimitedCache
java.lang.Object
java.util.AbstractMap
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
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
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 |
UnlimitedCache
public UnlimitedCache()
- Creates an unlimited cache by calling the super class's constructor
with an
UNLIMITED
maximum number of entries.
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.