org.infinispan.spring.support.embedded
Class InfinispanEmbeddedCacheManagerFactoryBean

java.lang.Object
  extended by org.infinispan.spring.AbstractEmbeddedCacheManagerFactory
      extended by org.infinispan.spring.support.embedded.InfinispanEmbeddedCacheManagerFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<EmbeddedCacheManager>, org.springframework.beans.factory.InitializingBean

public class InfinispanEmbeddedCacheManagerFactoryBean
extends AbstractEmbeddedCacheManagerFactory
implements org.springframework.beans.factory.FactoryBean<EmbeddedCacheManager>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

A FactoryBean for creating an Infinispan EmbeddedCacheManager instance. The location of the Infinispan configuration file used to provide the default configuration for the EmbeddedCacheManager instance created by this FactoryBean is configurable.

If no configuration file location is set the EmbeddedCacheManager instance created by this FactoryBean will 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 this FactoryBean. 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 EmbeddedCacheManager this FactoryBean does also control that EmbeddedCacheManagers'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 an EmbeddedCacheManager.

Author:
Olaf Bergner
See Also:
AbstractEmbeddedCacheManagerFactory.setConfigurationFileLocation(org.springframework.core.io.Resource), destroy(), EmbeddedCacheManager, Configuration

Nested Class Summary
 
Nested classes/interfaces inherited from class org.infinispan.spring.AbstractEmbeddedCacheManagerFactory
AbstractEmbeddedCacheManagerFactory.ConfigurationContainer, AbstractEmbeddedCacheManagerFactory.GlobalConfigurationOverrides
 
Field Summary
 
Fields inherited from class org.infinispan.spring.AbstractEmbeddedCacheManagerFactory
configurationOverrides, globalConfigurationOverrides, logger
 
Constructor Summary
InfinispanEmbeddedCacheManagerFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
          Shuts down the EmbeddedCacheManager instance created by this FactoryBean.
 EmbeddedCacheManager getObject()
           
 Class<? extends EmbeddedCacheManager> getObjectType()
           
 boolean isSingleton()
          Always returns true.
 
Methods inherited from class org.infinispan.spring.AbstractEmbeddedCacheManagerFactory
createBackingEmbeddedCacheManager, createCacheManager, createTemplateConfiguration, setAllowDuplicateDomains, setAlwaysProvideInMemoryState, setAsyncListenerExecutorFactoryClass, setAsyncListenerExecutorProperties, setAsyncTransportExecutorFactoryClass, setAsyncTransportExecutorProperties, setCacheLoaderManagerConfig, setCacheManagerName, setCacheModeString, setClusterName, setConcurrencyLevel, setConfigurationFileLocation, setConsistentHashClass, setCustomInterceptors, setDeadlockDetectionSpinDuration, setDistributedSyncTimeout, setEagerLockSingleNode, setEnableDeadlockDetection, setEvictionMaxEntries, setEvictionScheduledExecutorFactoryClass, setEvictionScheduledExecutorProperties, setEvictionStrategy, setEvictionStrategyClass, setEvictionThreadPolicy, setEvictionThreadPolicyClass, setExpirationLifespan, setExpirationMaxIdle, setExpirationWakeUpInterval, setExposeGlobalJmxStatistics, setExposeJmxStatistics, setFetchInMemoryState, setIndexingEnabled, setIndexLocalOnly, setInvocationBatchingEnabled, setIsolationLevel, setIsolationLevelClass, setJmxDomain, setL1CacheEnabled, setL1Lifespan, setL1OnRehash, setLockAcquisitionTimeout, setMachineId, setMarshallerClass, setMarshallVersion, setMBeanServerLookup, setMBeanServerLookupClass, setMBeanServerProperties, setNumOwners, setRackId, setRehashEnabled, setRehashRpcTimeout, setRehashWaitTime, setReplicationQueueScheduledExecutorFactoryClass, setReplicationQueueScheduledExecutorProperties, setReplQueueClass, setReplQueueInterval, setReplQueueMaxElements, setShutdownHookBehavior, setSiteId, setStateRetrievalChunkSize, setStateRetrievalInitialRetryWaitTime, setStateRetrievalLogFlushTimeout, setStateRetrievalMaxNonProgressingLogWrites, setStateRetrievalNumRetries, setStateRetrievalRetryWaitTimeIncreaseFactor, setStateRetrievalTimeout, setStrictPeerToPeer, setSyncCommitPhase, setSyncReplTimeout, setSyncRollbackPhase, setTransactionManagerLookup, setTransactionManagerLookupClass, setTransportClass, setTransportNodeName, setTransportProperties, setUnsafeUnreliableReturnValues, setUseAsyncMarshalling, setUseEagerLocking, setUseLazyDeserialization, setUseLockStriping, setUseReplQueue, setWriteSkewCheck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfinispanEmbeddedCacheManagerFactoryBean

public InfinispanEmbeddedCacheManagerFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception
See Also:
InitializingBean.afterPropertiesSet()

getObject

public EmbeddedCacheManager getObject()
                               throws Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<EmbeddedCacheManager>
Throws:
Exception
See Also:
FactoryBean.getObject()

getObjectType

public Class<? extends EmbeddedCacheManager> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<EmbeddedCacheManager>
See Also:
FactoryBean.getObjectType()

isSingleton

public boolean isSingleton()
Always returns true.

Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<EmbeddedCacheManager>
Returns:
Always true
See Also:
FactoryBean.isSingleton()

destroy

public void destroy()
             throws Exception
Shuts down the EmbeddedCacheManager instance created by this FactoryBean.

Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception
See Also:
DisposableBean.destroy(), Lifecycle.stop()

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.