Class InfinispanDefaultCacheFactoryBean<K,V>
- java.lang.Object
-
- org.infinispan.spring.InfinispanDefaultCacheFactoryBean<K,V>
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<Cache<K,V>>,org.springframework.beans.factory.InitializingBean
public class InfinispanDefaultCacheFactoryBean<K,V> extends Object implements org.springframework.beans.factory.FactoryBean<Cache<K,V>>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
A
for creating a native default InfinispanFactoryBean, delegating to aorg.infinispan.Cacheconfigurable. A defaultorg.infinispan.manager.CacheContainerCacheis aCachethat uses itsCacheContainer's default settings. This is contrary to a namedCachewhere select settings from aCacheContainer's default configuration may be overridden with settings specific to thatCache.In addition to creating a
CachethisFactoryBeandoes also control thatCache'slifecycleby shutting it down when the enclosing Spring application context is closed. It is therefore advisable to always use thisFactoryBeanwhen creating aCache.- Author:
- Olaf Bergner
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.infinispan.commons.logging.Loglogger
-
Constructor Summary
Constructors Constructor Description InfinispanDefaultCacheFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voiddestroy()Shuts down theorg.infinispan.Cachecreated by thisFactoryBean.Cache<K,V>getObject()Class<? extends Cache>getObjectType()booleanisSingleton()Always returnstrue.voidsetInfinispanCacheContainer(CacheContainer infinispanCacheContainer)Sets theto be used for creating ourorg.infinispan.manager.CacheContainerinstance.Cache
-
-
-
Method Detail
-
setInfinispanCacheContainer
public void setInfinispanCacheContainer(CacheContainer infinispanCacheContainer)
Sets the
to be used for creating ourorg.infinispan.manager.CacheContainerinstance. Note that this is a mandatory property.Cache- Parameters:
infinispanCacheContainer- Theto be used for creating ourorg.infinispan.manager.CacheContainerinstanceCache
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- See Also:
InitializingBean.afterPropertiesSet()
-
getObjectType
public Class<? extends Cache> getObjectType()
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<K>- See Also:
FactoryBean.getObjectType()
-
isSingleton
public boolean isSingleton()
Always returnstrue.- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<K>- Returns:
- Always
true - See Also:
FactoryBean.isSingleton()
-
destroy
public void destroy() throws ExceptionShuts down theorg.infinispan.Cachecreated by thisFactoryBean.- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception- See Also:
DisposableBean.destroy(),Cache.stop()
-
-