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.
setFallbackToNoOpCache, org.springframework.cache.concurrent.ConcurrentMapCacheManager#setCacheNames
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | CompositeCacheManager()
Construct an empty CompositeCacheManager, with delegate CacheManagers to
be added via the |
| public | CompositeCacheManager(CacheManager...
the CacheManagers to delegate to cacheManagers)Construct a CompositeCacheManager from the given delegate CacheManagers. |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterPropertiesSet()
Implements org. BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware, ApplicationContextAware etc.
This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. |
| public Cache | getCache(String
the cache identifier (must not be name)null)Implements org. |
| public Collection | getCacheNames()
Implements org. |
| public void | |
| public void | setFallbackToNoOpCache(boolean fallbackToNoOpCache)
Indicate whether a |
| cacheManagers | back to summary |
|---|---|
| private final List<CacheManager> cacheManagers | |
| fallbackToNoOpCache | back to summary |
|---|---|
| private boolean fallbackToNoOpCache | |
| CompositeCacheManager | back to summary |
|---|---|
| public CompositeCacheManager() Construct an empty CompositeCacheManager, with delegate CacheManagers to
be added via the | |
| CompositeCacheManager | back to summary |
|---|---|
| public CompositeCacheManager(CacheManager... cacheManagers) Construct a CompositeCacheManager from the given delegate CacheManagers.
| |
| afterPropertiesSet | back to summary |
|---|---|
| public void afterPropertiesSet() Implements org. Doc from org. Invoked by the containing This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
| |
| getCache | back to summary |
|---|---|
| public Cache getCache(String name) Implements org. Doc from org. Get the cache associated with the given name. Note that the cache may be lazily created at runtime if the native provider supports it. | |
| getCacheNames | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Get a collection of the cache names known by this manager.
| |
| setCacheManagers | back to summary |
|---|---|
| public void setCacheManagers(Collection<CacheManager> cacheManagers) Specify the CacheManagers to delegate to. | |
| setFallbackToNoOpCache | back to summary |
|---|---|
| public void setFallbackToNoOpCache(boolean fallbackToNoOpCache) Indicate whether a | |