public class ConcurrentCache<K,V> extends Object
CLEANUP_INTERVAL invocations of the protected method cleanUp.
cleanUp method is called every time by put The maximum size is maintained
approximately. Cleanup is not done if size is less than capacity + CLEANUP_INTERVAL / 2.| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<K,V> |
cache |
| Constructor and Description |
|---|
ConcurrentCache(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanUp() |
void |
clear() |
V |
get(Object key) |
protected boolean |
onEntryRemoval(K key) |
V |
put(K key,
V value) |
protected final ConcurrentHashMap<K,V> cache
public void clear()
protected boolean onEntryRemoval(K key)
key - the key of the node to test for removal and do finalization onprotected void cleanUp()
Copyright © 2015-2018 Eclipse Foundation. All Rights Reserved.