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:
  • Constructor Summary

    Constructors
    Constructor
    Description
    BeanFactoryCacheResolver(org.springframework.beans.factory.BeanFactory beanFactory)
    Constructs a new instance of BeanFactoryCacheResolver initialized with the given, required Spring BeanFactory.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.geode.cache.GemFireCache
    Uses the configured Spring BeanFactory to resolve a reference to the single GemFireCache instance.
    protected org.springframework.beans.factory.BeanFactory
    Returns the configured reference to the Spring BeanFactory used to resolve the single instance of the GemFireCache.
    Returns the optionally configured bean name used to further qualify the resolution of the GemFireCache object reference in a Spring context.
    final void
    setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
    Sets a reference to the BeanFactory used to resolve the GemFireCache.
    void
    setCacheBeanName(String cacheBeanName)
    Sets (configures) the bean name used to further qualify the resolution of the GemFireCache 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 of BeanFactoryCacheResolver initialized with the given, required Spring BeanFactory.
      Parameters:
      beanFactory - BeanFactory used to resolve the GemFireCache.
      Throws:
      IllegalArgumentException - if BeanFactory 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 the BeanFactory used to resolve the GemFireCache.
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Parameters:
      beanFactory - BeanFactory used to resolve the GemFireCache.
      Throws:
      IllegalArgumentException - if BeanFactory is null.
      org.springframework.beans.BeansException - if configuration of the BeanFactory fails.
      See Also:
      • BeanFactory
    • getBeanFactory

      @NonNull protected org.springframework.beans.factory.BeanFactory getBeanFactory()
      Returns the configured reference to the Spring BeanFactory used to resolve the single instance of the GemFireCache.
      Returns:
      a reference to the configured Spring BeanFactory.
      See Also:
      • BeanFactory
    • setCacheBeanName

      public void setCacheBeanName(String cacheBeanName)
      Sets (configures) the bean name used to further qualify the resolution of the GemFireCache object reference in a Spring context.
      Parameters:
      cacheBeanName - name of the GemFireCache bean in the Spring context.
    • getCacheBeanName

      public Optional<String> getCacheBeanName()
      Returns the optionally configured bean name used to further qualify the resolution of the GemFireCache object reference in a Spring context.
      Returns:
      the configured name of the GemFireCache bean in the Spring context.
    • doResolve

      protected org.apache.geode.cache.GemFireCache doResolve()
      Uses the configured Spring BeanFactory to resolve a reference to the single GemFireCache instance.
      Specified by:
      doResolve in class AbstractCachingCacheResolver<org.apache.geode.cache.GemFireCache>
      Returns:
      a reference to the GemFireCache bean.
      See Also: