org.onebusaway.container.spring.ehcache
Class EhCacheManagerFactoryBean

java.lang.Object
  extended by org.onebusaway.container.spring.ehcache.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 Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
EhCacheManagerFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 net.sf.ehcache.CacheManager getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setCacheManagerName(String cacheManagerName)
          Set the name of the EHCache CacheManager (if a specific name is desired).
 void setConfigLocation(org.springframework.core.io.Resource configLocation)
           
 void setConfiguration(net.sf.ehcache.config.Configuration configuration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
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


Copyright © 2012 OneBusAway. All Rights Reserved.