Spring Data for VMware GemFire
Class BeanFactoryCacheResolver
java.lang.Object
org.springframework.data.gemfire.support.AbstractCachingCacheResolver<org.apache.geode.cache.GemFireCache>
org.springframework.data.gemfire.support.BeanFactoryCacheResolver
- All Implemented Interfaces:
Supplier<org.apache.geode.cache.GemFireCache>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,CacheResolver<org.apache.geode.cache.GemFireCache>
public class BeanFactoryCacheResolver
extends AbstractCachingCacheResolver<org.apache.geode.cache.GemFireCache>
implements org.springframework.beans.factory.BeanFactoryAware
Cacheable
CacheResolver implementation capable of resolving a GemFireCache instance
from the Spring BeanFactory.- Since:
- 2.3.0
- See Also:
-
GemFireCacheBeanFactoryBeanFactoryAwareCacheResolverAbstractCachingCacheResolver
-
Constructor Summary
ConstructorsConstructorDescriptionBeanFactoryCacheResolver(org.springframework.beans.factory.BeanFactory beanFactory) Constructs a new instance ofBeanFactoryCacheResolverinitialized with the given, required SpringBeanFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.geode.cache.GemFireCacheUses the configured SpringBeanFactoryto resolve a reference to the singleGemFireCacheinstance.protected org.springframework.beans.factory.BeanFactoryReturns the configured reference to the SpringBeanFactoryused to resolve the single instance of theGemFireCache.Returns the optionally configuredbean nameused to further qualify the resolution of theGemFireCacheobject reference in a Spring context.final voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Sets a reference to theBeanFactoryused to resolve theGemFireCache.voidsetCacheBeanName(String cacheBeanName) Sets (configures) thebean nameused to further qualify the resolution of theGemFireCacheobject reference in a Spring context.Methods inherited from class org.springframework.data.gemfire.support.AbstractCachingCacheResolver
resolveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.gemfire.CacheResolver
get
-
Constructor Details
-
BeanFactoryCacheResolver
public BeanFactoryCacheResolver(org.springframework.beans.factory.BeanFactory beanFactory) Constructs a new instance ofBeanFactoryCacheResolverinitialized with the given, required SpringBeanFactory.- Parameters:
beanFactory-BeanFactoryused to resolve theGemFireCache.- Throws:
IllegalArgumentException- ifBeanFactoryis null.- See Also:
-
BeanFactory
-
-
Method Details
-
setBeanFactory
public final void setBeanFactory(@NonNull org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException Sets a reference to theBeanFactoryused to resolve theGemFireCache.- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Parameters:
beanFactory-BeanFactoryused to resolve theGemFireCache.- Throws:
IllegalArgumentException- ifBeanFactoryis null.org.springframework.beans.BeansException- if configuration of theBeanFactoryfails.- See Also:
-
BeanFactory
-
getBeanFactory
@NonNull protected org.springframework.beans.factory.BeanFactory getBeanFactory()Returns the configured reference to the SpringBeanFactoryused to resolve the single instance of theGemFireCache.- Returns:
- a reference to the configured Spring
BeanFactory. - See Also:
-
BeanFactory
-
setCacheBeanName
Sets (configures) thebean nameused to further qualify the resolution of theGemFireCacheobject reference in a Spring context.- Parameters:
cacheBeanName-nameof theGemFireCachebean in the Spring context.
-
getCacheBeanName
Returns the optionally configuredbean nameused to further qualify the resolution of theGemFireCacheobject reference in a Spring context.- Returns:
- the configured
nameof theGemFireCachebean in the Spring context.
-
doResolve
protected org.apache.geode.cache.GemFireCache doResolve()Uses the configured SpringBeanFactoryto resolve a reference to the singleGemFireCacheinstance.- Specified by:
doResolvein classAbstractCachingCacheResolver<org.apache.geode.cache.GemFireCache>- Returns:
- a reference to the
GemFireCachebean. - See Also:
-
BeanFactory.getBean(Class)GemFireCachegetBeanFactory()
-