Spring Boot for VMware GemFire
Package org.springframework.geode.cache
Class RepositoryCacheWriterRegionConfigurer<T,ID>
java.lang.Object
org.springframework.geode.cache.RepositoryCacheWriterRegionConfigurer<T,ID>
- Type Parameters:
T-typeof the persistent entity.ID-typeof 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:
-
PredicateCacheWriterRegionPeerRegionFactoryBeanClientRegionFactoryBeanRegionConfigurerCrudRepository
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryCacheWriterRegionConfigurer(org.springframework.data.repository.CrudRepository<T, ID> repository, Predicate<String> regionBeanName) Constructs a new instance ofRepositoryCacheWriterRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to writeRegionvalues to a backend data source/data store along with a givenPredicateto identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(String beanName, org.springframework.data.gemfire.client.ClientRegionFactoryBean<?, ?> bean) voidstatic <T,ID> RepositoryCacheWriterRegionConfigurer<T, ID> Factory method used to construct a new instance ofRepositoryCacheWriterRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to writeRegionvalues to a backend data source /data store along with a givenPredicateto identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.static <T,ID> RepositoryCacheWriterRegionConfigurer<T, ID> create(org.springframework.data.repository.CrudRepository<T, ID> repository, Predicate<String> regionBeanName) Factory method used to construct a new instance ofRepositoryCacheWriterRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to writeRegionvalues to a backend data source /data store along with a givenPredicateto identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.Returns the configuredPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered as aCacheWriterfor write through.Returns the configured Spring DataCrudRepositoryadapted/wrapped as aCacheWriterand used to writeRegionvalues to a backend data source/data store.protected RepositoryCacheWriterConstructs a new instance ofRepositoryCacheWriteradapting theCrudRepositoryas an instance of aCacheWriter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 ofRepositoryCacheWriterRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to writeRegionvalues to a backend data source/data store along with a givenPredicateto identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.- Parameters:
repository-CrudRepositoryused to writeRegionvalues to a backend data source.regionBeanName-Predicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.- Throws:
IllegalArgumentException- ifCrudRepositoryis null.- See Also:
-
CrudRepositoryPredicate
-
-
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 ofRepositoryCacheWriterRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to writeRegionvalues to a backend data source /data store along with a givenPredicateto identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.- Parameters:
repository-CrudRepositoryused to writeRegionvalues to a backend data source.regionBeanName-Predicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.- Returns:
- a new instance of
RepositoryCacheWriterRegionConfigurer. - Throws:
IllegalArgumentException- ifCrudRepositoryis 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 ofRepositoryCacheWriterRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to writeRegionvalues to a backend data source /data store along with a givenPredicateto identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.- Parameters:
repository-CrudRepositoryused to writeRegionvalues to a backend data source.regionBeanName-Stringcontaining the bean name identifying/qualifying theRegionon which theCrudRepositorywill be registered and used as aCacheWriter.- Returns:
- a new instance of
RepositoryCacheWriterRegionConfigurer. - Throws:
IllegalArgumentException- ifCrudRepositoryis null.- See Also:
-
CrudRepositoryStringcreate(CrudRepository, Predicate)
-
getRegionBeanName
Returns the configuredPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered as aCacheWriterfor write through. -
getRepository
Returns the configured Spring DataCrudRepositoryadapted/wrapped as aCacheWriterand used to writeRegionvalues to a backend data source/data store.- Returns:
- the configured
CrudRepositoryused to writeRegionvalues to a backend data source. - See Also:
-
CrudRepository
-
configure
public void configure(String beanName, org.springframework.data.gemfire.client.ClientRegionFactoryBean<?, ?> bean) - Specified by:
configurein interfaceorg.springframework.data.gemfire.config.annotation.support.Configurer<T>- Specified by:
configurein interfaceorg.springframework.data.gemfire.config.annotation.RegionConfigurer
-
configure
public void configure(String beanName, org.springframework.data.gemfire.PeerRegionFactoryBean<?, ?> bean) - Specified by:
configurein interfaceorg.springframework.data.gemfire.config.annotation.RegionConfigurer
-
newRepositoryCacheWriter
Constructs a new instance ofRepositoryCacheWriteradapting theCrudRepositoryas an instance of aCacheWriter.- Returns:
- a new
RepositoryCacheWriter. - See Also:
-
RepositoryCacheWriterCrudRepositoryCacheWritergetRepository()
-