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.Cache
configurable
. A defaultorg.infinispan.manager.CacheContainer
Cache
is aCache
that uses itsCacheContainer
's default settings. This is contrary to a namedCache
where select settings from aCacheContainer
's default configuration may be overridden with settings specific to thatCache
.In addition to creating a
Cache
thisFactoryBean
does also control thatCache
'slifecycle
by shutting it down when the enclosing Spring application context is closed. It is therefore advisable to always use thisFactoryBean
when creating aCache
.- Author:
- Olaf Bergner
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.infinispan.commons.logging.Log
logger
-
Constructor Summary
Constructors Constructor Description InfinispanDefaultCacheFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
destroy()
Shuts down theorg.infinispan.Cache
created by thisFactoryBean
.Cache<K,V>
getObject()
Class<? extends Cache>
getObjectType()
boolean
isSingleton()
Always returnstrue
.void
setInfinispanCacheContainer(CacheContainer infinispanCacheContainer)
Sets the
to be used for creating ourorg.infinispan.manager.CacheContainer
instance.Cache
-
-
-
Method Detail
-
setInfinispanCacheContainer
public void setInfinispanCacheContainer(CacheContainer infinispanCacheContainer)
Sets the
to be used for creating ourorg.infinispan.manager.CacheContainer
instance. Note that this is a mandatory property.Cache
- Parameters:
infinispanCacheContainer
- The
to be used for creating ourorg.infinispan.manager.CacheContainer
instanceCache
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- See Also:
InitializingBean.afterPropertiesSet()
-
getObjectType
public Class<? extends Cache> getObjectType()
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<K>
- See Also:
FactoryBean.getObjectType()
-
isSingleton
public boolean isSingleton()
Always returnstrue
.- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<K>
- Returns:
- Always
true
- See Also:
FactoryBean.isSingleton()
-
destroy
public void destroy() throws Exception
Shuts down theorg.infinispan.Cache
created by thisFactoryBean
.- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
- See Also:
DisposableBean.destroy()
,Cache.stop()
-
-