@ThreadSafe public interface CacheLoader<K,V> extends Lifecycle
CacheWriter
.Modifier and Type | Method and Description |
---|---|
boolean |
contains(K key)
Returns true if the storage contains an entry associated with the given key.
|
void |
init(InitializationContext ctx)
Used to initialize a cache loader.
|
MarshalledEntry<K,V> |
load(K key)
Fetches an entry from the storage.
|
void init(InitializationContext ctx)
PersistenceManager
when setting up cache loaders.PersistenceException
- in case of an error, e.g. communicating with the external storageMarshalledEntry<K,V> load(K key)
MarshalledEntry
needs to be created here, InitializationContext.getMarshalledEntryFactory()
and InitializationContext.getByteBufferFactory()
should be used.PersistenceException
- in case of an error, e.g. communicating with the external storageboolean contains(K key)
PersistenceException
- in case of an error, e.g. communicating with the external storageCopyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.