E - 可持久化对象public abstract class PersistentCache<E extends Persistent> extends cn.weforward.common.util.LruCache<String,E>
| 限定符和类型 | 类和说明 |
|---|---|
protected class |
PersistentCache.PersistNode |
cn.weforward.common.util.LruCache.CacheNode<K,V>, cn.weforward.common.util.LruCache.CopyOn, cn.weforward.common.util.LruCache.Direct, cn.weforward.common.util.LruCache.DirtyData<V>, cn.weforward.common.util.LruCache.Loader<K,V>, cn.weforward.common.util.LruCache.Updater<K,V>| 限定符和类型 | 字段和说明 |
|---|---|
static String |
VERSION_UPDATING
标示正处理更新中,这种状态下的版本号可认为是相同的
|
_clock, _dirty, _emptyDirtyData, _pending, _unassigned, m_GetCount, m_LoadConcurrent, m_LoadCount, m_MaxLoadConcurrent, m_Name, m_NullTimeout, m_Options, m_PendingTimeout, m_Timeout, m_UpdatedChain, OPTION_REACHABLE, POLICY_GC_FORWARD| 构造器和说明 |
|---|
PersistentCache(String name) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
afterNodeRemoval(cn.weforward.common.util.LruHashMap.Node<String,E> p) |
protected void |
afterNodeUpdate(cn.weforward.common.util.LruHashMap.Node<String,E> p) |
protected PersistentCache.PersistNode |
flush(E object) |
protected PersistentCache.PersistNode |
getNode(int hash,
Object key) |
int |
getNullTimeout() |
String |
getVersion(String ordinal) |
boolean |
isDirty(String ordinal) |
protected abstract String |
newer(E object)
标记(可能是)新的持久化对象(用于对象未刷写前能进行查询)
|
protected PersistentCache.PersistNode |
newNode(int hash,
String key,
E value,
cn.weforward.common.util.LruHashMap.Node<String,E> next) |
protected PersistentCache.PersistNode |
openNode(int hash,
String key) |
protected abstract String |
persist(E object,
PersistentCache.PersistNode node)
把对象持久化
|
String |
updateVersion(String ordinal,
E value,
String version)
更新若缓存项的版本号
|
protected PersistentCache.PersistNode |
updating(E object)
把状态变化对象置入缓存
|
afterNodeAccess, afterNodeLoad, getAndLoad, getDirtyData, getHintLoad, getHintLoad, getHitRate, getLruHead, getMaxLoadConcurrent, getName, getPendingTimeout, getTimeout, idleTrim, markUpdated, onGcCleanup, setMaxLoadConcurrent, setName, setNullTimeout, setPendingTimeout, setReachable, setTimeout, toString, trim, trimClean, update, updatedLockafterNodeInsertion, clear, fixLru, get, getMaxCapacity, getOrDefault, hash, initLru, isLruEmpty, iterator, lru, lruLock, pinch, put, putIfAbsent, putLru, rebuild, remove, remove, removeAll, removeLru, resize, setMaxCapacity, size, tableLock, tableSizeForclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic PersistentCache(String name)
public int getNullTimeout()
getNullTimeout 在类中 cn.weforward.common.util.LruCache<String,E extends Persistent>protected abstract String persist(E object, PersistentCache.PersistNode node)
object - 要持久化的对象node - 对应的缓存节点protected abstract String newer(E object)
object - (可能是)新的持久化对象protected PersistentCache.PersistNode openNode(int hash, String key)
openNode 在类中 cn.weforward.common.util.LruCache<String,E extends Persistent>protected PersistentCache.PersistNode getNode(int hash, Object key)
getNode 在类中 cn.weforward.common.util.LruCache<String,E extends Persistent>protected PersistentCache.PersistNode newNode(int hash, String key, E value, cn.weforward.common.util.LruHashMap.Node<String,E> next)
newNode 在类中 cn.weforward.common.util.LruCache<String,E extends Persistent>public boolean isDirty(String ordinal)
public String updateVersion(String ordinal, E value, String version)
ordinal - 缓存项标识value - 对象version - 要更新到的版本号protected PersistentCache.PersistNode updating(E object)
object - 状态变化的对象protected void afterNodeUpdate(cn.weforward.common.util.LruHashMap.Node<String,E> p)
afterNodeUpdate 在类中 cn.weforward.common.util.LruCache<String,E extends Persistent>protected void afterNodeRemoval(cn.weforward.common.util.LruHashMap.Node<String,E> p)
afterNodeRemoval 在类中 cn.weforward.common.util.LruCache<String,E extends Persistent>protected PersistentCache.PersistNode flush(E object)
Copyright © 2021. All rights reserved.