Memory sensitive cache.
This cache implementation proxies to a cache that was passed to it's constructor.
When objects are added to the cache, the object wrapped in a SoftReference,
and then the Reference is added to the delegate cache.
Once a SoftCache is created for a cache, the SoftCache should always be used to
access this cache. Using the original cache directly is not recommended.
Note that there are no guarantees as to how long objects you put in cache will remain
there. This is entirely at the digression of the garbage collector, which tends to
be hasty about freeing up memory.
author: Jeff Drost version: $Revision: 1.5 $ |