Interface | Description |
---|---|
Cache<K,V> |
Provides a cache which can be used to store and access values.
|
ValueComputer<K,V> |
Computes a value if it is not found in a cache
Can be supplied to
CacheManager.createCache(String, ValueComputer, ValueVerifier) when creating a cache
to compute values which are not found in the cache. |
ValueVerifier<V> |
Checks if a cached value is still valid
Can be supplied to
CacheManager.createCache(String, ValueComputer, ValueVerifier) when creating a cache
to verify values before returning them to the caller. |
Class | Description |
---|---|
CacheEntry<K,V> |
Represents an entry of a Cache
Such entries are created and managed by the cache implementation.
|
CacheEvictionTimer |
Invoked regularly to remove outdated entries from the system caches.
|
CacheManager |
Provides access to all managed caches
Is responsible for creating new caches using
CacheManager.createCache(String) . |
InlineCache<E> |
Caches a single value to prevent frequent re-computation.
|
All caches are created using the CacheManager
Using the Cache
instead of simple maps provides various benefits. One is, that
a cache as a limited size and will start to drop entries once it is full instead of using an uncontrolled
large part of the heap. Additionally all caches are evicted regularly so that unused entries are removed to
again free central resources.
Also, all classes provide details of the current state of a cache, as well as the state of each entry which permits to monitor and understand the system state.
Copyright © 2018. All rights reserved.