(
final K key,
final int hash,
final LoadingValueReference<K, V> loadingValueReference,
CacheLoader<? super K, V> loader)
| 2399 | } |
| 2400 | |
| 2401 | ListenableFuture<V> loadAsync( |
| 2402 | final K key, |
| 2403 | final int hash, |
| 2404 | final LoadingValueReference<K, V> loadingValueReference, |
| 2405 | CacheLoader<? super K, V> loader) { |
| 2406 | final ListenableFuture<V> loadingFuture = loadingValueReference.loadFuture(key, loader); |
| 2407 | loadingFuture.addListener(new Runnable() { |
| 2408 | @Override |
| 2409 | public void run() { |
| 2410 | try { |
| 2411 | getAndRecordStats(key, hash, loadingValueReference, loadingFuture); |
| 2412 | } catch (Throwable t) { |
| 2413 | logger.log(Level.WARNING, "Exception thrown during refresh", t); |
| 2414 | loadingValueReference.setException(t); |
| 2415 | } |
| 2416 | } |
| 2417 | }, directExecutor()); |
| 2418 | return loadingFuture; |
| 2419 | } |
| 2420 | |
| 2421 | /** |
| 2422 | * Waits uninterruptibly for {@code newValue} to be loaded, and then records loading stats. |
no test coverage detected