@ThreadSafe public interface CacheLoader<K,V> extends Lifecycle
CacheWriter.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.Object key)
Returns true if the storage contains an entry associated with the given key.
|
void |
init(InitializationContext ctx)
Used to initialize a cache loader.
|
default boolean |
isAvailable() |
default MarshalledEntry<K,V> |
load(java.lang.Object key)
Deprecated.
since 10.0 please implement {
loadEntry(Object)} instead |
default MarshallableEntry<K,V> |
loadEntry(java.lang.Object 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 storage@Deprecated default MarshalledEntry<K,V> load(java.lang.Object key)
loadEntry(Object)} insteadMarshalledEntry 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 storagedefault MarshallableEntry<K,V> loadEntry(java.lang.Object key)
MarshallableEntry needs to be created here, InitializationContext.getMarshallableEntryFactory() ()} and InitializationContext.getByteBufferFactory() should be used.PersistenceException - in case of an error, e.g. communicating with the external storageboolean contains(java.lang.Object key)
PersistenceException - in case of an error, e.g. communicating with the external storagedefault boolean isAvailable()