org.onebusaway.container.spring.ehcache
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
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.EhCacheConfigurationFactoryBean
,
EhCacheFactoryBean
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
EhCacheManagerFactoryBean() |
Modifier and Type | Method and Description |
---|---|
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) |
public void setConfigLocation(org.springframework.core.io.Resource configLocation)
public void setConfiguration(net.sf.ehcache.config.Configuration configuration)
public void setCacheManagerName(String cacheManagerName)
CacheManager.setName(String)
public void afterPropertiesSet() throws IOException, net.sf.ehcache.CacheException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
IOException
net.sf.ehcache.CacheException
public net.sf.ehcache.CacheManager getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>
public Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
Copyright © 2014 OneBusAway. All Rights Reserved.