K - 键类型V - 值类型public class TimedCache<K,V> extends ReentrantCache<K,V>
lockcacheMap, 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, get, prune, put, remove, toStringcacheObjIter, capacity, get, getHitCount, getMissCount, getWithoutLock, isEmpty, isFull, isPruneExpiredActive, iterator, keySet, onRemove, put, putWithoutLock, removeWithoutLock, setListener, size, timeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic TimedCache(long timeout)
timeout - 超时(过期)时长,单位毫秒protected int pruneCache()
pruneCache in class AbstractCache<K,V>public void schedulePrune(long delay)
delay - 间隔时长,单位毫秒public void cancelPruneSchedule()
Copyright © 2025. All rights reserved.