|
spring-context | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.cache.ehcache.EhCacheManagerFactoryBean
public class EhCacheManagerFactoryBean
FactoryBean
that exposes an 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 3.0, Spring's EHCache support requires EHCache 1.3 or higher.
setConfigLocation(org.springframework.core.io.Resource)
,
setShared(boolean)
,
EhCacheFactoryBean
,
CacheManager
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
EhCacheManagerFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
void |
destroy()
|
net.sf.ehcache.CacheManager |
getObject()
|
java.lang.Class<? extends net.sf.ehcache.CacheManager> |
getObjectType()
|
boolean |
isSingleton()
|
void |
setCacheManagerName(java.lang.String cacheManagerName)
Set the name of the EHCache CacheManager (if a specific name is desired). |
void |
setConfigLocation(org.springframework.core.io.Resource configLocation)
Set the location of the EHCache config file. |
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public EhCacheManagerFactoryBean()
Method Detail |
---|
public void setConfigLocation(org.springframework.core.io.Resource configLocation)
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).
CacheManager.create(java.io.InputStream)
,
CacheManager.CacheManager(java.io.InputStream)
public void setShared(boolean shared)
CacheManager.create()
,
CacheManager.CacheManager()
public void setCacheManagerName(java.lang.String cacheManagerName)
CacheManager.setName(String)
public void afterPropertiesSet() throws java.io.IOException, net.sf.ehcache.CacheException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.io.IOException
net.sf.ehcache.CacheException
public net.sf.ehcache.CacheManager getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<net.sf.ehcache.CacheManager>
public java.lang.Class<? extends net.sf.ehcache.CacheManager> 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
|
spring-context | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |