Class SpringEmbeddedCacheManagerFactoryBean
- java.lang.Object
-
- org.infinispan.spring.AbstractEmbeddedCacheManagerFactory
-
- org.infinispan.spring.provider.SpringEmbeddedCacheManagerFactoryBean
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<SpringEmbeddedCacheManager>
,org.springframework.beans.factory.InitializingBean
public class SpringEmbeddedCacheManagerFactoryBean extends AbstractEmbeddedCacheManagerFactory implements org.springframework.beans.factory.FactoryBean<SpringEmbeddedCacheManager>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
A
for creating anFactoryBean
instance. The location of the Infinispan configuration file used to provide the defaultSpringEmbeddedCacheManager
configuration
for theEmbeddedCacheManager
instance created by thisFactoryBean
isconfigurable
.If no configuration file location is set the
SpringEmbeddedCacheManager
instance created by thisFactoryBean
will use Infinispan's default settings. See Infinispan's documentation for what those default settings are.A user may further customize the
SpringEmbeddedCacheManager
's configuration using explicit setters on thisFactoryBean
. The properties thus defined will be applied either to the configuration loaded from Infinispan's configuration file in case one has been specified, or to a configuration initialized with Infinispan's default settings. Either way, the net effect is that explicitly set configuration properties take precedence over both those loaded from a configuration file as well as INFINISPAN's default settings.In addition to creating an
SpringEmbeddedCacheManager
thisFactoryBean
does also control thatSpringEmbeddedCacheManager
'slifecycle
by shutting it down when the enclosing Spring application context is closed. It is therefore advisable to always use thisFactoryBean
when creating anSpringEmbeddedCacheManager
.
-
-
Constructor Summary
Constructors Constructor Description SpringEmbeddedCacheManagerFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
destroy()
Shuts down theSpringEmbeddedCacheManager
instance created by thisFactoryBean
.SpringEmbeddedCacheManager
getObject()
Class<? extends SpringEmbeddedCacheManager>
getObjectType()
boolean
isSingleton()
Always returnstrue
.-
Methods inherited from class org.infinispan.spring.AbstractEmbeddedCacheManagerFactory
addCustomCacheConfiguration, addCustomGlobalConfiguration, createBackingEmbeddedCacheManager, setConfigurationFileLocation
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- See Also:
InitializingBean.afterPropertiesSet()
-
getObject
public SpringEmbeddedCacheManager getObject() throws Exception
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<SpringEmbeddedCacheManager>
- Throws:
Exception
- See Also:
FactoryBean.getObject()
-
getObjectType
public Class<? extends SpringEmbeddedCacheManager> getObjectType()
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<SpringEmbeddedCacheManager>
- See Also:
FactoryBean.getObjectType()
-
isSingleton
public boolean isSingleton()
Always returnstrue
.- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<SpringEmbeddedCacheManager>
- Returns:
- Always
true
- See Also:
FactoryBean.isSingleton()
-
destroy
public void destroy() throws Exception
Shuts down theSpringEmbeddedCacheManager
instance created by thisFactoryBean
.- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
- See Also:
DisposableBean.destroy()
,SpringEmbeddedCacheManager.stop()
-
-