function to create new objects if not found in cache
function to be called once the value is not used any more
function generating additional keys the value should be reachable by
Acquires a value associated with key.
Acquires a value associated with key.
If the value was acquired by another thread and is present in the cache, it will be returned from cache.
If the value was not found in cache, a new value will be created by invoking create
function
and will be saved to the cache and associated with key
and other keys returned by invoking the
keys
function on the value.
Returns true if cache contains given key.
Removes and destroys unused entries from the cache immediately.
Removes and destroys unused entries from the cache immediately. Entries with reference count > 0 are not removed.
Releases previously acquired value.
Releases previously acquired value. Once the value is released by all threads and
the releaseDelayMillis
timeout passes, the value is destroyed by calling destroy
function and
removed from the cache.
Shuts down the background deferred release
scheduler and forces all pending release tasks to be executed
A lockless cache that caches values for multiple users and destroys them once all users release them. One value can be associated with many keys. Useful for sharing a costly resource.