Package org.cache2k.integration
Class AdvancedCacheLoader<K,V>
- java.lang.Object
-
- org.cache2k.integration.AdvancedCacheLoader<K,V>
-
- All Implemented Interfaces:
Customization
,DataAware<K,V>
,DataAwareCustomization<K,V>
,AdvancedCacheLoader<K,V>
@Deprecated public abstract class AdvancedCacheLoader<K,V> extends Object implements AdvancedCacheLoader<K,V>
Deprecated.Replaced withAdvancedCacheLoader
, to be removed in version 2.2
-
-
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, @Nullable 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, @Nullable @Nullable 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, this is nullnull
. IfCache2kBuilder.keepDataAfterExpired(boolean)
is enabled, also an expired entry is provided to the loader for optimization purposes. If the previous load had thrown an excetion, this isnull
. 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
-
-