예제 #1
0
  public Object get(Object key) {
    CacheableWrapper retValue = (CacheableWrapper) this.whirlyCache.retrieve(key);

    if (retValue != null) {
      if (needRefresh(retValue)) {
        this.whirlyCacheStatistics.miss();
        return null;
      }
      this.whirlyCacheStatistics.hit();
    } else {
      this.whirlyCacheStatistics.miss();
      return null;
    }
    return retValue.getValue();
  }
예제 #2
0
 public Object remove(Object key) {
   CacheableWrapper previous = (CacheableWrapper) this.whirlyCache.retrieve(key);
   this.whirlyCache.remove(key);
   return previous == null ? null : previous.getValue();
 }