Class InfinispanEmbeddedCacheManagerFactoryBean
- java.lang.Object
-
- org.infinispan.spring.embedded.AbstractEmbeddedCacheManagerFactory
-
- org.infinispan.spring.embedded.support.InfinispanEmbeddedCacheManagerFactoryBean
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<org.infinispan.manager.EmbeddedCacheManager>,org.springframework.beans.factory.InitializingBean
public class InfinispanEmbeddedCacheManagerFactoryBean extends AbstractEmbeddedCacheManagerFactory implements org.springframework.beans.factory.FactoryBean<org.infinispan.manager.EmbeddedCacheManager>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
A
for creating anFactoryBeaninstance. The location of the Infinispan configuration file used to provide the defaultInfinispan EmbeddedCacheManagerconfigurationfor theEmbeddedCacheManagerinstance created by thisFactoryBeanisconfigurable.If no configuration file location is set the
EmbeddedCacheManagerinstance created by thisFactoryBeanwill use Infinispan's default settings. See Infinispan's documentation for what those default settings are.A user may further customize the
EmbeddedCacheManager'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 INFNISPAN's default settings.In addition to creating an
EmbeddedCacheManagerthisFactoryBeandoes also control thatEmbeddedCacheManagers'slifecycleby shutting it down when the enclosing Spring application context is closed. It is therefore advisable to always use thisFactoryBeanwhen creating anEmbeddedCacheManager.- Author:
- Olaf Bergner
- See Also:
AbstractEmbeddedCacheManagerFactory.setConfigurationFileLocation(org.springframework.core.io.Resource),destroy(),EmbeddedCacheManager,Configuration
-
-
Constructor Summary
Constructors Constructor Description InfinispanEmbeddedCacheManagerFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voiddestroy()Shuts down theEmbeddedCacheManagerinstance created by thisFactoryBean.org.infinispan.manager.EmbeddedCacheManagergetObject()Class<? extends org.infinispan.manager.EmbeddedCacheManager>getObjectType()booleanisSingleton()Always returnstrue.-
Methods inherited from class org.infinispan.spring.embedded.AbstractEmbeddedCacheManagerFactory
addCustomCacheConfiguration, addCustomGlobalConfiguration, createBackingEmbeddedCacheManager, setConfigurationFileLocation
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- See Also:
InitializingBean.afterPropertiesSet()
-
getObject
public org.infinispan.manager.EmbeddedCacheManager getObject() throws Exception- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<org.infinispan.manager.EmbeddedCacheManager>- Throws:
Exception- See Also:
FactoryBean.getObject()
-
getObjectType
public Class<? extends org.infinispan.manager.EmbeddedCacheManager> getObjectType()
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<org.infinispan.manager.EmbeddedCacheManager>- See Also:
FactoryBean.getObjectType()
-
isSingleton
public boolean isSingleton()
Always returnstrue.- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<org.infinispan.manager.EmbeddedCacheManager>- Returns:
- Always
true - See Also:
FactoryBean.isSingleton()
-
-