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_SINGLETON
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Initializes theGemfireBeanFactoryLocator
ifisUseBeanFactoryLocator()
returns true and an existingGemfireBeanFactoryLocator
is not already present.void
destroy()
Destroys and releases resources used by theGemfireBeanFactoryLocator
, if present.Returns a reference to the configuredGemfireBeanFactoryLocator
used 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 anOptional
reference to the configuredGemfireBeanFactoryLocator
used to resolve Spring bean references in Apache Geode native configuration metadata (e.g.Returns a reference to the Apache GeodeProperties
used to configure the cache.protected boolean
Determines whether a cache.xmlResource
exists (i.e. is present).protected boolean
Determines whether the optionally configured cache.xml is resolvable as aFile
in the file system.boolean
Determines whether theGemfireBeanFactoryLocator
has been enabled.protected <T extends GemFireCache>
TloadCacheXml
(T cache) Loads the configured cache.xml to initialize theGemFireCache
.protected Properties
Resolves the Apache GeodeProperties
used to configure theGemFireCache
.setAndGetProperties
(Properties properties) Sets and then returns a reference to Apache GeodeProperties
used to configure the cache.protected void
setBeanFactoryLocator
(GemfireBeanFactoryLocator beanFactoryLocator) Gets a reference to the configuredGemfireBeanFactoryLocator
used to resolve Spring bean references in Apache Geode native configuration metadata (e.g.void
setCacheXml
(Resource cacheXml) Sets a reference to an (optional) Apache Geode native cache.xmlResource
.void
setProperties
(Properties properties) Sets the Apache GeodeProperties
used to configure the cache.void
setUseBeanFactoryLocator
(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, translateExceptionIfPossible
Methods 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 configuredGemfireBeanFactoryLocator
used 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 configuredGemfireBeanFactoryLocator
used 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 anOptional
reference to the configuredGemfireBeanFactoryLocator
used to resolve Spring bean references in Apache Geode native configuration metadata (e.g. cache.xml).- Returns:
- an
Optional
reference 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.xmlResource
exists (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 aFile
in the file system.- Returns:
- a boolean value indicating whether the optionally configured cache.xml
is resolvable as a
File
in the file system. - See Also:
-
setAndGetProperties
Sets and then returns a reference to Apache GeodeProperties
used to configure the cache.- Parameters:
properties
- reference to Apache GeodeProperties
used to configure the cache.- Returns:
- a reference to Apache Geode
Properties
used to configure the cache. - See Also:
-
setProperties
Sets the Apache GeodeProperties
used to configure the cache.- Parameters:
properties
- reference to Apache GeodeProperties
used to configure the cache.- See Also:
-
getProperties
Returns a reference to the Apache GeodeProperties
used 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 theGemfireBeanFactoryLocator
has been enabled.- Returns:
- a boolean value indicating whether the
GemfireBeanFactoryLocator
has been enabled. - See Also:
-
afterPropertiesSet
Initializes theGemfireBeanFactoryLocator
ifisUseBeanFactoryLocator()
returns true and an existingGemfireBeanFactoryLocator
is not already present.- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in classAbstractBasicCacheFactoryBean
- Throws:
Exception
- if initialization fails.- See Also:
-
destroy
public void destroy()Destroys and releases resources used by theGemfireBeanFactoryLocator
, if present.- Specified by:
destroy
in interfaceDisposableBean
- Overrides:
destroy
in classAbstractBasicCacheFactoryBean
- See Also:
-
loadCacheXml
Loads the configured cache.xml to initialize theGemFireCache
.- Type Parameters:
T
- parameterizedClass
type extendingGemFireCache
.- Parameters:
cache
-GemFireCache
instance 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 GeodeProperties
used to configure theGemFireCache
.- Returns:
- the resolved Apache Geode
Properties
used to configure theGemFireCache
. - See Also:
-