Class SmartCacheResolverFactoryBean
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<CacheResolver<org.apache.geode.cache.GemFireCache>>
org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean
- 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.FactoryBean<CacheResolver<org.apache.geode.cache.GemFireCache>>
,org.springframework.beans.factory.InitializingBean
public class SmartCacheResolverFactoryBean
extends AbstractFactoryBeanSupport<CacheResolver<org.apache.geode.cache.GemFireCache>>
implements org.springframework.beans.factory.InitializingBean
Spring
FactoryBean
used to construct a custom, determined CacheResolver
that strategically
and lazily resolves a cache instance.- Since:
- 2.3.0
- See Also:
-
Cache
GemFireCache
ClientCache
BeanFactory
FactoryBean
InitializingBean
CacheResolver
AbstractFactoryBeanSupport
-
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 theCacheResolver
[composition] created by thisFactoryBean
.create()
Factory method used to construct a new instance of theSmartCacheResolverFactoryBean
.protected Optional<org.apache.geode.cache.GemFireCache>
getCache()
protected org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy
protected List<CacheResolver>
CacheResolver<org.apache.geode.cache.GemFireCache>
Returns the fully constructed and initialized instance of theCacheResolver
created by thisFactoryBean
.Class<?>
protected CacheResolver
Constructs aCacheResolver
capable of resolving a cache instance from the SpringBeanFactory
.protected CacheResolver
Constructs aCacheResolver
capable of resolving aClientCache
instance using the Apache GeodeClientCacheFactory
API.protected CacheResolver
Constructs aCacheResolver
capable of resolving a peerCache
instance using the Apache GeodeCacheFactory
API.protected CacheResolver
Constructs aCacheResolver
capable of resolving a single, configured cache instance.final void
setCache
(org.apache.geode.cache.GemFireCache cache) final void
setCacheBeanName
(String cacheBeanName) final void
setCompositionStrategy
(org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy compositionStrategy) final void
setConfiguredCacheResolvers
(List<CacheResolver> cacheResolvers) usingCompositionStrategy
(org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy compositionStrategy) withCache
(org.apache.geode.cache.GemFireCache cache) withCacheBeanName
(String cacheBeanName) 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
-
SmartCacheResolverFactoryBean
public SmartCacheResolverFactoryBean()
-
-
Method Details
-
create
Factory method used to construct a new instance of theSmartCacheResolverFactoryBean
.- Returns:
- a new instance of
SmartCacheResolverFactoryBean
. - See Also:
-
afterPropertiesSet
public void afterPropertiesSet()Initializes theCacheResolver
[composition] created by thisFactoryBean
.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- See Also:
-
SmartCacheResolverFactoryBean.CompositionStrategy.use(SmartCacheResolverFactoryBean)
getCompositionStrategy()
-
getObject
Returns the fully constructed and initialized instance of theCacheResolver
created by thisFactoryBean
. If theafterPropertiesSet()
method has not yet been called, then this method returns a Proxy to theCacheResolver
instance that will eventually be created by thisFactoryBean
.- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<CacheResolver<org.apache.geode.cache.GemFireCache>>
- Returns:
- the
CacheResolver
instance constructed and initialized by thisFactoryBean
. - See Also:
-
FactoryBean.getObject()
SmartCacheResolverFactoryBean.CacheResolverProxy
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<CacheResolver<org.apache.geode.cache.GemFireCache>>
- Returns:
- the
type
of theCacheResolver
returned by thisFactoryBean
. - See Also:
-
FactoryBean.getObjectType()
Class
-
newBeanFactoryCacheResolver
Constructs aCacheResolver
capable of resolving a cache instance from the SpringBeanFactory
. Returns null if theBeanFactory
reference is null (i.e. not configured).- Returns:
- a
CacheResolver
capable of resolving a cache instance from the SpringBeanFactory
. - See Also:
-
newClientCacheFactoryCacheResolver
Constructs aCacheResolver
capable of resolving aClientCache
instance using the Apache GeodeClientCacheFactory
API.- Returns:
- a
CacheResolver
resolving aClientCache
instance. - See Also:
-
newPeerCacheFactoryCacheResolver
Constructs aCacheResolver
capable of resolving a peerCache
instance using the Apache GeodeCacheFactory
API.- Returns:
- a
CacheResolver
resolving a peerCache
instance. - See Also:
-
newSingleCacheCacheResolver
Constructs aCacheResolver
capable of resolving a single, configured cache instance. Returns null if a cache instance was notconfigured
on thisFactoryBean
.- Returns:
- a
CacheResolver
capable of resolving a single, configured cache instance. - See Also:
-
setCache
public final void setCache(@Nullable org.apache.geode.cache.GemFireCache cache) -
getCache
-
setCacheBeanName
-
getCacheBeanName
-
setCompositionStrategy
public final void setCompositionStrategy(org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy compositionStrategy) -
getCompositionStrategy
protected org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy getCompositionStrategy() -
setConfiguredCacheResolvers
@Autowired(required=false) public final void setConfiguredCacheResolvers(List<CacheResolver> cacheResolvers) -
getConfiguredCacheResolvers
-
withCache
-
withCacheBeanName
-
usingCompositionStrategy
public SmartCacheResolverFactoryBean usingCompositionStrategy(org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy compositionStrategy)
-