Thanks to this forum (How to automatically refresh Cache using Google Guava?), I learn about Guava.
I wanted to ask some information about the above topic (How to automatically refresh Cache using Google Guava?) but I can't to write comments for questions because my reputation is too low.
Consequently, I have to create a new topic. Thank you for your understanding.
Seeing this code,
LoadingCache<K, V> cache = CacheBuilder.newBuilder()
.refreshAfterWrite(15, TimeUnit.MINUTES)
.maximumSize(100)
.build(new MyCacheLoader());
if one entry A is loaded with her value at least one time, is really the above code sufficient to reload automatically every 15 minutes the value associated to the key A ?
Of course, as mentioned by Frank, "I override the CacheBuilder.reload(K, V) method in MyCacheLoader so it performs asynchronously." Or does i have code to add ? If yes, where ? Thank you very much
PS: JB, the javadoc is perfect but my level in english is low. In fact, the overridden reload of my CacheLoader see if a real reload has to be performed for a key, and if yes, realize a real reload for that key; otherwise do not make a real reload of the cache for that key. And, even in the second case (no real reload), does I have a call of my overridden reload method every 15 minutes ? I think so but am I right ? Thanks