Class ConcurrentCache<K,V>
- java.lang.Object
-
- org.apache.tomcat.util.collections.ConcurrentCache<K,V>
-
- Type Parameters:
K- the key typeV- the value type
public final class ConcurrentCache<K,V> extends java.lang.ObjectA thread-safe cache that uses an eden space backed by aConcurrentHashMapand a long-term space backed by aWeakHashMap. When the eden space exceeds the configured size, its contents are promoted to the long-term space.
-
-
Constructor Summary
Constructors Constructor Description ConcurrentCache(int size)Creates a new cache with the specified eden space size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vget(K k)Retrieves a value from the cache.voidput(K k, V v)Stores a value in the cache.
-