public abstract class AbstractCacheManager extends Object implements CacheManager, 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) |
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
protected Cache |
decorateCache(Cache cache)
Decorate the given Cache object if necessary.
|
Cache |
getCache(String name)
Return the cache associated with the given name.
|
Collection<String> |
getCacheNames()
Return a collection of the cache names known by this manager.
|
protected abstract Collection<? extends Cache> |
loadCaches()
Load the initial caches for this cache manager.
|
public void afterPropertiesSet()
InitializingBean
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.
afterPropertiesSet
in interface InitializingBean
protected final void addCache(Cache cache)
protected Cache decorateCache(Cache cache)
cache
- the Cache object to be added to this CacheManagerpublic Cache getCache(String name)
CacheManager
getCache
in interface CacheManager
name
- the cache identifier (must not be null
)null
if none foundpublic Collection<String> getCacheNames()
CacheManager
getCacheNames
in interface CacheManager
protected abstract Collection<? extends Cache> loadCaches()
Called by afterPropertiesSet()
on startup.
The returned collection may be empty but must not be null
.