Class ConcurrentCache<K,V>
java.lang.Object
org.apache.tomcat.util.collections.ConcurrentCache<K,V>
- Type Parameters:
K- the key typeV- the value type
A thread-safe cache that uses an eden space backed by a
ConcurrentHashMap
and a long-term space backed by a WeakHashMap. When the eden space exceeds
the configured size, its contents are promoted to the long-term space.-
Constructor Summary
ConstructorsConstructorDescriptionConcurrentCache(int size) Creates a new cache with the specified eden space size. -
Method Summary
-
Constructor Details
-
ConcurrentCache
public ConcurrentCache(int size) Creates a new cache with the specified eden space size.- Parameters:
size- the maximum size of the eden space before promotion to long-term storage
-
-
Method Details
-
get
-
put
-