@ThreadSafe public interface CacheWriter<K,V> extends Lifecycle
CacheLoader.| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(Object key) |
default void |
deleteBatch(Iterable<Object> keys)
Remove all provided keys from the store in a single batch operation.
|
void |
init(InitializationContext ctx)
Used to initialize a cache loader.
|
void |
write(MarshalledEntry<? extends K,? extends V> entry)
Persists the entry to the storage.
|
default void |
writeBatch(Iterable<MarshalledEntry<? extends K,? extends V>> entries)
Persist all provided entries to the store in a single batch update.
|
void init(InitializationContext ctx)
PersistenceManager
when setting up cache loaders.PersistenceException - in case of an error, e.g. communicating with the external storagevoid write(MarshalledEntry<? extends K,? extends V> entry)
PersistenceException - in case of an error, e.g. communicating with the external storageMarshalledEntryboolean delete(Object key)
PersistenceException - in case of an error, e.g. communicating with the external storagedefault void writeBatch(Iterable<MarshalledEntry<? extends K,? extends V>> entries)
write(MarshalledEntry).entries - an Iterable of MarshalledEntry to be written to the store. Implementations
should take into account that the passed iterable may contain no entries.NullPointerException - if entries is null.default void deleteBatch(Iterable<Object> keys)
delete(Object).keys - an Iterable of entry Keys to be removed from the store. Implementations
should take into account that the passed iterable may contain no keys.NullPointerException - if keys is null.Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.