Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework.cache » ehcache » [javadoc | source]
org.springframework.cache.ehcache
public class: EhCacheManagerFactoryBean [javadoc | source]
java.lang.Object
   org.springframework.cache.ehcache.EhCacheManagerFactoryBean

All Implemented Interfaces:
    DisposableBean, InitializingBean, FactoryBean

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 2.0, this FactoryBean will by default create an independent CacheManager instance, which requires EHCache 1.2 or higher.

Field Summary
protected final  Log logger     
Method from org.springframework.cache.ehcache.EhCacheManagerFactoryBean Summary:
afterPropertiesSet,   destroy,   getObject,   getObjectType,   isSingleton,   setCacheManagerName,   setConfigLocation,   setShared
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.cache.ehcache.EhCacheManagerFactoryBean Detail:
 public  void afterPropertiesSet() throws IOException, CacheException 
 public  void destroy() 
 public Object getObject() 
 public Class getObjectType() 
 public boolean isSingleton() 
 public  void setCacheManagerName(String cacheManagerName) 
    Set the name of the EHCache CacheManager (if a specific name is desired).
 public  void setConfigLocation(Resource configLocation) 
    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).

 public  void setShared(boolean shared) 
    Set whether the EHCache CacheManager should be shared (as a singleton at the VM level) or independent (typically local within the application). Default is "false", creating an independent instance.