Class BeanFactoryCacheResolver
java.lang.Object
org.springframework.data.gemfire.support.AbstractCachingCacheResolver<GemFireCache>
org.springframework.data.gemfire.support.BeanFactoryCacheResolver
- All Implemented Interfaces:
Supplier<GemFireCache>
,Aware
,BeanFactoryAware
,CacheResolver<GemFireCache>
public class BeanFactoryCacheResolver
extends AbstractCachingCacheResolver<GemFireCache>
implements BeanFactoryAware
Cacheable
CacheResolver
implementation capable of resolving a GemFireCache
instance
from the Spring BeanFactory
.- Since:
- 2.3.0
- Author:
- John Blum
- See Also:
-
Constructor Summary
ConstructorDescriptionBeanFactoryCacheResolver
(BeanFactory beanFactory) Constructs a new instance ofBeanFactoryCacheResolver
initialized with the given, required SpringBeanFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected GemFireCache
Uses the configured SpringBeanFactory
to resolve a reference to the singleGemFireCache
instance.protected 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
(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
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:
-
-
Method Details
-
setBeanFactory
Sets a reference to theBeanFactory
used to resolve theGemFireCache
.- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Parameters:
beanFactory
-BeanFactory
used to resolve theGemFireCache
.- Throws:
IllegalArgumentException
- ifBeanFactory
is null.BeansException
- if configuration of theBeanFactory
fails.- See Also:
-
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:
-
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
Uses the configured SpringBeanFactory
to resolve a reference to the singleGemFireCache
instance.- Specified by:
doResolve
in classAbstractCachingCacheResolver<GemFireCache>
- Returns:
- a reference to the
GemFireCache
bean. - See Also:
-