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 Details

  • Constructor Details

    • RepositoryCacheLoaderWriterSupport

      protected RepositoryCacheLoaderWriterSupport(@NonNull org.springframework.data.repository.CrudRepository<T,ID> repository)
  • Method Details

    • isNukeAndPaveEnabled

      protected boolean isNukeAndPaveEnabled()
    • setEnvironment

      public void setEnvironment(@Nullable org.springframework.core.env.Environment environment)
      Specified by:
      setEnvironment in interface org.springframework.context.EnvironmentAware
    • getEnvironment

      protected Optional<org.springframework.core.env.Environment> getEnvironment()
    • getRepository

      @NonNull public org.springframework.data.repository.CrudRepository<T,ID> getRepository()
    • doRepositoryOp

      protected <S, R> R doRepositoryOp(S entity, Function<S,R> repositoryOperation)
    • load

      public T load(org.apache.geode.cache.LoaderHelper<ID,T> helper) throws org.apache.geode.cache.CacheLoaderException
      Specified by:
      load in interface org.apache.geode.cache.CacheLoader<T,ID>
      Throws:
      org.apache.geode.cache.CacheLoaderException
    • newCacheRuntimeException

      protected abstract org.apache.geode.cache.CacheRuntimeException newCacheRuntimeException(Supplier<String> messageSupplier, Throwable cause)
    • with

      public <U extends RepositoryCacheLoaderWriterSupport<T, ID>> U with(org.springframework.core.env.Environment environment)