Package org.springframework.data.gemfire
Class AbstractConfigurableCacheFactoryBean
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<GemFireCache>
org.springframework.data.gemfire.AbstractBasicCacheFactoryBean
org.springframework.data.gemfire.AbstractConfigurableCacheFactoryBean
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,BeanNameAware,DisposableBean,FactoryBean<GemFireCache>,InitializingBean,Phased,PersistenceExceptionTranslator
- Direct Known Subclasses:
AbstractResolvableCacheFactoryBean
Abstract base class encapsulating functionality for (externally) configuring an Apache Geode
ClientCache
or peer Cache as a bean in the Spring context.- Since:
- 2.5.0
- Author:
- John Blum
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.gemfire.AbstractBasicCacheFactoryBean
AbstractBasicCacheFactoryBean.CacheFactoryInitializer<T>, AbstractBasicCacheFactoryBean.PdxConfigurer<T> -
Field Summary
Fields inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
DEFAULT_SINGLETONFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes theGemfireBeanFactoryLocatorifisUseBeanFactoryLocator()returns true and an existingGemfireBeanFactoryLocatoris not already present.voiddestroy()Destroys and releases resources used by theGemfireBeanFactoryLocator, if present.Returns a reference to the configuredGemfireBeanFactoryLocatorused to resolve Spring bean references in Apache Geode native configuration metadata (e.g.Returns a reference to an (optional) Apache Geode native cache.xmlResource.Returns anOptionalreference to the configuredGemfireBeanFactoryLocatorused to resolve Spring bean references in Apache Geode native configuration metadata (e.g.Returns a reference to the Apache GeodePropertiesused to configure the cache.protected booleanDetermines whether a cache.xmlResourceexists (i.e. is present).protected booleanDetermines whether the optionally configured cache.xml is resolvable as aFilein the file system.booleanDetermines whether theGemfireBeanFactoryLocatorhas been enabled.protected <T extends GemFireCache>
TloadCacheXml(T cache) Loads the configured cache.xml to initialize theGemFireCache.protected PropertiesResolves the Apache GeodePropertiesused to configure theGemFireCache.setAndGetProperties(Properties properties) Sets and then returns a reference to Apache GeodePropertiesused to configure the cache.protected voidsetBeanFactoryLocator(GemfireBeanFactoryLocator beanFactoryLocator) Gets a reference to the configuredGemfireBeanFactoryLocatorused to resolve Spring bean references in Apache Geode native configuration metadata (e.g.voidsetCacheXml(Resource cacheXml) Sets a reference to an (optional) Apache Geode native cache.xmlResource.voidsetProperties(Properties properties) Sets the Apache GeodePropertiesused to configure the cache.voidsetUseBeanFactoryLocator(boolean use) Sets a boolean value used to determine whether to enable theGemfireBeanFactoryLocator.Methods inherited from class org.springframework.data.gemfire.AbstractBasicCacheFactoryBean
applyCacheConfigurers, close, configureHeapPercentages, configureOffHeapPercentages, configurePdx, doFetchCache, doGetObject, doGetObjectType, fetchCache, getCache, getCacheFactoryInitializer, getCopyOnRead, getCriticalHeapPercentage, getCriticalOffHeapPercentage, getEvictionHeapPercentage, getEvictionOffHeapPercentage, getObject, getObjectType, getOptionalCache, getPdxDiskStoreName, getPdxIgnoreUnreadFields, getPdxPersistent, getPdxReadSerialized, getPdxSerializer, getPhase, getTransactionListeners, getTransactionWriter, initializeFactory, isClose, isCopyOnRead, isNotClosed, registerTransactionListeners, registerTransactionWriter, setCache, setCacheFactoryInitializer, setClose, setCopyOnRead, setCriticalHeapPercentage, setCriticalOffHeapPercentage, setEvictionHeapPercentage, setEvictionOffHeapPercentage, setPdxDiskStoreName, setPdxIgnoreUnreadFields, setPdxPersistent, setPdxReadSerialized, setPdxSerializer, setPhase, setTransactionListeners, setTransactionWriter, translateExceptionIfPossibleMethods inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupport
getBeanClassLoader, getBeanFactory, getBeanName, getLog, getOptionalLog, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLog, setBeanClassLoader, setBeanFactory, setBeanName
-
Constructor Details
-
AbstractConfigurableCacheFactoryBean
public AbstractConfigurableCacheFactoryBean()
-
-
Method Details
-
setBeanFactoryLocator
Gets a reference to the configuredGemfireBeanFactoryLocatorused to resolve Spring bean references in Apache Geode native configuration metadata (e.g. cache.xml).- Parameters:
beanFactoryLocator- reference to the configuredGemfireBeanFactoryLocator.- See Also:
-
getBeanFactoryLocator
Returns a reference to the configuredGemfireBeanFactoryLocatorused to resolve Spring bean references in Apache Geode native configuration metadata (e.g. cache.xml).- Returns:
- a reference to the configured
GemfireBeanFactoryLocator. - See Also:
-
getOptionalBeanFactoryLocator
Returns anOptionalreference to the configuredGemfireBeanFactoryLocatorused to resolve Spring bean references in Apache Geode native configuration metadata (e.g. cache.xml).- Returns:
- an
Optionalreference to the configuredGemfireBeanFactoryLocator. - See Also:
-
setCacheXml
Sets a reference to an (optional) Apache Geode native cache.xmlResource. -
getCacheXml
Returns a reference to an (optional) Apache Geode native cache.xmlResource. -
getOptionalCacheXml
-
isCacheXmlPresent
protected boolean isCacheXmlPresent()Determines whether a cache.xmlResourceexists (i.e. is present).- Returns:
- boolean value indicating whether a cache.xml exists.
- See Also:
-
isCacheXmlResolvableAsAFile
protected boolean isCacheXmlResolvableAsAFile()Determines whether the optionally configured cache.xml is resolvable as aFilein the file system.- Returns:
- a boolean value indicating whether the optionally configured cache.xml
is resolvable as a
Filein the file system. - See Also:
-
setAndGetProperties
Sets and then returns a reference to Apache GeodePropertiesused to configure the cache.- Parameters:
properties- reference to Apache GeodePropertiesused to configure the cache.- Returns:
- a reference to Apache Geode
Propertiesused to configure the cache. - See Also:
-
setProperties
Sets the Apache GeodePropertiesused to configure the cache.- Parameters:
properties- reference to Apache GeodePropertiesused to configure the cache.- See Also:
-
getProperties
Returns a reference to the Apache GeodePropertiesused to configure the cache.- Returns:
- a reference to Apache Geode
Properties. - See Also:
-
setUseBeanFactoryLocator
public void setUseBeanFactoryLocator(boolean use) Sets a boolean value used to determine whether to enable theGemfireBeanFactoryLocator.- Parameters:
use- boolean value used to determine whether to enable theGemfireBeanFactoryLocator.- See Also:
-
isUseBeanFactoryLocator
public boolean isUseBeanFactoryLocator()Determines whether theGemfireBeanFactoryLocatorhas been enabled.- Returns:
- a boolean value indicating whether the
GemfireBeanFactoryLocatorhas been enabled. - See Also:
-
afterPropertiesSet
Initializes theGemfireBeanFactoryLocatorifisUseBeanFactoryLocator()returns true and an existingGemfireBeanFactoryLocatoris not already present.- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classAbstractBasicCacheFactoryBean- Throws:
Exception- if initialization fails.- See Also:
-
destroy
public void destroy()Destroys and releases resources used by theGemfireBeanFactoryLocator, if present.- Specified by:
destroyin interfaceDisposableBean- Overrides:
destroyin classAbstractBasicCacheFactoryBean- See Also:
-
loadCacheXml
Loads the configured cache.xml to initialize theGemFireCache.- Type Parameters:
T- parameterizedClasstype extendingGemFireCache.- Parameters:
cache-GemFireCacheinstance to initialize with cache.xml; must not be null.- Returns:
- the given
GemFireCache. - Throws:
RuntimeException- if the configured cache.xml file could not be loaded into theGemFireCache.- See Also:
-
resolveProperties
Resolves the Apache GeodePropertiesused to configure theGemFireCache.- Returns:
- the resolved Apache Geode
Propertiesused to configure theGemFireCache. - See Also:
-