public abstract class AbstractCacheManager extends Object implements CacheManager
| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
AbstractCacheManager.AbstractCacheObject<K>
Abstract cache object.
|
DEFAULT_GUAVA_CACHE_MANAGER_NAME, DEFAULT_MAP_CACHE_MANAGER_NAME| 构造器和说明 |
|---|
AbstractCacheManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearAll()
Clear all caches.
|
<K> @NonNull CacheObject<K> |
createCache(String name,
Long expireTime,
TimeUnit timeUnit)
Create cache instance, if cache instance already created,
remove the old cache instance and create a new cache instance.
|
protected abstract <K> @NonNull AbstractCacheManager.AbstractCacheObject<K> |
doCreateCache(String name,
Long expireTime,
TimeUnit timeUnit)
Create cache instance.
|
<K> @Nullable CacheObject<K> |
getCache(String name)
Get cache instance by name,
if cache instance still not created by
createCache(java.lang.String, java.lang.Long, java.util.concurrent.TimeUnit), return null. |
protected void |
invalidate(AbstractCacheManager.AbstractCacheObject<?> cacheObject)
Invalidate cache.
|
void |
removeCache(String name)
Remove cache.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamepublic <K> @Nullable CacheObject<K> getCache(String name)
createCache(java.lang.String, java.lang.Long, java.util.concurrent.TimeUnit), return null.getCache 在接口中 CacheManagername - cache namepublic <K> @NonNull CacheObject<K> createCache(String name, Long expireTime, TimeUnit timeUnit)
createCache 在接口中 CacheManagerK - key typename - cache nameexpireTime - expire timetimeUnit - time unitpublic void removeCache(String name)
removeCache 在接口中 CacheManagername - cache nameCacheObject.isInvalid(),
CacheObject.clear()public void clearAll()
clearAll 在接口中 CacheManagerprotected abstract <K> @NonNull AbstractCacheManager.AbstractCacheObject<K> doCreateCache(String name, Long expireTime, TimeUnit timeUnit)
name - cache nameexpireTime - expire timetimeUnit - time unitprotected void invalidate(AbstractCacheManager.AbstractCacheObject<?> cacheObject)
cacheObject - cache objectCopyright © 2024. All rights reserved.