Package com.github.benmanes.caffeine.cache
This package contains caching utilities.
The core interface used to represent caches is Cache
.
A cache may be specialized as either a LoadingCache
or AsyncLoadingCache
.
In-memory caches can be configured and created using
Caffeine
. The cache entries may be loaded by
CacheLoader
, weighed by
Weigher
, and on removal forwarded to
RemovalListener
. Statistics about cache performance
are exposed using CacheStats
.
-
Interface Summary Interface Description AccessOrderDeque.AccessOrder<T extends AccessOrderDeque.AccessOrder<T>> An element that is linked on theDeque
.AsyncCacheLoader<K,V> Computes or retrieves values asynchronously, based on a key, for use in populating aAsyncLoadingCache
.AsyncLoadingCache<K,V> A semi-persistent mapping from keys to values.Buffer<E> A multiple-producer / single-consumer buffer that rejects new elements if it is full or fails spuriously due to contention.Cache<K,V> A semi-persistent mapping from keys to values.CacheLoader<K,V> Computes or retrieves values, based on a key, for use in populating aLoadingCache
orAsyncLoadingCache
.CacheWriter<K,V> Communicates the write or deletion of a value, based on a key, to an external resource.LinkedDeque<E> A linked list extension of theDeque
interface where the link pointers are tightly integrated with the element.LinkedDeque.PeekingIterator<E> LoadingCache<K,V> A semi-persistent mapping from keys to values.LocalCache<K,V> An in-memory cache providing thread safety and atomicity guarantees.LocalLoadingCache<C extends LocalCache<K,V>,K,V> This class provides a skeletal implementation of theLoadingCache
interface to minimize the effort required to implement aLocalCache
.LocalManualCache<C extends LocalCache<K,V>,K,V> This class provides a skeletal implementation of theCache
interface to minimize the effort required to implement aLocalCache
.Node<K,V> An entry in the cache containing the key, value, weight, access, and write metadata.Policy<K,V> An access point for inspecting and performing low-level operations based on the cache's runtime characteristics.Policy.Eviction<K,V> The low-level operations for a cache with a size-based eviction policy.Policy.Expiration<K,V> The low-level operations for a cache with a expiration policy.References.InternalReference<E> A weak or soft reference that includes the entry's key reference.RemovalListener<K,V> An object that can receive a notification when an entry is removed from a cache.Ticker A time source that returns a time value representing the number of nanoseconds elapsed since some fixed but arbitrary point in time.Weigher<K,V> Calculates the weights of cache entries.WriteOrderDeque.WriteOrder<T extends WriteOrderDeque.WriteOrder<T>> An element that is linked on theDeque
. -
Enum Summary Enum Description Caffeine.Strength DisabledBuffer DisabledTicker DisabledWriter NodeFactory WARNING: GENERATED CODE A factory for cache nodes optimized for a particular configuration.RemovalCause The reason why a cached entry was removed.SingletonWeigher SystemTicker