mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
完善监控
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@922 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package com.alibaba.druid.util;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class LRUCache<K, V> extends LinkedHashMap<K, V> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected int maxElements;
|
||||
|
||||
public LRUCache(int maxSize){
|
||||
super(maxSize);
|
||||
this.maxElements = maxSize;
|
||||
}
|
||||
|
||||
protected boolean removeEldestEntry(Entry<K, V> eldest) {
|
||||
return (size() > this.maxElements);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user