class TimelineMetricCache extends UpdatingSelfPopulatingCache {

  @Override
  public Element get(Object key) throws LockTimeoutException {
    Element element = this.getQuiet(key);
    if (element != null) {
      if (LOG.isTraceEnabled()) {
        LOG.trace("key : {}", element.getObjectKey());
        LOG.trace("value : {}", element.getObjectValue());
      }

      // Set new time boundaries on the key
      TimelineAppMetricCacheKey existingKey = (TimelineAppMetricCacheKey) element.getObjectKey();

      LOG.debug("Existing temporal info: {} for : {}", existingKey.getTemporalInfo(), existingKey.getMetricNames());

      TimelineAppMetricCacheKey newKey = (TimelineAppMetricCacheKey) key;
      existingKey.setTemporalInfo(newKey.getTemporalInfo());

      LOG.debug("New temporal info: {} for : {}", newKey.getTemporalInfo(), existingKey.getMetricNames());

      if (existingKey.getSpec() == null || !existingKey.getSpec().equals(newKey.getSpec())) {
        existingKey.setSpec(newKey.getSpec());
        LOG.debug("New spec: {} for : {}", newKey.getSpec(), existingKey.getMetricNames());
      }
    }

    return super.get(key);
  }

  public  TimelineMetricCache(Ehcache cache, UpdatingCacheEntryFactory factory);

}