Package org.springframework.geode.cache
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
ConstructorDescriptionRepositoryCacheWriterRegionConfigurer
(org.springframework.data.repository.CrudRepository<T, ID> repository, Predicate<String> regionBeanName) Constructs a new instance ofRepositoryCacheWriterRegionConfigurer
initialized with the given Spring DataCrudRepository
used to writeRegion
values to a backend data source/data store along with a givenPredicate
to identify/qualify theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(String beanName, org.springframework.data.gemfire.client.ClientRegionFactoryBean<?, ?> bean) void
static <T,
ID> RepositoryCacheWriterRegionConfigurer<T, ID> Factory method used to construct a new instance ofRepositoryCacheWriterRegionConfigurer
initialized with the given Spring DataCrudRepository
used to writeRegion
values to a backend data source /data store along with a givenPredicate
to identify/qualify theRegion
on which theCrudRepository
will 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 ofRepositoryCacheWriterRegionConfigurer
initialized with the given Spring DataCrudRepository
used to writeRegion
values to a backend data source /data store along with a givenPredicate
to identify/qualify theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
.Returns the configuredPredicate
used to identify/qualify theRegion
on which theCrudRepository
will be registered as aCacheWriter
for write through.Returns the configured Spring DataCrudRepository
adapted/wrapped as aCacheWriter
and used to writeRegion
values to a backend data source/data store.protected RepositoryCacheWriter
Constructs a new instance ofRepositoryCacheWriter
adapting theCrudRepository
as an instance of aCacheWriter
.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 ofRepositoryCacheWriterRegionConfigurer
initialized with the given Spring DataCrudRepository
used to writeRegion
values to a backend data source/data store along with a givenPredicate
to identify/qualify theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
.- Parameters:
repository
-CrudRepository
used to writeRegion
values to a backend data source.regionBeanName
-Predicate
used to identify/qualify theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
.- Throws:
IllegalArgumentException
- ifCrudRepository
is null.- See Also:
-
CrudRepository
Predicate
-
-
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 ofRepositoryCacheWriterRegionConfigurer
initialized with the given Spring DataCrudRepository
used to writeRegion
values to a backend data source /data store along with a givenPredicate
to identify/qualify theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
.- Parameters:
repository
-CrudRepository
used to writeRegion
values to a backend data source.regionBeanName
-Predicate
used to identify/qualify theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
.- Returns:
- a new instance of
RepositoryCacheWriterRegionConfigurer
. - Throws:
IllegalArgumentException
- ifCrudRepository
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 ofRepositoryCacheWriterRegionConfigurer
initialized with the given Spring DataCrudRepository
used to writeRegion
values to a backend data source /data store along with a givenPredicate
to identify/qualify theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
.- Parameters:
repository
-CrudRepository
used to writeRegion
values to a backend data source.regionBeanName
-String
containing the bean name identifying/qualifying theRegion
on which theCrudRepository
will be registered and used as aCacheWriter
.- Returns:
- a new instance of
RepositoryCacheWriterRegionConfigurer
. - Throws:
IllegalArgumentException
- ifCrudRepository
is null.- See Also:
-
CrudRepository
String
create(CrudRepository, Predicate)
-
getRegionBeanName
Returns the configuredPredicate
used to identify/qualify theRegion
on which theCrudRepository
will be registered as aCacheWriter
for write through. -
getRepository
Returns the configured Spring DataCrudRepository
adapted/wrapped as aCacheWriter
and used to writeRegion
values to a backend data source/data store.- Returns:
- the configured
CrudRepository
used to writeRegion
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 interfaceorg.springframework.data.gemfire.config.annotation.support.Configurer<T>
- Specified by:
configure
in interfaceorg.springframework.data.gemfire.config.annotation.RegionConfigurer
-
configure
public void configure(String beanName, org.springframework.data.gemfire.PeerRegionFactoryBean<?, ?> bean) - Specified by:
configure
in interfaceorg.springframework.data.gemfire.config.annotation.RegionConfigurer
-
newRepositoryCacheWriter
Constructs a new instance ofRepositoryCacheWriter
adapting theCrudRepository
as an instance of aCacheWriter
.- Returns:
- a new
RepositoryCacheWriter
. - See Also:
-
RepositoryCacheWriter
CrudRepository
CacheWriter
getRepository()
-