类 CompositeCacheManager
- 所有已实现的接口:
InitializingBean,CacheManager
CacheManager implementation that iterates over
a given collection of delegate CacheManager instances.
Allows NoOpCacheManager to be automatically added to the end of
the list for handling cache declarations without a backing store. Otherwise,
any custom CacheManager may play that role of the last delegate as
well, lazily creating cache regions for any requested name.
Note: Regular CacheManagers that this composite manager delegates to need
to return null from getCache(String) if they are unaware of
the specified cache name, allowing for iteration to the next delegate in line.
However, most CacheManager implementations fall back to lazy creation
of named caches once requested; check out the specific configuration details
for a 'static' mode with fixed cache names, if available.
- 从以下版本开始:
- 2019-02-28 16:38
- 作者:
- Costin Leau, Juergen Hoeller, TODAY
- 另请参阅:
-
构造器概要
构造器构造器说明Construct an empty CompositeCacheManager, with delegate CacheManagers to be added via the"cacheManagers"property.CompositeCacheManager(CacheManager... cacheManagers) Construct a CompositeCacheManager from the given delegate CacheManagers. -
方法概要
修饰符和类型方法说明voidGet the cache associated with the given name.Get a collection of the cache names known by this manager.voidsetCacheManagers(Collection<CacheManager> cacheManagers) Specify the CacheManagers to delegate to.voidsetFallbackToNoOpCache(boolean fallbackToNoOpCache) Indicate whether aNoOpCacheManagershould be added at the end of the delegate list.
-
构造器详细资料
-
CompositeCacheManager
public CompositeCacheManager()Construct an empty CompositeCacheManager, with delegate CacheManagers to be added via the"cacheManagers"property. -
CompositeCacheManager
Construct a CompositeCacheManager from the given delegate CacheManagers.- 参数:
cacheManagers- the CacheManagers to delegate to
-
-
方法详细资料
-
setCacheManagers
Specify the CacheManagers to delegate to. -
setFallbackToNoOpCache
public void setFallbackToNoOpCache(boolean fallbackToNoOpCache) Indicate whether aNoOpCacheManagershould be added at the end of the delegate list. In this case, anygetCacherequests not handled by the configured CacheManagers will be automatically handled by theNoOpCacheManager(and hence never returnnull). -
afterPropertiesSet
public void afterPropertiesSet()- 指定者:
afterPropertiesSet在接口中InitializingBean
-
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
-