Package org.springframework.data.gemfire
Class AbstractResolvableCacheFactoryBean
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<GemFireCache>
org.springframework.data.gemfire.AbstractBasicCacheFactoryBean
org.springframework.data.gemfire.AbstractConfigurableCacheFactoryBean
org.springframework.data.gemfire.AbstractResolvableCacheFactoryBean
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,FactoryBean<GemFireCache>
,InitializingBean
,Phased
,PersistenceExceptionTranslator
- Direct Known Subclasses:
CacheFactoryBean
public abstract class AbstractResolvableCacheFactoryBean
extends AbstractConfigurableCacheFactoryBean
Abstract base class encapsulating logic to resolve or create a
GemFireCache
instance.- 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 TypeMethodDescriptionprotected Object
configureFactory
(Object factory) Configures the cache factory used to create theGemFireCache
.protected abstract <T extends GemFireCache>
TcreateCache
(Object factory) Creates a newGemFireCache
instance using the providedfactory
.protected abstract Object
createFactory
(Properties gemfireProperties) Constructs a new cache factory initialized with the given Apache GeodeProperties
used to construct, configure and initialize a newGemFireCache
.protected GemFireCache
Called ifAbstractBasicCacheFactoryBean.getCache()
returns a nullGemFireCache
reference fromAbstractBasicCacheFactoryBean.getObject()
.protected GemFireCache
init()
Initializes aGemFireCache
.protected Object
initializeFactory
(Object factory) Initializes the givenCacheFactory
orClientCacheFactory
with the configuredAbstractBasicCacheFactoryBean.CacheFactoryInitializer
.protected Object
postProcess
(Object factory) Post process the cache factory used to create theGemFireCache
.protected <T extends GemFireCache>
TpostProcess
(T cache) Post process theGemFireCache
by loading any cache.xml file, applying custom settings specified in SDG XML configuration metadata, and registering appropriate Transaction Listeners, Writer and JVM Heap configuration.protected <T extends GemFireCache>
TResolves aGemFireCache
by attempting to lookup an existingGemFireCache
instance in the JVM, first.Methods inherited from class org.springframework.data.gemfire.AbstractConfigurableCacheFactoryBean
afterPropertiesSet, destroy, getBeanFactoryLocator, getCacheXml, getOptionalBeanFactoryLocator, getOptionalCacheXml, getProperties, isCacheXmlPresent, isCacheXmlResolvableAsAFile, isUseBeanFactoryLocator, loadCacheXml, resolveProperties, setAndGetProperties, setBeanFactoryLocator, setCacheXml, setProperties, setUseBeanFactoryLocator
Methods inherited from class org.springframework.data.gemfire.AbstractBasicCacheFactoryBean
applyCacheConfigurers, close, configureHeapPercentages, configureOffHeapPercentages, configurePdx, doFetchCache, doGetObjectType, fetchCache, getCache, getCacheFactoryInitializer, getCopyOnRead, getCriticalHeapPercentage, getCriticalOffHeapPercentage, getEvictionHeapPercentage, getEvictionOffHeapPercentage, getObject, getObjectType, getOptionalCache, getPdxDiskStoreName, getPdxIgnoreUnreadFields, getPdxPersistent, getPdxReadSerialized, getPdxSerializer, getPhase, getTransactionListeners, getTransactionWriter, 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
-
AbstractResolvableCacheFactoryBean
public AbstractResolvableCacheFactoryBean()
-
-
Method Details
-
doGetObject
Description copied from class:AbstractBasicCacheFactoryBean
Called ifAbstractBasicCacheFactoryBean.getCache()
returns a nullGemFireCache
reference fromAbstractBasicCacheFactoryBean.getObject()
.- Specified by:
doGetObject
in classAbstractBasicCacheFactoryBean
- Returns:
- a new constructed, configured and initialized
GemFireCache
instance. - See Also:
-
init
Initializes aGemFireCache
.- Returns:
- a reference to the initialized
GemFireCache
. - See Also:
-
resolveCache
Resolves aGemFireCache
by attempting to lookup an existingGemFireCache
instance in the JVM, first. If an existingGemFireCache
could not be found, then this method proceeds in attempting to create a newGemFireCache
instance.- Type Parameters:
T
- parameterizedClass
type extendingGemFireCache
.- Returns:
- the resolved
GemFireCache
. - See Also:
-
createFactory
Constructs a new cache factory initialized with the given Apache GeodeProperties
used to construct, configure and initialize a newGemFireCache
.- Parameters:
gemfireProperties
-Properties
used by the cache factory to configure theGemFireCache
; must not be null- Returns:
- a new cache factory initialized with the given Apache Geode
Properties
. - See Also:
-
configureFactory
Configures the cache factory used to create theGemFireCache
.- Parameters:
factory
- cache factory to configure; must not be null.- Returns:
- the given cache factory.
- See Also:
-
initializeFactory
Description copied from class:AbstractBasicCacheFactoryBean
Initializes the givenCacheFactory
orClientCacheFactory
with the configuredAbstractBasicCacheFactoryBean.CacheFactoryInitializer
.- Overrides:
initializeFactory
in classAbstractBasicCacheFactoryBean
- Parameters:
factory
-CacheFactory
orClientCacheFactory
to initialize.- Returns:
- the initialized
CacheFactory
orClientCacheFactory
. - See Also:
-
postProcess
Post process the cache factory used to create theGemFireCache
.- Parameters:
factory
- cache factory to post process; must not be null.- Returns:
- the post processed cache factory.
- See Also:
-
createCache
Creates a newGemFireCache
instance using the providedfactory
.- Type Parameters:
T
-Subtype
ofGemFireCache
.- Parameters:
factory
- factory used to create theGemFireCache
.- Returns:
- a new instance of
GemFireCache
created by the providedfactory
. - See Also:
-
postProcess
Post process theGemFireCache
by loading any cache.xml file, applying custom settings specified in SDG XML configuration metadata, and registering appropriate Transaction Listeners, Writer and JVM Heap configuration.- Type Parameters:
T
- parameterizedClass
type extendingGemFireCache
.- Parameters:
cache
-GemFireCache
to post process.- Returns:
- the given
GemFireCache
. - See Also:
-
AbstractConfigurableCacheFactoryBean.loadCacheXml(GemFireCache)
GemFireCache.loadCacheXml(java.io.InputStream)
AbstractBasicCacheFactoryBean.configureHeapPercentages(org.apache.geode.cache.GemFireCache)
AbstractBasicCacheFactoryBean.configureOffHeapPercentages(GemFireCache)
AbstractBasicCacheFactoryBean.registerTransactionListeners(org.apache.geode.cache.GemFireCache)
AbstractBasicCacheFactoryBean.registerTransactionWriter(org.apache.geode.cache.GemFireCache)
-