Spring Boot for VMware GemFire
Package org.springframework.geode.cache
Class RepositoryCacheLoaderRegionConfigurer<T,ID>
java.lang.Object
org.springframework.geode.cache.RepositoryCacheLoaderRegionConfigurer<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 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:
-
PredicateCacheLoaderRegionPeerRegionFactoryBeanClientRegionFactoryBeanRegionConfigurerCrudRepository
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryCacheLoaderRegionConfigurer(org.springframework.data.repository.CrudRepository<T, ID> repository, Predicate<String> regionBeanName) Constructs a new instance ofRepositoryCacheLoaderRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to loadRegionvalues on cache misses as well as the givenPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheLoader. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(String beanName, org.springframework.data.gemfire.client.ClientRegionFactoryBean<?, ?> bean) voidstatic <T,ID> RepositoryCacheLoaderRegionConfigurer<T, ID> Factory method used to construct a new instance ofRepositoryCacheLoaderRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to loadRegionvalues on cache misses as well as the givenStringidentifying/qualifying theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.static <T,ID> RepositoryCacheLoaderRegionConfigurer<T, ID> create(org.springframework.data.repository.CrudRepository<T, ID> repository, Predicate<String> regionBeanName) Factory method used to construct a new instance ofRepositoryCacheLoaderRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to loadRegionvalues on cache misses as well as the givenPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.Returns the configuredPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered as aCacheLoaderfor cache misses.Returns the configured Spring DataCrudRepositoryadapted/wrapped as aCacheLoaderand used to loadRegionvalues on cache misses.protected RepositoryCacheLoaderConstructs a new instance ofRepositoryCacheLoaderadapting theCrudRepositoryas an instance of aCacheLoader.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
-
RepositoryCacheLoaderRegionConfigurer
public RepositoryCacheLoaderRegionConfigurer(@NonNull org.springframework.data.repository.CrudRepository<T, ID> repository, @Nullable Predicate<String> regionBeanName) Constructs a new instance ofRepositoryCacheLoaderRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to loadRegionvalues on cache misses as well as the givenPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.- Parameters:
repository-CrudRepositoryused to loadRegionvalues on cache misses.regionBeanName-Predicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.- Throws:
IllegalArgumentException- ifCrudRepositoryis null.- See Also:
-
CrudRepositoryPredicate
-
-
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 ofRepositoryCacheLoaderRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to loadRegionvalues on cache misses as well as the givenPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.- Type Parameters:
T-typeof the persistent entity.ID-typeof the persistent entity identifier (ID).- Parameters:
repository-CrudRepositoryused to loadRegionvalues on cache misses.regionBeanName-Predicateused to identify/qualify theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.- Returns:
- a new instance of
RepositoryCacheLoaderRegionConfigurer. - Throws:
IllegalArgumentException- ifCrudRepositoryis 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 ofRepositoryCacheLoaderRegionConfigurerinitialized with the given Spring DataCrudRepositoryused to loadRegionvalues on cache misses as well as the givenStringidentifying/qualifying theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.- Type Parameters:
T-typeof the persistent entity.ID-typeof the persistent entity identifier (ID).- Parameters:
repository-CrudRepositoryused to loadRegionvalues on cache misses.regionBeanName-Stringcontaining the bean name identifying/qualifying theRegionon which theCrudRepositorywill be registered and used as aCacheLoader.- Returns:
- a new instance of
RepositoryCacheLoaderRegionConfigurer. - Throws:
IllegalArgumentException- ifCrudRepositoryis null.- See Also:
-
CrudRepositoryStringcreate(CrudRepository, Predicate)
-
getRegionBeanName
Returns the configuredPredicateused to identify/qualify theRegionon which theCrudRepositorywill be registered as aCacheLoaderfor cache misses. -
getRepository
Returns the configured Spring DataCrudRepositoryadapted/wrapped as aCacheLoaderand used to loadRegionvalues on cache misses.- Returns:
- the configured
CrudRepositoryused to loadRegionvalues on cache misses. - 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
-
newRepositoryCacheLoader
Constructs a new instance ofRepositoryCacheLoaderadapting theCrudRepositoryas an instance of aCacheLoader.- Returns:
- a new
RepositoryCacheLoader. - See Also:
-
RepositoryCacheLoaderCrudRepositoryCacheLoadergetRepository()
-