@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).
As the execution order of MarshalledEntries is not guaranteed, you should ensure that only a single entry exists
in the Collection for a given key.entries - a Collection of MarshalledEntry to be written to the store.NullPointerException - if entries is null.default void deleteBatch(Iterable<Object> keys)
delete(Object).
As the execution order of MarshalledEntries is not guaranteed, you should ensure that only a single entry exists
in the Collection for a given key.keys - a Collection of MarshalledEntry to be removed from the store.NullPointerException - if keys is null.Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.