Class JCacheWriterToMapStoreAdapter<K,V>
java.lang.Object
com.loomcache.server.jcache.JCacheWriterToMapStoreAdapter<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
MapStore<K,V>
Adapter that exposes a JSR-107
CacheWriter (+ optional CacheLoader)
as a LoomCache MapStore.
Used by LoomJCache in distributedEnabled mode to funnel all
external-store traffic through the underlying DistributedMap's MapStore
SPI. This removes the duplicate write-behind scheduler that
CacheWriterIntegration used to maintain — there is now a single
write-behind pipeline owned by DistributedMap.
Errors from the delegate writer/loader are surfaced as unchecked
CacheWriterException/CacheLoaderException, matching the
MapStore failure contract; DistributedMap counts them into its
write-through/delete-through failure metrics.
-
Constructor Summary
ConstructorsConstructorDescriptionJCacheWriterToMapStoreAdapter(@Nullable javax.cache.integration.CacheWriter<? super K, ? super V> writer, @Nullable javax.cache.integration.CacheLoader<K, V> loader) Create a MapStore-facing adapter over a JSR-107 writer/loader pair. -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove a single key from the backing store.voiddeleteAll(Collection<? extends K> keys) Remove multiple keys.@Nullable VLoad the value associated withkeyfrom the backing store.loadAll(Collection<? extends K> keys) Load multiple values in one round-trip.voidPersist a single key/value pair.voidPersist multiple key/value pairs.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MapStore
loadAllKeys
-
Constructor Details
-
JCacheWriterToMapStoreAdapter
public JCacheWriterToMapStoreAdapter(@Nullable javax.cache.integration.CacheWriter<? super K, ? super V> writer, @Nullable javax.cache.integration.CacheLoader<K, V> loader) Create a MapStore-facing adapter over a JSR-107 writer/loader pair. At least one of the two must be non-null — otherwise there is nothing to bridge.- Parameters:
writer- the JSR-107 cache writer, ornullif write-through is not usedloader- the JSR-107 cache loader, ornullif read-through is not used
-
-
Method Details
-
load
-
loadAll
Description copied from interface:MapStoreLoad multiple values in one round-trip. Default implementation loopsMapStore.load(Object); override for efficiency when the store supports bulk reads. -
store
-
storeAll
Description copied from interface:MapStorePersist multiple key/value pairs. Default implementation loopsMapStore.store(Object, Object); override for efficiency when the store supports bulk writes. -
delete
-
deleteAll
Description copied from interface:MapStoreRemove multiple keys. Default implementation loopsMapStore.delete(Object); override for efficiency when the store supports bulk deletes.
-