Spring Data for VMware GemFire
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:
-
CacheGemFireCacheClientCacheBeanFactoryFactoryBeanInitializingBeanCacheResolverAbstractFactoryBeanSupport
-
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 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.CompositionStrategyprotected List<CacheResolver>CacheResolver<org.apache.geode.cache.GemFireCache>Returns the fully constructed and initialized instance of theCacheResolvercreated by thisFactoryBean.Class<?>protected CacheResolverConstructs aCacheResolvercapable of resolving a cache instance from the SpringBeanFactory.protected CacheResolverConstructs aCacheResolvercapable of resolving aClientCacheinstance using the Apache GeodeClientCacheFactoryAPI.protected CacheResolverConstructs aCacheResolvercapable of resolving a peerCacheinstance using the Apache GeodeCacheFactoryAPI.protected CacheResolverConstructs aCacheResolvercapable of resolving a single, configured cache instance.final voidsetCache(org.apache.geode.cache.GemFireCache cache) final voidsetCacheBeanName(String cacheBeanName) final voidsetCompositionStrategy(org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy compositionStrategy) final voidsetConfiguredCacheResolvers(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:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- See Also:
-
SmartCacheResolverFactoryBean.CompositionStrategy.use(SmartCacheResolverFactoryBean)getCompositionStrategy()
-
getObject
Returns the fully constructed and initialized instance of theCacheResolvercreated by thisFactoryBean. If theafterPropertiesSet()method has not yet been called, then this method returns a Proxy to theCacheResolverinstance that will eventually be created by thisFactoryBean.- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<CacheResolver<org.apache.geode.cache.GemFireCache>>- Returns:
- the
CacheResolverinstance constructed and initialized by thisFactoryBean. - See Also:
-
FactoryBean.getObject()SmartCacheResolverFactoryBean.CacheResolverProxy
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<CacheResolver<org.apache.geode.cache.GemFireCache>>- Returns:
- the
typeof theCacheResolverreturned by thisFactoryBean. - See Also:
-
FactoryBean.getObjectType()Class
-
newBeanFactoryCacheResolver
Constructs aCacheResolvercapable of resolving a cache instance from the SpringBeanFactory. Returns null if theBeanFactoryreference is null (i.e. not configured).- Returns:
- a
CacheResolvercapable of resolving a cache instance from the SpringBeanFactory. - See Also:
-
newClientCacheFactoryCacheResolver
Constructs aCacheResolvercapable of resolving aClientCacheinstance using the Apache GeodeClientCacheFactoryAPI.- Returns:
- a
CacheResolverresolving aClientCacheinstance. - See Also:
-
newPeerCacheFactoryCacheResolver
Constructs aCacheResolvercapable of resolving a peerCacheinstance using the Apache GeodeCacheFactoryAPI.- Returns:
- a
CacheResolverresolving a peerCacheinstance. - See Also:
-
newSingleCacheCacheResolver
Constructs aCacheResolvercapable of resolving a single, configured cache instance. Returns null if a cache instance was notconfiguredon thisFactoryBean.- Returns:
- a
CacheResolvercapable 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)
-