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:
-
GemFireCache
BeanFactory
BeanFactoryAware
CacheResolver
AbstractCachingCacheResolver
-
Constructor Summary
ConstructorDescriptionBeanFactoryCacheResolver
(org.springframework.beans.factory.BeanFactory beanFactory) Constructs a new instance ofBeanFactoryCacheResolver
initialized with the given, required SpringBeanFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.geode.cache.GemFireCache
Uses the configured SpringBeanFactory
to resolve a reference to the singleGemFireCache
instance.protected org.springframework.beans.factory.BeanFactory
Returns the configured reference to the SpringBeanFactory
used to resolve the single instance of theGemFireCache
.Returns the optionally configuredbean name
used to further qualify the resolution of theGemFireCache
object reference in a Spring context.final void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) Sets a reference to theBeanFactory
used to resolve theGemFireCache
.void
setCacheBeanName
(String cacheBeanName) Sets (configures) thebean name
used to further qualify the resolution of theGemFireCache
object reference in a Spring context.Methods inherited from class org.springframework.data.gemfire.support.AbstractCachingCacheResolver
resolve
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.gemfire.CacheResolver
get
-
Constructor Details
-
BeanFactoryCacheResolver
public BeanFactoryCacheResolver(org.springframework.beans.factory.BeanFactory beanFactory) Constructs a new instance ofBeanFactoryCacheResolver
initialized with the given, required SpringBeanFactory
.- Parameters:
beanFactory
-BeanFactory
used to resolve theGemFireCache
.- Throws:
IllegalArgumentException
- ifBeanFactory
is 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 theBeanFactory
used to resolve theGemFireCache
.- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Parameters:
beanFactory
-BeanFactory
used to resolve theGemFireCache
.- Throws:
IllegalArgumentException
- ifBeanFactory
is null.org.springframework.beans.BeansException
- if configuration of theBeanFactory
fails.- See Also:
-
BeanFactory
-
getBeanFactory
@NonNull protected org.springframework.beans.factory.BeanFactory getBeanFactory()Returns the configured reference to the SpringBeanFactory
used to resolve the single instance of theGemFireCache
.- Returns:
- a reference to the configured Spring
BeanFactory
. - See Also:
-
BeanFactory
-
setCacheBeanName
Sets (configures) thebean name
used to further qualify the resolution of theGemFireCache
object reference in a Spring context.- Parameters:
cacheBeanName
-name
of theGemFireCache
bean in the Spring context.
-
getCacheBeanName
Returns the optionally configuredbean name
used to further qualify the resolution of theGemFireCache
object reference in a Spring context.- Returns:
- the configured
name
of theGemFireCache
bean in the Spring context.
-
doResolve
protected org.apache.geode.cache.GemFireCache doResolve()Uses the configured SpringBeanFactory
to resolve a reference to the singleGemFireCache
instance.- Specified by:
doResolve
in classAbstractCachingCacheResolver<org.apache.geode.cache.GemFireCache>
- Returns:
- a reference to the
GemFireCache
bean. - See Also:
-
BeanFactory.getBean(Class)
GemFireCache
getBeanFactory()
-