示例#1
0
  @Override
  public boolean setCache(CacheSelector cacheSelector, Object cacheValue) throws Exception {
    long timeout = cacheSelector.getTimeout();
    String filePath = this.getRealFilePath(cacheSelector.getCacheKey());
    boolean isSave =
        FileOperate.saveObjectToFile(filePath, new FileCacheObject(timeout, cacheValue));
    if (isSave && timeout > 0) {
      FileCacheMonitor.getInstance().setFileCacheTime(filePath, timeout);
    }

    return isSave;
  }