类 AbstractCacheManager
java.lang.Object
cn.taketoday.cache.support.AbstractCacheManager
- 所有已实现的接口:
InitializingBean,CacheManager
- 直接已知子类:
SimpleCacheManager
Abstract base class implementing the common
CacheManager methods.
Useful for 'static' environments where the backing caches do not change.- 从以下版本开始:
- 2020-08-15 19:18
- 作者:
- Costin Leau, Juergen Hoeller, Stephane Nicoll, TODAY
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidprotected CachedecorateCache(Cache cache) Decorate the given Cache object if necessary.Get the cache associated with the given name.Get a collection of the cache names known by this manager.protected CachegetMissingCache(String name) Return a missing cache with the specifiedname, ornullif such a cache does not exist or could not be created on demand.voidInitialize the static configuration of caches.protected abstract Collection<? extends Cache>Load the initial caches for this cache manager.protected final CachelookupCache(String name) Check for a registered cache of the given name.
-
构造器详细资料
-
AbstractCacheManager
public AbstractCacheManager()
-
-
方法详细资料
-
afterPropertiesSet
public void afterPropertiesSet()- 指定者:
afterPropertiesSet在接口中InitializingBean
-
initializeCaches
public void initializeCaches()Initialize the static configuration of caches.Triggered on startup through
afterPropertiesSet(); can also be called to re-initialize at runtime.- 从以下版本开始:
- 4.0
- 另请参阅:
-
loadCaches
Load the initial caches for this cache manager.Called by
afterPropertiesSet()on startup. The returned collection may be empty but must not benull. -
getCache
从接口复制的说明:CacheManagerGet the cache associated with the given name.Note that the cache may be lazily created at runtime if the native provider supports it.
- 指定者:
getCache在接口中CacheManager- 参数:
name- the cache identifier (must not benull)- 返回:
- the associated cache, or
nullif such a cache does not exist or could be not created
-
getCacheNames
从接口复制的说明:CacheManagerGet a collection of the cache names known by this manager.- 指定者:
getCacheNames在接口中CacheManager- 返回:
- the names of all caches known by the cache manager
-
lookupCache
Check for a registered cache of the given name. In contrast togetCache(String), this method does not trigger the lazy creation of missing caches viagetMissingCache(String).- 参数:
name- the cache identifier (must not benull)- 返回:
- the associated Cache instance, or
nullif none found - 从以下版本开始:
- 4.0
- 另请参阅:
-
decorateCache
Decorate the given Cache object if necessary.- 参数:
cache- the Cache object to be added to this CacheManager- 返回:
- the decorated Cache object to be used instead, or simply the passed-in Cache object by default
-
getMissingCache
Return a missing cache with the specifiedname, ornullif such a cache does not exist or could not be created on demand.Caches may be lazily created at runtime if the native provider supports it. If a lookup by name does not yield any result, an
AbstractCacheManagersubclass gets a chance to register such a cache at runtime. The returned cache will be automatically added to this cache manager.- 参数:
name- the name of the cache to retrieve- 返回:
- the missing cache, or
nullif no such cache exists or could be created on demand - 从以下版本开始:
- 4.0
- 另请参阅:
-