public abstract class AbstractCacheManager extends Object implements CacheManager, org.springframework.beans.factory.InitializingBean
CacheManager methods.
 Useful for 'static' environments where the backing caches do not change.| Constructor and Description | 
|---|
| AbstractCacheManager() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | addCache(Cache cache)Deprecated. 
 as of Spring 4.3, in favor of  getMissingCache(String) | 
| void | afterPropertiesSet() | 
| protected Cache | decorateCache(Cache cache)Decorate the given Cache object if necessary. | 
| Cache | getCache(String name)Get the cache associated with the given name. | 
| Collection<String> | getCacheNames()Get a collection of the cache names known by this manager. | 
| protected Cache | getMissingCache(String name)Return a missing cache with the specified  name, ornullif
 such a cache does not exist or could not be created on demand. | 
| void | initializeCaches()Initialize the static configuration of caches. | 
| protected abstract Collection<? extends Cache> | loadCaches()Load the initial caches for this cache manager. | 
| protected Cache | lookupCache(String name)Check for a registered cache of the given name. | 
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void initializeCaches()
Triggered on startup through afterPropertiesSet();
 can also be called to re-initialize at runtime.
loadCaches()protected abstract Collection<? extends Cache> loadCaches()
Called by afterPropertiesSet() on startup.
 The returned collection may be empty but must not be null.
@Nullable public Cache getCache(String name)
CacheManagerNote that the cache may be lazily created at runtime if the native provider supports it.
getCache in interface CacheManagername - the cache identifier (must not be null)null if such a cache
 does not exist or could be not createdpublic Collection<String> getCacheNames()
CacheManagergetCacheNames in interface CacheManager@Nullable protected final Cache lookupCache(String name)
getCache(String), this method does not trigger
 the lazy creation of missing caches via getMissingCache(String).name - the cache identifier (must not be null)null if none foundgetCache(String), 
getMissingCache(String)@Deprecated protected final void addCache(Cache cache)
getMissingCache(String)cache - the Cache to registerprotected Cache decorateCache(Cache cache)
cache - the Cache object to be added to this CacheManager@Nullable protected Cache getMissingCache(String name)
name, or null if
 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 AbstractCacheManager
 subclass 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 retrievenull if no such cache exists or could be
 created on demandgetCache(String)