Package org.cache2k.integration
Class AdvancedCacheLoader<K,V>
- java.lang.Object
-
- org.cache2k.integration.AdvancedCacheLoader<K,V>
-
- All Implemented Interfaces:
Customization
,AdvancedCacheLoader<K,V>
@Deprecated public abstract class AdvancedCacheLoader<K,V> extends Object implements AdvancedCacheLoader<K,V>
Deprecated.Replaced withAdvancedCacheLoader
Retrieves or generates a value to load into the cache. The advanced loader interface contains the current time and the previous cache entry. The previous cache entry can be used for a more intelligent loading strategy, e.g. for HTTP based loading with theIf-Modified-Since
header.For general documentation on the loader, please see
CacheLoader
.- Author:
- Jens Wilke
- See Also:
CacheLoader
-
-
Constructor Summary
Constructors Constructor Description AdvancedCacheLoader()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description abstract V
load(K key, long startTime, CacheEntry<K,V> currentEntry)
Deprecated.Retrieves or generates data based on the key parameter.
-
-
-
Method Detail
-
load
public abstract V load(K key, long startTime, CacheEntry<K,V> currentEntry) throws Exception
Deprecated.Retrieves or generates data based on the key parameter.- Specified by:
load
in interfaceAdvancedCacheLoader<K,V>
- Parameters:
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. IfCache2kBuilder.keepDataAfterExpired(boolean)
is enabled, also an expired entry is provided to the loader for optimization purposes. See also the description ofCache2kBuilder.keepDataAfterExpired(boolean)
andCache2kBuilder.refreshAhead(boolean)
.- Returns:
- value to be associated with the key. If the cache permits
null
values anull
is associated with the key. - Throws:
Exception
- Unhandled exception from the loader. Exceptions are suppressed or wrapped and rethrown via aCacheLoaderException
-
-