Package org.apache.commons.ognl.internal
Class ConcurrentHashMapCache<K,V>
- java.lang.Object
-
- org.apache.commons.ognl.internal.ConcurrentHashMapCache<K,V>
-
- All Implemented Interfaces:
Cache<K,V>
- Direct Known Subclasses:
ConcurrentHashMapClassCache
public class ConcurrentHashMapCache<K,V> extends java.lang.Object implements Cache<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentHashMap<K,V>
cache
private CacheEntryFactory<K,V>
cacheEntryFactory
-
Constructor Summary
Constructors Constructor Description ConcurrentHashMapCache()
ConcurrentHashMapCache(CacheEntryFactory<K,V> cacheEntryFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
contains(K key)
V
get(K key)
int
getSize()
V
put(K key, V value)
protected boolean
shouldCreate(CacheEntryFactory<K,V> cacheEntryFactory, V v)
-
-
-
Field Detail
-
cacheEntryFactory
private CacheEntryFactory<K,V> cacheEntryFactory
-
-
Constructor Detail
-
ConcurrentHashMapCache
public ConcurrentHashMapCache()
-
ConcurrentHashMapCache
public ConcurrentHashMapCache(CacheEntryFactory<K,V> cacheEntryFactory)
-
-
Method Detail
-
get
public V get(K key) throws CacheException
- Specified by:
get
in interfaceCache<K,V>
- Throws:
CacheException
-
shouldCreate
protected boolean shouldCreate(CacheEntryFactory<K,V> cacheEntryFactory, V v) throws CacheException
- Throws:
CacheException
-
contains
public boolean contains(K key)
-
-