Class RepositoryCacheWriterRegionConfigurer<T,ID>

java.lang.Object
org.springframework.geode.cache.RepositoryCacheWriterRegionConfigurer<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 RepositoryCacheWriterRegionConfigurer<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 CacheWriter for a targeted Region.
Since:
1.1.0
See Also:
  • Predicate
  • CacheWriter
  • Region
  • PeerRegionFactoryBean
  • ClientRegionFactoryBean
  • RegionConfigurer
  • CrudRepository
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    RepositoryCacheWriterRegionConfigurer(org.springframework.data.repository.CrudRepository<T,ID> repository, Predicate<String> regionBeanName)
    Constructs a new instance of RepositoryCacheWriterRegionConfigurer initialized with the given Spring Data CrudRepository used to write Region values to a backend data source/data store along with a given Predicate to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheWriter.
  • 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 RepositoryCacheWriterRegionConfigurer initialized with the given Spring Data CrudRepository used to write Region values to a backend data source /data store along with a given Predicate to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheWriter.
    create(org.springframework.data.repository.CrudRepository<T,ID> repository, Predicate<String> regionBeanName)
    Factory method used to construct a new instance of RepositoryCacheWriterRegionConfigurer initialized with the given Spring Data CrudRepository used to write Region values to a backend data source /data store along with a given Predicate to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheWriter.
    protected Predicate<String>
    Returns the configured Predicate used to identify/qualify the Region on which the CrudRepository will be registered as a CacheWriter for write through.
    protected org.springframework.data.repository.CrudRepository<T,ID>
    Returns the configured Spring Data CrudRepository adapted/wrapped as a CacheWriter and used to write Region values to a backend data source/data store.
    Constructs a new instance of RepositoryCacheWriter adapting the CrudRepository as an instance of a CacheWriter.

    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

    • RepositoryCacheWriterRegionConfigurer

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

    • create

      public static <T, ID> RepositoryCacheWriterRegionConfigurer<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 RepositoryCacheWriterRegionConfigurer initialized with the given Spring Data CrudRepository used to write Region values to a backend data source /data store along with a given Predicate to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheWriter.
      Parameters:
      repository - CrudRepository used to write Region values to a backend data source.
      regionBeanName - Predicate used to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheWriter.
      Returns:
      a new instance of RepositoryCacheWriterRegionConfigurer.
      Throws:
      IllegalArgumentException - if CrudRepository is null.
      See Also:
    • create

      public static <T, ID> RepositoryCacheWriterRegionConfigurer<T,ID> create(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable String regionBeanName)
      Factory method used to construct a new instance of RepositoryCacheWriterRegionConfigurer initialized with the given Spring Data CrudRepository used to write Region values to a backend data source /data store along with a given Predicate to identify/qualify the Region on which the CrudRepository will be registered and used as a CacheWriter.
      Parameters:
      repository - CrudRepository used to write Region values to a backend data source.
      regionBeanName - String containing the bean name identifying/qualifying the Region on which the CrudRepository will be registered and used as a CacheWriter.
      Returns:
      a new instance of RepositoryCacheWriterRegionConfigurer.
      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 CacheWriter for write through.
      Returns:
      the configured Predicate used to identify/qualify the Region targeted for the CacheWriter registration.
      See Also:
    • getRepository

      @NonNull protected org.springframework.data.repository.CrudRepository<T,ID> getRepository()
      Returns the configured Spring Data CrudRepository adapted/wrapped as a CacheWriter and used to write Region values to a backend data source/data store.
      Returns:
      the configured CrudRepository used to write Region values to a backend data source.
      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
    • newRepositoryCacheWriter

      protected RepositoryCacheWriter newRepositoryCacheWriter()
      Constructs a new instance of RepositoryCacheWriter adapting the CrudRepository as an instance of a CacheWriter.
      Returns:
      a new RepositoryCacheWriter.
      See Also: