public class EhCacheCacheManager extends AbstractTransactionSupportingCacheManager
CacheManager
.Constructor and Description |
---|
EhCacheCacheManager()
Create a new EhCacheCacheManager, setting the target EhCache CacheManager
through the
setCacheManager(net.sf.ehcache.CacheManager) bean property. |
EhCacheCacheManager(CacheManager cacheManager)
Create a new EhCacheCacheManager for the given backing EhCache CacheManager.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
CacheManager |
getCacheManager()
Return the backing EhCache
CacheManager . |
protected Cache |
getMissingCache(String name)
Return a missing cache with the specified
name or null if
such cache does not exist or could not be created on the fly. |
protected Collection<Cache> |
loadCaches()
Load the initial caches for this cache manager.
|
void |
setCacheManager(CacheManager cacheManager)
Set the backing EhCache
CacheManager . |
decorateCache, isTransactionAware, setTransactionAware
addCache, getCache, getCacheNames, initializeCaches, lookupCache
public EhCacheCacheManager()
setCacheManager(net.sf.ehcache.CacheManager)
bean property.public EhCacheCacheManager(CacheManager cacheManager)
cacheManager
- the backing EhCache CacheManager
public void setCacheManager(CacheManager cacheManager)
CacheManager
.public CacheManager getCacheManager()
CacheManager
.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
afterPropertiesSet
in class AbstractCacheManager
protected Collection<Cache> loadCaches()
AbstractCacheManager
Called by AbstractCacheManager.afterPropertiesSet()
on startup.
The returned collection may be empty but must not be null
.
loadCaches
in class AbstractCacheManager
protected Cache getMissingCache(String name)
AbstractCacheManager
name
or null
if
such cache does not exist or could not be created on the fly.
Some caches may be created at runtime if the native provider supports it. If a lookup by name does not yield any result, a subclass gets a chance to register such a cache at runtime. The returned cache will be automatically added to this instance.
getMissingCache
in class AbstractCacheManager
name
- the name of the cache to retrievenull
if no such cache exists or could be
createdAbstractCacheManager.getCache(String)