- living value exists
When it's time to refresh, competing for the asynchronous loading with the specified loader. If the loading thread is immediately done, returning the new value. Otherwise returning the current living value. Finally, the cache will be updated with the loading value.
- non living value exists
If there is already a loading thread, waiting the loading value. Otherwise competing for the synchronous loading. Finally, returning the new loaded value and updating the cache.
The specified key has only a single loading thread during the loading peroid
The loading works as the following. When the old value is not null, invoking the specified loader's reload
method with it. Otherwise invoking the load
method.
- loadSync
Start loading, then indefinitely waiting the new loaded value.
- loadAsync
Start loading, but returning the loading future without wait.
The default reload
method invokes the load
method.