public abstract class AdvancedCacheLoader<K,V> extends Object
If-Modified-Since
header.
For general documentation on the loader, please see CacheLoader
.
CacheLoader
Constructor and Description |
---|
AdvancedCacheLoader() |
Modifier and Type | Method and Description |
---|---|
abstract V |
load(K key,
long currentTime,
CacheEntry<K,V> currentEntry)
Retrieves or generates data based on the key.
|
public abstract V load(K key, long currentTime, CacheEntry<K,V> currentEntry) throws Exception
key
- The non-null key to provide the value for.currentTime
- Time in millis, retrieved before the call.currentEntry
- entry currently in the cache, regardless whether expired or not.
There is no guarantee that an expired entry will be provided to the loader.
Depending und passed time and configuration expired entries may be purged from
the cache before the next load happens. Check the configuration parameters
Cache2kBuilder.keepDataAfterExpired(boolean)
and
Cache2kBuilder.refreshAhead(boolean)
.Exception
- Unhandled exception from the loader. Exceptions are suppressed or
wrapped and rethrown via a CacheLoaderException
cache2k API documentation. Copyright © 2000–2017 headissue GmbH, Munich.