T
- type
of the persistent entity.ID
- type
of the persistent entity identifier (ID).public class RepositoryCacheLoaderRegionConfigurer<T,ID>
extends java.lang.Object
implements org.springframework.data.gemfire.config.annotation.RegionConfigurer
RegionConfigurer
implementation used to adapt and register a Spring Data CrudRepository
as a CacheLoader
for a targeted Region
.Predicate
,
CacheLoader
,
Region
,
PeerRegionFactoryBean
,
ClientRegionFactoryBean
,
RegionConfigurer
,
CrudRepository
Constructor and Description |
---|
RepositoryCacheLoaderRegionConfigurer(org.springframework.data.repository.CrudRepository<T,ID> repository,
java.util.function.Predicate<java.lang.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 . |
Modifier and Type | Method and Description |
---|---|
void |
configure(java.lang.String beanName,
org.springframework.data.gemfire.client.ClientRegionFactoryBean<?,?> bean) |
void |
configure(java.lang.String beanName,
org.springframework.data.gemfire.PeerRegionFactoryBean<?,?> bean) |
static <T,ID> RepositoryCacheLoaderRegionConfigurer<T,ID> |
create(org.springframework.data.repository.CrudRepository<T,ID> repository,
java.util.function.Predicate<java.lang.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 . |
static <T,ID> RepositoryCacheLoaderRegionConfigurer<T,ID> |
create(org.springframework.data.repository.CrudRepository<T,ID> repository,
java.lang.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 . |
protected java.util.function.Predicate<java.lang.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. |
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. |
protected RepositoryCacheLoader |
newRepositoryCacheLoader()
Constructs a new instance of
RepositoryCacheLoader adapting the CrudRepository
as an instance of a CacheLoader . |
public RepositoryCacheLoaderRegionConfigurer(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable java.util.function.Predicate<java.lang.String> regionBeanName)
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
.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
.java.lang.IllegalArgumentException
- if CrudRepository
is null.CrudRepository
,
Predicate
public static <T,ID> RepositoryCacheLoaderRegionConfigurer<T,ID> create(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable java.util.function.Predicate<java.lang.String> regionBeanName)
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
.T
- type
of the persistent entity.ID
- type
of the persistent entity identifier (ID).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
.RepositoryCacheLoaderRegionConfigurer
.java.lang.IllegalArgumentException
- if CrudRepository
is null.CrudRepository
,
Predicate
,
RepositoryCacheLoaderRegionConfigurer(CrudRepository, Predicate)
public static <T,ID> RepositoryCacheLoaderRegionConfigurer<T,ID> create(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable java.lang.String regionBeanName)
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
.T
- type
of the persistent entity.ID
- type
of the persistent entity identifier (ID).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
.RepositoryCacheLoaderRegionConfigurer
.java.lang.IllegalArgumentException
- if CrudRepository
is null.CrudRepository
,
String
,
create(CrudRepository, Predicate)
@NonNull protected java.util.function.Predicate<java.lang.String> getRegionBeanName()
Predicate
used to identify/qualify the Region
on which the CrudRepository
will be registered as a CacheLoader
for cache misses.Predicate
used to identify/qualify the Region
targeted for the CacheLoader
registration.Predicate
@NonNull protected org.springframework.data.repository.CrudRepository<T,ID> getRepository()
CrudRepository
adapted/wrapped as a CacheLoader
and used to load Region
values on cache misses.CrudRepository
used to load Region
values on cache misses.CrudRepository
public void configure(java.lang.String beanName, org.springframework.data.gemfire.client.ClientRegionFactoryBean<?,?> bean)
configure
in interface org.springframework.data.gemfire.config.annotation.RegionConfigurer
configure
in interface org.springframework.data.gemfire.config.annotation.support.Configurer<org.springframework.data.gemfire.client.ClientRegionFactoryBean<?,?>>
public void configure(java.lang.String beanName, org.springframework.data.gemfire.PeerRegionFactoryBean<?,?> bean)
configure
in interface org.springframework.data.gemfire.config.annotation.RegionConfigurer
protected RepositoryCacheLoader newRepositoryCacheLoader()
RepositoryCacheLoader
adapting the CrudRepository
as an instance of a CacheLoader
.RepositoryCacheLoader
.RepositoryCacheLoader
,
CrudRepository
,
CacheLoader
,
getRepository()