Class InfinispanDefaultCacheFactoryBean<K,V>
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<Cache<K,,V>> org.springframework.beans.factory.InitializingBean
A for creating a
native default Infinispan FactoryBean
, delegating to a org.infinispan.Cacheconfigurable.
A default org.infinispan.manager.CacheContainerCache is a Cache that uses its CacheContainer's
default settings. This is contrary to a named Cache where select settings
from a CacheContainer's default configuration may be overridden with settings
specific to that Cache.
In addition to creating a Cache this FactoryBean does also control that
Cache's lifecycle by shutting it down
when the enclosing Spring application context is closed. It is therefore advisable to
always use this FactoryBean when creating a Cache.
- Author:
- Olaf Bergner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.infinispan.commons.logging.LogFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()Shuts down theorg.infinispan.Cachecreated by thisFactoryBean.booleanAlways returnstrue.voidsetInfinispanCacheContainer(CacheContainer infinispanCacheContainer) Sets theto be used for creating ourorg.infinispan.manager.CacheContainerinstance.Cache
-
Field Details
-
logger
protected static final org.infinispan.commons.logging.Log logger
-
-
Constructor Details
-
InfinispanDefaultCacheFactoryBean
public InfinispanDefaultCacheFactoryBean()
-
-
Method Details
-
setInfinispanCacheContainer
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
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- See Also:
-
InitializingBean.afterPropertiesSet()
-
getObject
-
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
Shuts down theorg.infinispan.Cachecreated by thisFactoryBean.- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception- See Also:
-
DisposableBean.destroy()Cache.stop()
-