@Override public void notifyRemoval(@Nullable K key, @Nullable V value, RemovalCause cause) { requireState(hasRemovalListener(), "Notification should be guarded with a check"); Runnable task = () -> { try { removalListener().onRemoval(key, value, cause); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown by removal listener", t); } }; try { executor().execute(task); } catch (Throwable t) { logger.log(Level.SEVERE, "Exception thrown when submitting removal listener", t); task.run(); } }
if (hasRemovalListener()) { @SuppressWarnings("unchecked") K castKey = (K) key;
} else if (hasRemovalListener()) { notifyRemoval(oldKey[0], oldValue[0], cause[0]);
}, /* recordMiss */ false, /* recordLoad */ false); if (discard[0] && hasRemovalListener()) { notifyRemoval(key, value, RemovalCause.REPLACED);
if (hasRemovalListener() && (oldValue != newValue)) { notifyRemoval(nodeKey[0], prevValue[0], RemovalCause.REPLACED);
if (hasRemovalListener()) { notifyRemoval(castKey, oldValue[0], cause[0]);
if (hasRemovalListener() && (value != oldValue[0])) { notifyRemoval(nodeKey[0], oldValue[0], RemovalCause.REPLACED);
if (hasRemovalListener()) { if (expired) { notifyRemoval(key, oldValue, RemovalCause.EXPIRED);
@Override public void notifyRemoval(@Nullable K key, @Nullable V value, RemovalCause cause) { requireState(hasRemovalListener(), "Notification should be guarded with a check"); Runnable task = () -> { try { removalListener().onRemoval(key, value, cause); } catch (Throwable t) { logger.log(Level.WARNING, "Exception thrown by removal listener", t); } }; try { executor().execute(task); } catch (Throwable t) { logger.log(Level.SEVERE, "Exception thrown when submitting removal listener", t); task.run(); } }
if (hasRemovalListener()) { notifyRemoval(nodeKey[0], oldValue[0], cause[0]);
if ((cause[0] != null) && hasRemovalListener()) { notifyRemoval(key, value[0], cause[0]);
statsCounter().recordEviction(weight[0]); if (hasRemovalListener()) { notifyRemoval(nodeKey[0], oldValue[0], cause[0]);
if (hasRemovalListener()) { @SuppressWarnings("unchecked") K castKey = (K) key;
if (hasRemovalListener()) { notifyRemoval(castKey, oldValue[0], cause[0]);
} else if (hasRemovalListener()) { notifyRemoval(oldKey[0], oldValue[0], cause[0]);
if (hasRemovalListener() && (value != oldValue[0])) { notifyRemoval(nodeKey[0], oldValue[0], RemovalCause.REPLACED);
if (hasRemovalListener() && (oldValue != newValue)) { notifyRemoval(nodeKey[0], prevValue[0], RemovalCause.REPLACED);
if ((cause[0] != null) && hasRemovalListener()) { notifyRemoval(key, value[0], cause[0]);
if (hasRemovalListener()) { notifyRemoval(nodeKey[0], oldValue[0], cause[0]);