/** * Purge least recently used object from the cache * * @return recyclable CacheEntry */ protected CacheEntry purgeEntry() throws CacheEvictionException { CacheEntry entry = _first; // Notify policy listeners first. if any of them throw an // eviction exception, then the internal data structure // remains untouched. CachePolicyListener listener; for (int i=0; i<listeners.size(); i++) { listener = (CachePolicyListener)listeners.elementAt(i); listener.cacheObjectEvicted(entry.getValue()); } removeEntry(entry); _hash.remove(entry.getKey()); entry.setValue(null); return entry; }
/** * Purge least recently used object from the cache * * @return recyclable CacheEntry */ protected CacheEntry purgeEntry() throws CacheEvictionException { CacheEntry entry = first; // Notify policy listeners first. if any of them throw an // eviction exception, then the internal data structure // remains untouched. CachePolicyListener listener; for ( int i = 0; i < listeners.size(); i++ ) { listener = listeners.get( i ); listener.cacheObjectEvicted( entry.getValue() ); } removeEntry( entry ); map.remove( entry.getKey() ); entry.setValue( null ); return entry; }
/** * Purge least recently used object from the cache * * @return recyclable CacheEntry */ protected CacheEntry purgeEntry() throws CacheEvictionException { CacheEntry entry = first; // Notify policy listeners first. if any of them throw an // eviction exception, then the internal data structure // remains untouched. CachePolicyListener listener; for ( int i = 0; i < listeners.size(); i++ ) { listener = listeners.get( i ); listener.cacheObjectEvicted( entry.getValue() ); } removeEntry( entry ); map.remove( entry.getKey() ); entry.setValue( null ); return entry; }