Class EhCacheManagerFactoryBean

  • All Implemented Interfaces:
    org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>, org.springframework.beans.factory.InitializingBean

    public class EhCacheManagerFactoryBean
    extends Object
    implements org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
    * A Spring FactoryBean for programmatically creating an EhCache CacheManager, specifically allowing us to pass in a Configuration directly. The existing factory bean implementation provided by Spring directly does not allow one to programmatically specify the Configuration directly, which makes it difficult to dynamically configure the cache using a spring application context config.
    Author:
    bdferris
    See Also:
    EhCacheConfigurationFactoryBean, EhCacheFactoryBean
    • Field Detail

      • logger

        protected final org.apache.commons.logging.Log logger
    • Constructor Detail

      • EhCacheManagerFactoryBean

        public EhCacheManagerFactoryBean()
    • Method Detail

      • setConfigLocation

        public void setConfigLocation​(org.springframework.core.io.Resource configLocation)
      • setConfiguration

        public void setConfiguration​(net.sf.ehcache.config.Configuration configuration)
      • setCacheManagerName

        public void setCacheManagerName​(String cacheManagerName)
        Set the name of the EHCache CacheManager (if a specific name is desired).
        See Also:
        net.sf.ehcache.CacheManager#setName(String)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws IOException,
                                       net.sf.ehcache.CacheException
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        IOException
        net.sf.ehcache.CacheException
      • getObject

        public net.sf.ehcache.CacheManager getObject()
        Specified by:
        getObject in interface org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>
      • getObjectType

        public Class<?> getObjectType()
        Specified by:
        getObjectType in interface org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean