Package org.springframework.data.gemfire
Class AbstractConfigurableCacheFactoryBean
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<org.apache.geode.cache.GemFireCache>
org.springframework.data.gemfire.AbstractBasicCacheFactoryBean
org.springframework.data.gemfire.AbstractConfigurableCacheFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.GemFireCache>
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.Phased
,org.springframework.dao.support.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
- See Also:
-
File
InputStream
Properties
Cache
GemFireCache
ClientCache
BeanFactory
Resource
AbstractBasicCacheFactoryBean
GemfireBeanFactoryLocator
-
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.org.springframework.core.io.Resource
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.Optional<org.springframework.core.io.Resource>
Returns anOptional
reference to an Apache Geode native cache.xmlResource
.Returns a reference to the Apache GeodeProperties
used to configure the cache.protected boolean
Determines whether a cache.xmlResource
exists (i.e.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 org.apache.geode.cache.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
(org.springframework.core.io.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, getLogger, getOptionalLogger, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLogger, 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
public void setCacheXml(@Nullable org.springframework.core.io.Resource cacheXml) Sets a reference to an (optional) Apache Geode native cache.xmlResource
.- Parameters:
cacheXml
- reference to an (optional) Apache Geode native cache.xmlResource
.- See Also:
-
Resource
-
getCacheXml
@Nullable public org.springframework.core.io.Resource getCacheXml()Returns a reference to an (optional) Apache Geode native cache.xmlResource
.- Returns:
- a reference to an (optional) Apache Geode native cache.xml
Resource
. - See Also:
-
Resource
-
getOptionalCacheXml
Returns anOptional
reference to an Apache Geode native cache.xmlResource
.- Returns:
- an
Optional
reference to an Apache Geode native cache.xmlResource
. - See Also:
-
Resource
Optional
getCacheXml()
-
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:
-
Resource.exists()
getCacheXml()
-
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:
-
Resource.isFile()
getCacheXml()
File
-
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 interfaceorg.springframework.beans.factory.InitializingBean
- 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 interfaceorg.springframework.beans.factory.DisposableBean
- Overrides:
destroy
in classAbstractBasicCacheFactoryBean
- See Also:
-
loadCacheXml
@NonNull protected <T extends org.apache.geode.cache.GemFireCache> T loadCacheXml(@NonNull T cache) 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:
-
GemFireCache.loadCacheXml(InputStream)
GemFireCache
getOptionalCacheXml()
-
resolveProperties
Resolves the Apache GeodeProperties
used to configure theGemFireCache
.- Returns:
- the resolved Apache Geode
Properties
used to configure theGemFireCache
. - See Also:
-