public abstract class RepositoryCacheLoaderWriterSupport<T,ID> extends java.lang.Object implements CacheLoaderSupport<ID,T>, CacheWriterSupport<ID,T>, org.springframework.context.EnvironmentAware
CacheLoaders
and CacheWriters
backed by Spring Data Repositories
.CacheLoader
,
CacheWriter
,
EnvironmentAware
,
Environment
,
CrudRepository
,
Repository
,
CacheLoaderSupport
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DATA_ACCESS_ERROR |
static java.lang.String |
NUKE_AND_PAVE_PROPERTY |
Modifier | Constructor and Description |
---|---|
protected |
RepositoryCacheLoaderWriterSupport(org.springframework.data.repository.CrudRepository<T,ID> repository) |
Modifier and Type | Method and Description |
---|---|
protected <S,R> R |
doRepositoryOp(S entity,
java.util.function.Function<S,R> repositoryOperation) |
protected java.util.Optional<org.springframework.core.env.Environment> |
getEnvironment() |
org.springframework.data.repository.CrudRepository<T,ID> |
getRepository() |
protected boolean |
isNukeAndPaveEnabled() |
T |
load(org.apache.geode.cache.LoaderHelper<ID,T> helper) |
protected abstract org.apache.geode.cache.CacheRuntimeException |
newCacheRuntimeException(java.util.function.Supplier<java.lang.String> messageSupplier,
java.lang.Throwable cause) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
<U extends RepositoryCacheLoaderWriterSupport<T,ID>> |
with(org.springframework.core.env.Environment environment) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
beforeCreate, beforeDestroy, beforeRegionClear, beforeRegionDestroy, beforeUpdate
public static final java.lang.String NUKE_AND_PAVE_PROPERTY
protected static final java.lang.String DATA_ACCESS_ERROR
protected boolean isNukeAndPaveEnabled()
public void setEnvironment(@Nullable org.springframework.core.env.Environment environment)
setEnvironment
in interface org.springframework.context.EnvironmentAware
protected java.util.Optional<org.springframework.core.env.Environment> getEnvironment()
@NonNull public org.springframework.data.repository.CrudRepository<T,ID> getRepository()
protected <S,R> R doRepositoryOp(S entity, java.util.function.Function<S,R> repositoryOperation)
public T load(org.apache.geode.cache.LoaderHelper<ID,T> helper) throws org.apache.geode.cache.CacheLoaderException
protected abstract org.apache.geode.cache.CacheRuntimeException newCacheRuntimeException(java.util.function.Supplier<java.lang.String> messageSupplier, java.lang.Throwable cause)
public <U extends RepositoryCacheLoaderWriterSupport<T,ID>> U with(org.springframework.core.env.Environment environment)