jodd.cache
Class TimedCache<K,V>
java.lang.Object
jodd.cache.AbstractCacheMap<K,V>
jodd.cache.TimedCache<K,V>
- All Implemented Interfaces:
- Cache<K,V>
public class TimedCache<K,V>
- extends AbstractCacheMap<K,V>
Timed cache. Not limited by size, objects are removed only when they are expired.
Prune is not invoked explicitly by standard Cache methods, however,
it is possible to schedule prunes on fined-rate delays.
|
Field Summary |
protected java.util.Timer |
pruneTimer
|
| Methods inherited from class jodd.cache.AbstractCacheMap |
clear, get, getCacheSize, getCacheTimeout, isEmpty, isFull, isPruneExpiredActive, iterator, prune, put, put, remove, size |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pruneTimer
protected java.util.Timer pruneTimer
TimedCache
public TimedCache(long timeout)
pruneCache
protected int pruneCache()
- Prunes expired elements from the cache. Returns the number of removed objects.
- Specified by:
pruneCache in class AbstractCacheMap<K,V>
schedulePrune
public void schedulePrune(long delay)
- Schedules prune.
cancelPruneSchedule
public void cancelPruneSchedule()
- Cancels prune schedules.
Copyright © 2003-2012 Jodd Team