Class SoftReferenceMemoryCache<K,V> 
java.lang.Object
org.apache.commons.jcs3.engine.memory.AbstractMemoryCache<K,V>
 
org.apache.commons.jcs3.engine.memory.soft.SoftReferenceMemoryCache<K,V> 
- All Implemented Interfaces:
- IMemoryCache<K,- V> 
A JCS IMemoryCache that has 
SoftReference to all its values.
 This cache does not respect ICompositeCacheAttributes.getMaxObjects()
 as overflowing is handled by Java GC.
 The cache also has strong references to a maximum number of objects given by the maxObjects parameter
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionChildren must implement this method.intfreeElements(int numberToFree) This can't be implemented.Get an Array of the keys for all elements in the memory cacheintgetSize()Returns the current cache size.Returns the historical and statistical data for a region's memory cache.voidinitialize(CompositeCache<K, V> hub) For post reflection creation initializationprotected voidUpdate control structures after get (guarded by the lock)protected voidRemoves all cached items from the cache control structures.protected voidRemove element from control structure (guarded by the lock)voidupdate(ICacheElement<K, V> ce) Puts an item to the cache.Methods inherited from class org.apache.commons.jcs3.engine.memory.AbstractMemoryCachedispose, dumpMap, get, getCacheAttributes, getCacheName, getCompositeCache, getMultiple, getQuiet, remove, removeAll, removeByGroup, removeByHierarchy, setCacheAttributes, waterfal
- 
Constructor Details- 
SoftReferenceMemoryCachepublic SoftReferenceMemoryCache()
 
- 
- 
Method Details- 
initializeFor post reflection creation initialization- Specified by:
- initializein interface- IMemoryCache<K,- V> 
- Overrides:
- initializein class- AbstractMemoryCache<K,- V> 
- Parameters:
- hub-
 
- 
createMapDescription copied from class:AbstractMemoryCacheChildren must implement this method. A FIFO implementation may use a tree map. An LRU might use a hashtable. The map returned should be threadsafe.- Specified by:
- createMapin class- AbstractMemoryCache<K,- V> 
- Returns:
- a threadsafe Map
- See Also:
 
- 
getKeySetDescription copied from class:AbstractMemoryCacheGet an Array of the keys for all elements in the memory cache- Specified by:
- getKeySetin interface- IMemoryCache<K,- V> 
- Overrides:
- getKeySetin class- AbstractMemoryCache<K,- V> 
- Returns:
- An Object[]
- See Also:
 
- 
getSizeReturns the current cache size.- Specified by:
- getSizein interface- IMemoryCache<K,- V> 
- Overrides:
- getSizein class- AbstractMemoryCache<K,- V> 
- Returns:
- The size value
 
- 
getStatisticsDescription copied from interface:IMemoryCacheReturns the historical and statistical data for a region's memory cache.- Specified by:
- getStatisticsin interface- IMemoryCache<K,- V> 
- Overrides:
- getStatisticsin class- AbstractMemoryCache<K,- V> 
- Returns:
- statistics about the cache
 
- 
lockedGetElementUpdate control structures after get (guarded by the lock)- Specified by:
- lockedGetElementin class- AbstractMemoryCache<K,- V> 
- Parameters:
- me- the memory element descriptor
 
- 
lockedRemoveElementRemove element from control structure (guarded by the lock)- Specified by:
- lockedRemoveElementin class- AbstractMemoryCache<K,- V> 
- Parameters:
- me- the memory element descriptor
 
- 
lockedRemoveAllRemoves all cached items from the cache control structures. (guarded by the lock)- Specified by:
- lockedRemoveAllin class- AbstractMemoryCache<K,- V> 
 
- 
updatePuts an item to the cache.- Specified by:
- updatein interface- IMemoryCache<K,- V> 
- Specified by:
- updatein class- AbstractMemoryCache<K,- V> 
- Parameters:
- ce- Description of the Parameter
- Throws:
- IOException- Description of the Exception
 
- 
freeElementsThis can't be implemented.- Parameters:
- numberToFree-
- Returns:
- 0
- Throws:
- IOException
 
 
-