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.Cache
configurable
.
A default org.infinispan.manager.CacheContainer
Cache
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
Modifier and TypeFieldDescriptionprotected static final org.infinispan.commons.logging.Log
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
destroy()
Shuts down theorg.infinispan.Cache
created by thisFactoryBean
.boolean
Always returnstrue
.void
setInfinispanCacheContainer
(CacheContainer infinispanCacheContainer) Sets the
to be used for creating ourorg.infinispan.manager.CacheContainer
instance.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.CacheContainer
instance. Note that this is a mandatory property.Cache
- Parameters:
infinispanCacheContainer
- The
to be used for creating ourorg.infinispan.manager.CacheContainer
instanceCache
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- See Also:
-
InitializingBean.afterPropertiesSet()
-
getObject
-
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
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()
-