K
- 键类型V
- 值类型public class TimedCache<K,V> extends StampedCache<K,V>
lock
cacheMap, capacity, existCustomTimeout, hitCount, keyLockMap, listener, missCount, timeout
Constructor and Description |
---|
TimedCache(long timeout)
构造
|
TimedCache(long timeout,
Map<Mutable<K>,CacheObj<K,V>> map)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
cancelPruneSchedule()
取消定时清理
|
protected int |
pruneCache()
清理过期对象
|
void |
schedulePrune(long delay)
定时清理
|
cacheObjIterator, clear, containsKey, get, prune, put, remove
cacheObjIter, capacity, get, get, getHitCount, getMissCount, getWithoutLock, isEmpty, isFull, isPruneExpiredActive, iterator, keySet, onRemove, put, putWithoutLock, removeWithoutLock, setListener, size, timeout, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public TimedCache(long timeout)
timeout
- 超时(过期)时长,单位毫秒protected int pruneCache()
pruneCache
in class AbstractCache<K,V>
public void schedulePrune(long delay)
delay
- 间隔时长,单位毫秒public void cancelPruneSchedule()
Copyright © 2024. All rights reserved.