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 startTime,
CacheEntry<K,V> currentEntry)
Retrieves or generates data based on the key parameter.
|
public abstract V load(K key, long startTime, CacheEntry<K,V> currentEntry) throws Exception
key
- The non-null key to provide the value for.startTime
- Time in millis, retrieved before the call.currentEntry
- Current entry in the cache. The entry is available if the load is caused
by a reload or refresh. If expired before, null
is returned.
If Cache2kBuilder.keepDataAfterExpired(boolean)
is enabled, also
an expired entry is provided to the loader for optimization purposes.
See also the description of
Cache2kBuilder.keepDataAfterExpired(boolean)
and
Cache2kBuilder.refreshAhead(boolean)
.null
values
a null
is associated with the key.Exception
- Unhandled exception from the loader. Exceptions are suppressed or
wrapped and rethrown via a CacheLoaderException
cache2k API documentation. Copyright © 2000–2020 headissue GmbH, Munich.