open class EhCacheManagerFactoryBean : FactoryBean<CacheManager>, InitializingBean, DisposableBean
FactoryBean that exposes an EhCache net.sf.ehcache.CacheManager instance (independent or shared), configured from a specified config location.
If no config location is specified, a CacheManager will be configured from "ehcache.xml" in the root of the class path (that is, default EhCache initialization - as defined in the EhCache docs - will apply).
Setting up a separate EhCacheManagerFactoryBean is also advisable when using EhCacheFactoryBean, as it provides a (by default) independent CacheManager instance and cares for proper shutdown of the CacheManager. EhCacheManagerFactoryBean is also necessary for loading EhCache configuration from a non-default config location.
Note: As of Spring 5.0, Spring's EhCache support requires EhCache 2.10 or higher.
Author
Juergen Hoeller
Author
Dmitriy Kopylenko
Since
1.1.1
See Also
#setConfigLocation#setSharedEhCacheFactoryBeannet.sf.ehcache.CacheManager
EhCacheManagerFactoryBean()
FactoryBean that exposes an EhCache net.sf.ehcache.CacheManager instance (independent or shared), configured from a specified config location. If no config location is specified, a CacheManager will be configured from "ehcache.xml" in the root of the class path (that is, default EhCache initialization - as defined in the EhCache docs - will apply). Setting up a separate EhCacheManagerFactoryBean is also advisable when using EhCacheFactoryBean, as it provides a (by default) independent CacheManager instance and cares for proper shutdown of the CacheManager. EhCacheManagerFactoryBean is also necessary for loading EhCache configuration from a non-default config location. Note: As of Spring 5.0, Spring's EhCache support requires EhCache 2.10 or higher. |
open fun afterPropertiesSet(): Unit |
|
open fun destroy(): Unit |
|
open fun getObject(): CacheManager |
|
open fun getObjectType(): Class<out CacheManager> |
|
open fun isSingleton(): Boolean |
|
open fun setAcceptExisting(acceptExisting: Boolean): Unit
Set whether an existing EhCache CacheManager of the same name will be accepted for this EhCacheManagerFactoryBean setup. Default is "false". Typically used in combination with |
|
open fun setCacheManagerName(cacheManagerName: String): Unit
Set the name of the EhCache CacheManager (if a specific name is desired). |
|
open fun setConfigLocation(configLocation: Resource): Unit
Set the location of the EhCache config file. A typical value is "/WEB-INF/ehcache.xml". Default is "ehcache.xml" in the root of the class path, or if not found, "ehcache-failsafe.xml" in the EhCache jar (default EhCache initialization). |
|
open fun setShared(: Boolean): Unit
Set whether the EhCache CacheManager should be shared (as a singleton at the ClassLoader level) or independent (typically local within the application). Default is "false", creating an independent local instance. NOTE: This feature allows for sharing this EhCacheManagerFactoryBean's CacheManager with any code calling This flag overrides |