mirror of https://github.com/apache/activemq.git
Allow LRUCache subclasses to trap eviction events
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1227183 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
78761cb348
commit
d95658f4b4
|
@ -80,6 +80,14 @@ public class LRUCache<K, V> extends LinkedHashMap<K, V> {
|
|||
}
|
||||
|
||||
protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
|
||||
return size() > maxCacheSize;
|
||||
if( size() > maxCacheSize ) {
|
||||
onCacheEviction(eldest);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void onCacheEviction(Map.Entry<K,V> eldest) {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue