LOG.debug(getName() + ": refreshing element with key " + key);
@Override public String toString() { return "Cache[" + self.getName() + "]"; } }
@Override public String toString() { return "Cache[" + self.getName() + "]"; } }
@SuppressWarnings("unchecked") @Override public V get(K key) { V result = null; Element e = cache.get(key); if (e == null){ // cache miss logger.error("Cache miss should never happened in SelfPopulatingCache: {}", cache.getName()); }else{ // cache hit result = (V) e.getObjectValue(); triggerRefreshIfNeeded(e); } return result; }
LOG.debug(getName() + ": refreshing element with key " + key);
LOG.debug(getName() + ": refreshing element with key " + key);
public void run(){ if (e.getVersion() == signature){ // triple check try{ V newValue = getDirectly((K)e.getObjectKey()); if (newValue == null){ cache.remove(e.getObjectKey()); }else{ cache.put(new Element((K)e.getObjectKey(), newValue)); } }catch(Exception ex){ logger.warn("Failed to update the value associated with specified key '{}' in cache '{}'", e.getObjectKey(), cache.getName(), ex); } } } });
LOG.debug(getName() + ": refreshing element with key " + key);