Package com.github.benmanes.caffeine.cache
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.
- Author:
- ben.manes@gmail.com (Ben Manes)
-
ClassDescriptionAsyncCache<K,
V> A semi-persistent mapping from keys to values.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.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 aLoadingCacheorAsyncLoadingCache.CacheWriter<K,V> Deprecated.Scheduled for removal in version 3.0.0.Caffeine<K,V> A builder ofCache,LoadingCache,AsyncCache, andAsyncLoadingCacheinstances having a combination of the following features: automatic loading of entries into the cache, optionally asynchronously size-based eviction when a maximum is exceeded based on frequency and recency time-based expiration of entries, measured since last access or last write asynchronously refresh when the first stale request for an entry occurs keys automatically wrapped in weak references values automatically wrapped in weak or soft references writes propagated to an external resource notification of evicted (or otherwise removed) entries accumulation of cache access statisticsA specification of aCaffeinebuilder configuration.Expiry<K,V> Calculates when cache entries expire.LoadingCache<K,V> A semi-persistent mapping from keys to values.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 fixed expiration policy.Policy.VarExpiration<K,V> The low-level operations for a cache with a variable expiration policy.The reason why a cached entry was removed.RemovalListener<K,V> An object that can receive a notification when an entry is removed from a cache.A scheduler that submits a task to an executor after a given delay.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.