public class CompositeCacheManager extends java.lang.Object implements CacheManager, InitializingBean
CacheManagerimplementation that iterates over a given collection of delegate
NoOpCacheManager to be automatically added to the end of
the list for handling cache declarations without a backing store. Otherwise,
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
getCache(String) if they are unaware of
the specified cache name, allowing for iteration to the next delegate in line.
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.
|Constructor and Description|
Construct an empty CompositeCacheManager, with delegate CacheManagers to be added via the
Construct a CompositeCacheManager from the given delegate CacheManagers.
|Modifier and Type||Method and Description|
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Return the cache associated with the given name.
Return a collection of the cache names known by this manager.
Specify the CacheManagers to delegate to.
Indicate whether a
public CompositeCacheManager(CacheManager... cacheManagers)
cacheManagers- the CacheManagers to delegate to
public void setCacheManagers(java.util.Collection<CacheManager> cacheManagers)
public void setFallbackToNoOpCache(boolean fallbackToNoOpCache)
public void afterPropertiesSet()
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.