public static interface AsyncCacheLoader.Context<K,V>
Rationale: Instead of a rather long parameter list, we define an interface.
This allows us later to add some information without breaking implementations
of the AsyncCacheLoader
. The context does not include the cache, since the
loader should not depend on it and do any other operations on the cache while loading.
Modifier and Type | Method and Description |
---|---|
CacheEntry<K,V> |
getCurrentEntry()
Current entry in the cache.
|
Executor |
getExecutor()
The configured executor for async operations.
|
K |
getKey()
Cache key for the load request.
|
Executor |
getLoaderExecutor()
The configured loader executor.
|
long |
getLoadStartTime()
Time in millis since epoch of start of load operation
|
long getLoadStartTime()
K getKey()
Executor getExecutor()
Cache2kBuilder.executor(Executor)
Executor getLoaderExecutor()
Cache2kBuilder.loaderExecutor(Executor)
CacheEntry<K,V> getCurrentEntry()
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)
.cache2k API documentation. Copyright © 2000–2020 headissue GmbH, Munich.