spring-framework / org.springframework.cache.ehcache / EhCacheManagerFactoryBean / <init>

<init>

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.

Author
Juergen Hoeller

Author
Dmitriy Kopylenko

Since
1.1.1

See Also
#setConfigLocation#setSharedEhCacheFactoryBeannet.sf.ehcache.CacheManager