T
- type
of the persistent entity.ID
- type
of the persistent entity identifier (ID).public class RepositoryCacheWriterRegionConfigurer<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 CacheWriter
for a targeted Region
.Predicate
,
CacheWriter
,
Region
,
PeerRegionFactoryBean
,
ClientRegionFactoryBean
,
RegionConfigurer
,
CrudRepository
Constructor and Description |
---|
RepositoryCacheWriterRegionConfigurer(org.springframework.data.repository.CrudRepository<T,ID> repository,
java.util.function.Predicate<java.lang.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 . |
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> RepositoryCacheWriterRegionConfigurer<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
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 . |
static <T,ID> RepositoryCacheWriterRegionConfigurer<T,ID> |
create(org.springframework.data.repository.CrudRepository<T,ID> repository,
java.lang.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 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 CacheWriter for write through. |
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. |
protected RepositoryCacheWriter |
newRepositoryCacheWriter()
Constructs a new instance of
RepositoryCacheWriter adapting the CrudRepository
as an instance of a CacheWriter . |
public RepositoryCacheWriterRegionConfigurer(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable java.util.function.Predicate<java.lang.String> regionBeanName)
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
.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
.java.lang.IllegalArgumentException
- if CrudRepository
is null.CrudRepository
,
Predicate
public static <T,ID> RepositoryCacheWriterRegionConfigurer<T,ID> create(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable java.util.function.Predicate<java.lang.String> regionBeanName)
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
.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
.RepositoryCacheWriterRegionConfigurer
.java.lang.IllegalArgumentException
- if CrudRepository
is null.CrudRepository
,
Predicate
,
RepositoryCacheWriterRegionConfigurer(CrudRepository, Predicate)
public static <T,ID> RepositoryCacheWriterRegionConfigurer<T,ID> create(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository, @Nullable java.lang.String regionBeanName)
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
.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
.RepositoryCacheWriterRegionConfigurer
.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 CacheWriter
for write through.Predicate
used to identify/qualify the Region
targeted for the CacheWriter
registration.Predicate
@NonNull protected org.springframework.data.repository.CrudRepository<T,ID> getRepository()
CrudRepository
adapted/wrapped as a CacheWriter
and used to write Region
values to a backend data source/data store.CrudRepository
used to write Region
values to a backend data source.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 RepositoryCacheWriter newRepositoryCacheWriter()
RepositoryCacheWriter
adapting the CrudRepository
as an instance of a CacheWriter
.RepositoryCacheWriter
.RepositoryCacheWriter
,
CrudRepository
,
CacheWriter
,
getRepository()