K
- 键类型V
- 值类型public class TimedCache<K,V> extends AbstractCache<K,V>
cacheMap, capacity, existCustomTimeout, hitCount, keyLockMap, listener, missCount, timeout
Constructor and Description |
---|
TimedCache(long timeout)
构造
|
TimedCache(long timeout,
Map<K,CacheObj<K,V>> map)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
cancelPruneSchedule()
取消定时清理
|
protected int |
pruneCache()
清理过期对象
|
void |
schedulePrune(long delay)
定时清理
|
cacheObjIterator, capacity, clear, containsKey, get, get, getHitCount, getMissCount, isEmpty, isFull, isPruneExpiredActive, iterator, keySet, onRemove, prune, put, put, remove, 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 © 2021. All rights reserved.