directExecutor()); } catch (Throwable t) { ListenableFuture<V> result = setException(t) ? futureValue : fullyFailedFuture(t); if (t instanceof InterruptedException) { Thread.currentThread().interrupt();
@Override public void run() { try { getAndRecordStats(key, hash, loadingValueReference, loadingFuture); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } },
public V compute(K key, BiFunction<? super K, ? super V, ? extends V> function) { stopwatch.start(); V previousValue; try { previousValue = oldValue.waitForValue(); } catch (ExecutionException e) { previousValue = null; } V newValue; try { newValue = function.apply(key, previousValue); } catch (Throwable th) { this.setException(th); throw th; } this.set(newValue); return newValue; }
@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); } } }, sameThreadExecutor);
@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); } } }, sameThreadExecutor);
@Override public void run() { try { V newValue = getAndRecordStats(key, hash, loadingValueReference, loadingFuture); // update loadingFuture for the sake of other pending requests loadingValueReference.set(newValue); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } }, sameThreadExecutor);
@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); } } }, sameThreadExecutor);
@Override public void run() { try { getAndRecordStats(key, hash, loadingValueReference, loadingFuture); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } },
@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); } } }, sameThreadExecutor);
@Override public void run() { try { getAndRecordStats(key, hash, loadingValueReference, loadingFuture); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } },
private ListenableFuture<V> fullyFailedFuture(Throwable t) { SettableFuture<V> future = SettableFuture.create(); setException(future, t); return future; }
private ListenableFuture<V> fullyFailedFuture(Throwable t) { SettableFuture<V> future = SettableFuture.create(); setException(future, t); return future; }
@Override public void run() { try { V newValue = getAndRecordStats(key, hash, loadingValueReference, loadingFuture); // update loadingFuture for the sake of other pending requests loadingValueReference.set(newValue); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } }, sameThreadExecutor);
@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); } } }, sameThreadExecutor);
@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); } } }, sameThreadExecutor);
@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());
public boolean setException(Throwable t) { return setException(futureValue, t); }
directExecutor()); } catch (Throwable t) { ListenableFuture<V> result = setException(t) ? futureValue : fullyFailedFuture(t); if (t instanceof InterruptedException) { Thread.currentThread().interrupt();
@Override public void run() { try { getAndRecordStats(key, hash, loadingValueReference, loadingFuture); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } },
@Override public void run() { try { getAndRecordStats(key, hash, loadingValueReference, loadingFuture); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown during refresh", t); loadingValueReference.setException(t); } } },