@Nullable V loadSync(@Nonnull K key, int hash, @Nonnull LoadingValueReference<K, V> loadingValueReference, @Nonnull CacheLoader<? super K, V> loader) throws ExecutionException { ListenableFuture<V> loadingFuture = loadingValueReference.loadFuture(key, loader); return getAndRecordStats(key, hash, loadingValueReference, loadingFuture); }
@Override public void run() { try { V newValue = getAndRecordStats(key, hash, loadingValueReference, loadingFuture); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } }, DirectExecutor.INSTANCE);