我正在使用以下引用实现自定义驱逐策略,但问题是我需要知道什么是支持缓存名称,以便我可以获取CacheLoader引用。有没有办法从ReadWriteBackingMap
获取ConfigurableCacheMap
?
https://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_customeviction.htm#COHDG168
public void requestEviction(int cMaximum){
logger.debug(String.format("EvictionPolicy.requestEviction: evicting requested for cache %s", getCache()));
ConfigurableCacheMap cache = getCache();
for(Iterator iter=cache.entrySet().iterator();iter.hasNext();){
ConfigurableCacheMap.Entry entry=(ConfigurableCacheMap.Entry) iter.next();
// If the contents of the entry (for example the key/value) need
// to be examined, invoke convertEntry(entry) in case
// the entry must be deserialized
Map.Entry convertedEntry = convertEntry(entry);
//
if (entry instanceof LocalCache.Entry)
{
LocalCache.Entry l_entry = (LocalCache.Entry) entry;
// Can I get the backing map here?????????
}
}
}