Package org.ehcache.spi.loaderwriter
Interface WriteBehindProvider
- All Superinterfaces:
Service
A
Service that provides write-behind functionality.
A CacheManager will use the {Consumer, @link #createWriteBehindLoaderWriter(org.ehcache.spi.loaderwriter.CacheLoaderWriter, org.ehcache.spi.loaderwriter.WriteBehindConfiguration)}
method to create write-behind instances for each Cache it manages
that carries a write-behind configuration.
-
Method Summary
Modifier and TypeMethodDescription<K,V> CacheLoaderWriter<K, V> createWriteBehindLoaderWriter(Consumer<K> keyCleanUpMethod, CacheLoaderWriter<K, V> cacheLoaderWriter, WriteBehindConfiguration<?> configuration) Creates write-behind decoratedCacheLoaderWriteraccording to the given configuration.voidreleaseWriteBehindLoaderWriter(CacheLoaderWriter<?, ?> cacheLoaderWriter) Releases a write-behind decorator when the associatedCacheis finished with it.
-
Method Details
-
createWriteBehindLoaderWriter
<K,V> CacheLoaderWriter<K,V> createWriteBehindLoaderWriter(Consumer<K> keyCleanUpMethod, CacheLoaderWriter<K, V> cacheLoaderWriter, WriteBehindConfiguration<?> configuration) Creates write-behind decoratedCacheLoaderWriteraccording to the given configuration.- Type Parameters:
K- the key type for the loader writerV- the value type for the loader writer- Parameters:
keyCleanUpMethod- cleanup Method to clean failurescacheLoaderWriter- theCacheLoaderWriterto decorateconfiguration- the write-behind configuration- Returns:
- the write-behind decorated loader writer
-
releaseWriteBehindLoaderWriter
Releases a write-behind decorator when the associatedCacheis finished with it.- Parameters:
cacheLoaderWriter- theCacheLoaderWriterto release
-