Class RepositoryCacheWriter<T,ID>

java.lang.Object
org.springframework.geode.cache.support.RepositoryCacheLoaderWriterSupport<T,ID>
org.springframework.geode.cache.RepositoryCacheWriter<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>

public class RepositoryCacheWriter<T,ID> extends RepositoryCacheLoaderWriterSupport<T,ID>
A CacheWriter implementation backed by a Spring Data CrudRepository used to persist a cache entry (i.e. entity) to a backend, external data source.
Since:
1.1.0
See Also:
  • Constructor Details

    • RepositoryCacheWriter

      public RepositoryCacheWriter(org.springframework.data.repository.CrudRepository<T,ID> repository)
  • Method Details

    • beforeCreate

      public void beforeCreate(org.apache.geode.cache.EntryEvent<ID,T> event) throws org.apache.geode.cache.CacheWriterException
      Throws:
      org.apache.geode.cache.CacheWriterException
    • beforeUpdate

      public void beforeUpdate(org.apache.geode.cache.EntryEvent<ID,T> event) throws org.apache.geode.cache.CacheWriterException
      Throws:
      org.apache.geode.cache.CacheWriterException
    • beforeDestroy

      public void beforeDestroy(org.apache.geode.cache.EntryEvent<ID,T> event) throws org.apache.geode.cache.CacheWriterException
      Throws:
      org.apache.geode.cache.CacheWriterException
    • beforeRegionClear

      public void beforeRegionClear(org.apache.geode.cache.RegionEvent<ID,T> event) throws org.apache.geode.cache.CacheWriterException
      Throws:
      org.apache.geode.cache.CacheWriterException
    • beforeRegionDestroy

      public void beforeRegionDestroy(org.apache.geode.cache.RegionEvent<ID,T> event) throws org.apache.geode.cache.CacheWriterException
      Throws:
      org.apache.geode.cache.CacheWriterException
    • newCacheRuntimeException

      protected org.apache.geode.cache.CacheRuntimeException newCacheRuntimeException(Supplier<String> messageSupplier, Throwable cause)
      Specified by:
      newCacheRuntimeException in class RepositoryCacheLoaderWriterSupport<T,ID>