Class AdvancedCacheLoader<K,​V>

    • Constructor Detail

      • AdvancedCacheLoader

        public AdvancedCacheLoader()
        Deprecated.
    • Method Detail

      • load

        public abstract V load​(K key,
                               long startTime,
                               @Nullable CacheEntry<K,​V> currentEntry)
                        throws Exception
        Deprecated.
        Retrieves or generates data based on the key parameter.
        Specified by:
        load in interface AdvancedCacheLoader<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 null null. If Cache2kBuilder.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 is null. See also the description of Cache2kBuilder.keepDataAfterExpired(boolean) and Cache2kBuilder.refreshAhead(boolean).
        Returns:
        value to be associated with the key. If the cache permits null values a null is associated with the key.
        Throws:
        Exception - Unhandled exception from the loader. Exceptions are suppressed or wrapped and rethrown via a CacheLoaderException