Class RepositoryCacheLoaderWriterSupport<T,ID>
java.lang.Object
org.springframework.geode.cache.support.RepositoryCacheLoaderWriterSupport<T,ID>
- All Implemented Interfaces:
org.apache.geode.cache.CacheCallback
,org.apache.geode.cache.CacheLoader<ID,
,T> org.apache.geode.cache.CacheWriter<ID,
,T> org.apache.geode.cache.Declarable
,org.springframework.beans.factory.Aware
,org.springframework.context.EnvironmentAware
,CacheLoaderSupport<ID,
,T> CacheWriterSupport<ID,
T>
- Direct Known Subclasses:
RepositoryCacheLoader
,RepositoryCacheWriter
public abstract class RepositoryCacheLoaderWriterSupport<T,ID>
extends Object
implements CacheLoaderSupport<ID,T>, CacheWriterSupport<ID,T>, org.springframework.context.EnvironmentAware
Abstract base class supporting the implementation of Apache Geode
CacheLoaders
and CacheWriters
backed by Spring Data Repositories
.- Since:
- 1.1.0
- See Also:
-
CacheLoader
CacheWriter
EnvironmentAware
Environment
CrudRepository
Repository
CacheLoaderSupport
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
RepositoryCacheLoaderWriterSupport
(org.springframework.data.repository.CrudRepository<T, ID> repository) -
Method Summary
Modifier and TypeMethodDescriptionprotected <S,
R> R doRepositoryOp
(S entity, Function<S, R> repositoryOperation) protected Optional<org.springframework.core.env.Environment>
protected boolean
protected abstract org.apache.geode.cache.CacheRuntimeException
newCacheRuntimeException
(Supplier<String> messageSupplier, Throwable cause) void
setEnvironment
(org.springframework.core.env.Environment environment) <U extends RepositoryCacheLoaderWriterSupport<T,
ID>>
Uwith
(org.springframework.core.env.Environment environment) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.geode.cache.support.CacheLoaderSupport
close
Methods inherited from interface org.springframework.geode.cache.support.CacheWriterSupport
beforeCreate, beforeDestroy, beforeRegionClear, beforeRegionDestroy, beforeUpdate
Methods inherited from interface org.apache.geode.cache.Declarable
init, initialize
-
Field Details
-
NUKE_AND_PAVE_PROPERTY
- See Also:
-
DATA_ACCESS_ERROR
- See Also:
-
-
Constructor Details
-
RepositoryCacheLoaderWriterSupport
-
-
Method Details
-
isNukeAndPaveEnabled
protected boolean isNukeAndPaveEnabled() -
setEnvironment
public void setEnvironment(@Nullable org.springframework.core.env.Environment environment) - Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
-
getEnvironment
-
getRepository
-
doRepositoryOp
-
load
-
newCacheRuntimeException
-
with
public <U extends RepositoryCacheLoaderWriterSupport<T,ID>> U with(org.springframework.core.env.Environment environment)
-