Class ConcurrentMapCache

java.lang.Object
org.springframework.cache.support.AbstractValueAdaptingCache
org.springframework.cache.concurrent.ConcurrentMapCache
All Implemented Interfaces:
Cache

public class ConcurrentMapCache extends AbstractValueAdaptingCache
Simple Cache implementation based on the core JDK java.util.concurrent package.

Useful for testing or simple caching scenarios, typically in combination with SimpleCacheManager or dynamically through ConcurrentMapCacheManager.

Supports the retrieve(Object) and retrieve(Object, Supplier) operations in a best-effort fashion, relying on default CompletableFuture execution (typically within the JVM's ForkJoinPool.commonPool()).

Note: As ConcurrentHashMap (the default implementation used) does not allow for null values to be stored, this class will replace them with a predefined internal object. This behavior can be changed through the ConcurrentMapCache(String, ConcurrentMap, boolean) constructor.

Since:
3.1
Author:
Costin Leau, Juergen Hoeller, Stephane Nicoll
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.cache.