Class RepositoryCacheLoaderRegionConfigurer<T,ID>

java.lang.Object
org.springframework.geode.cache.RepositoryCacheLoaderRegionConfigurer<T,ID>
Type Parameters:
T - type of the persistent entity.
ID - type of the persistent entity identifier (ID).
All Implemented Interfaces:
org.springframework.core.Ordered, org.springframework.data.gemfire.config.annotation.RegionConfigurer, org.springframework.data.gemfire.config.annotation.support.Configurer<org.springframework.data.gemfire.client.ClientRegionFactoryBean<?,?>>

public class RepositoryCacheLoaderRegionConfigurer<T,ID> extends Object implements org.springframework.data.gemfire.config.annotation.RegionConfigurer
Spring Data RegionConfigurer implementation used to adapt and register a Spring Data CrudRepository as a CacheLoader for a targeted Region.
Since:
1.1.0
See Also:
  • Predicate
  • CacheLoader
  • Region
  • PeerRegionFactoryBean
  • ClientRegionFactoryBean
  • RegionConfigurer
  • CrudRepository
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    RepositoryCacheLoaderRegionConfigurer(org.springframework.data.repository.CrudRepository<T,ID> repository, Predicate<String> regionBeanName)
    Constructs a new instance of RepositoryCacheLoaderRegionConfigurer initialized with the given Spring Data CrudRepository used to load Region values on cache misses as well as the given Predicate used to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheLoader.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    configure(String beanName, org.springframework.data.gemfire.client.ClientRegionFactoryBean<?,?> bean)
     
    void
    configure(String beanName, org.springframework.data.gemfire.PeerRegionFactoryBean<?,?> bean)
     
    create(org.springframework.data.repository.CrudRepository<T,ID> repository, String regionBeanName)
    Factory method used to construct a new instance of RepositoryCacheLoaderRegionConfigurer initialized with the given Spring Data CrudRepository used to load Region values on cache misses as well as the given String identifying/qualifying the Region on which the CrudRepository will be registered and used as a CacheLoader.
    create(org.springframework.data.repository.CrudRepository<T,ID> repository, Predicate<String> regionBeanName)
    Factory method used to construct a new instance of RepositoryCacheLoaderRegionConfigurer initialized with the given Spring Data CrudRepository used to load Region values on cache misses as well as the given Predicate used to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheLoader.
    protected Predicate<String>
    Returns the configured Predicate used to identify/qualify the Region on which the CrudRepository will be registered as a CacheLoader for cache misses.
    protected org.springframework.data.repository.CrudRepository<T,ID>
    Returns the configured Spring Data CrudRepository adapted/wrapped as a CacheLoader and used to load Region values on cache misses.
    Constructs a new instance of RepositoryCacheLoader adapting the CrudRepository as an instance of a CacheLoader.

    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.config.annotation.support.Configurer

    getOrder
  • Constructor Details

    • RepositoryCacheLoaderRegionConfigurer

      public RepositoryCacheLoaderRegionConfigurer(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable Predicate<String> regionBeanName)
      Constructs a new instance of RepositoryCacheLoaderRegionConfigurer initialized with the given Spring Data CrudRepository used to load Region values on cache misses as well as the given Predicate used to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheLoader.
      Parameters:
      repository - CrudRepository used to load Region values on cache misses.
      regionBeanName - Predicate used to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheLoader.
      Throws:
      IllegalArgumentException - if CrudRepository is null.
      See Also:
  • Method Details

    • create

      public static <T, ID> RepositoryCacheLoaderRegionConfigurer<T,ID> create(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable Predicate<String> regionBeanName)
      Factory method used to construct a new instance of RepositoryCacheLoaderRegionConfigurer initialized with the given Spring Data CrudRepository used to load Region values on cache misses as well as the given Predicate used to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheLoader.
      Type Parameters:
      T - type of the persistent entity.
      ID - type of the persistent entity identifier (ID).
      Parameters:
      repository - CrudRepository used to load Region values on cache misses.
      regionBeanName - Predicate used to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheLoader.
      Returns:
      a new instance of RepositoryCacheLoaderRegionConfigurer.
      Throws:
      IllegalArgumentException - if CrudRepository is null.
      See Also:
    • create

      public static <T, ID> RepositoryCacheLoaderRegionConfigurer<T,ID> create(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable String regionBeanName)
      Factory method used to construct a new instance of RepositoryCacheLoaderRegionConfigurer initialized with the given Spring Data CrudRepository used to load Region values on cache misses as well as the given String identifying/qualifying the Region on which the CrudRepository will be registered and used as a CacheLoader.
      Type Parameters:
      T - type of the persistent entity.
      ID - type of the persistent entity identifier (ID).
      Parameters:
      repository - CrudRepository used to load Region values on cache misses.
      regionBeanName - String containing the bean name identifying/qualifying the Region on which the CrudRepository will be registered and used as a CacheLoader.
      Returns:
      a new instance of RepositoryCacheLoaderRegionConfigurer.
      Throws:
      IllegalArgumentException - if CrudRepository is null.
      See Also:
    • getRegionBeanName

      @NonNull protected Predicate<String> getRegionBeanName()
      Returns the configured Predicate used to identify/qualify the Region on which the CrudRepository will be registered as a CacheLoader for cache misses.
      Returns:
      the configured Predicate used to identify/qualify the Region targeted for the CacheLoader registration.
      See Also:
    • getRepository

      @NonNull protected org.springframework.data.repository.CrudRepository<T,ID> getRepository()
      Returns the configured Spring Data CrudRepository adapted/wrapped as a CacheLoader and used to load Region values on cache misses.
      Returns:
      the configured CrudRepository used to load Region values on cache misses.
      See Also:
      • CrudRepository
    • configure

      public void configure(String beanName, org.springframework.data.gemfire.client.ClientRegionFactoryBean<?,?> bean)
      Specified by:
      configure in interface org.springframework.data.gemfire.config.annotation.support.Configurer<T>
      Specified by:
      configure in interface org.springframework.data.gemfire.config.annotation.RegionConfigurer
    • configure

      public void configure(String beanName, org.springframework.data.gemfire.PeerRegionFactoryBean<?,?> bean)
      Specified by:
      configure in interface org.springframework.data.gemfire.config.annotation.RegionConfigurer
    • newRepositoryCacheLoader

      protected RepositoryCacheLoader newRepositoryCacheLoader()
      Constructs a new instance of RepositoryCacheLoader adapting the CrudRepository as an instance of a CacheLoader.
      Returns:
      a new RepositoryCacheLoader.
      See Also: