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

    • SmartCacheResolverFactoryBean

      public SmartCacheResolverFactoryBean()
  • Method Details

    • create

      @NonNull public static SmartCacheResolverFactoryBean create()
      Factory method used to construct a new instance of the SmartCacheResolverFactoryBean.
      Returns:
      a new instance of SmartCacheResolverFactoryBean.
      See Also:
    • afterPropertiesSet

      public void afterPropertiesSet()
      Initializes the CacheResolver [composition] created by this FactoryBean.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      See Also:
    • getObject

      @NonNull public CacheResolver<org.apache.geode.cache.GemFireCache> getObject()
      Returns the fully constructed and initialized instance of the CacheResolver created by this FactoryBean. If the afterPropertiesSet() method has not yet been called, then this method returns a Proxy to the CacheResolver instance that will eventually be created by this FactoryBean.
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<CacheResolver<org.apache.geode.cache.GemFireCache>>
      Returns:
      the CacheResolver instance constructed and initialized by this FactoryBean.
      See Also:
      • FactoryBean.getObject()
      • SmartCacheResolverFactoryBean.CacheResolverProxy
    • getObjectType

      @Nullable public Class<?> getObjectType()
      Returns the type of the CacheResolver returned by this FactoryBean.
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<CacheResolver<org.apache.geode.cache.GemFireCache>>
      Returns:
      the type of the CacheResolver returned by this FactoryBean.
      See Also:
      • FactoryBean.getObjectType()
      • Class
    • newBeanFactoryCacheResolver

      @Nullable protected CacheResolver newBeanFactoryCacheResolver()
      Constructs a CacheResolver capable of resolving a cache instance from the Spring BeanFactory. Returns null if the BeanFactory reference is null (i.e. not configured).
      Returns:
      a CacheResolver capable of resolving a cache instance from the Spring BeanFactory.
      See Also:
    • newClientCacheFactoryCacheResolver

      @NonNull protected CacheResolver newClientCacheFactoryCacheResolver()
      Constructs a CacheResolver capable of resolving a ClientCache instance using the Apache Geode ClientCacheFactory API.
      Returns:
      a CacheResolver resolving a ClientCache instance.
      See Also:
    • newPeerCacheFactoryCacheResolver

      @NonNull protected CacheResolver newPeerCacheFactoryCacheResolver()
      Constructs a CacheResolver capable of resolving a peer Cache instance using the Apache Geode CacheFactory API.
      Returns:
      a CacheResolver resolving a peer Cache instance.
      See Also:
    • newSingleCacheCacheResolver

      @Nullable protected CacheResolver newSingleCacheCacheResolver()
      Constructs a CacheResolver capable of resolving a single, configured cache instance. Returns null if a cache instance was not configured on this FactoryBean.
      Returns:
      a CacheResolver capable of resolving a single, configured cache instance.
      See Also:
    • setCache

      public final void setCache(@Nullable org.apache.geode.cache.GemFireCache cache)
    • getCache

      protected Optional<org.apache.geode.cache.GemFireCache> getCache()
    • setCacheBeanName

      public final void setCacheBeanName(@Nullable String cacheBeanName)
    • getCacheBeanName

      protected Optional<String> 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

      protected List<CacheResolver> getConfiguredCacheResolvers()
    • withCache

      public SmartCacheResolverFactoryBean withCache(org.apache.geode.cache.GemFireCache cache)
    • withCacheBeanName

      public SmartCacheResolverFactoryBean withCacheBeanName(String cacheBeanName)
    • usingCompositionStrategy

      public SmartCacheResolverFactoryBean usingCompositionStrategy(org.springframework.data.gemfire.support.SmartCacheResolverFactoryBean.CompositionStrategy compositionStrategy)