*/
public void setResult(int x, int y, Date evaluatedAt){
long elapse = System.currentTimeMillis();
log.info("[StatisticsManager#setResult()] (x,y)=(" + x +", " + y +")");
// キャッシュ取得
Cache cache =
CacheManager.getInstance().getCache(C_NAME);
// 集計結果キャッシュを加算
Summary summary = (Summary) cache.get(C_KEY_SUMMARY);
log.info("[StatisticsManager#setResult()] got summary from cache: " +
summary);
if(summary == null){
summary = new Summary();
log.info("[StatisticsManager#setResult()] summary(cache) is null " +
"/create new summary: " + summary.toString());
}
summary = Utils.add(x, y, evaluatedAt, summary);
log.info("[StatisticsManager#setResult()] count up summary: " +
summary.toString());
cache.put(C_KEY_SUMMARY, summary);
// 結果キャッシュを更新
Results results =
(Results) cache.get(C_KEY_RESULTS);
log.info("[StatisticsManager#setResult()] got results from cache: " +
results);
if(results == null){
results = new Results();
log.info("[StatisticsManager#setResult()] results(cache) is null " +
"/create new result: " + results.toString());
}
results.add(x, y, evaluatedAt);
log.info("[StatisticsManager#setResult()] count up results: " +
results.toString());
cache.put(C_KEY_RESULTS, results);
log.info("[StatisticsManager#setResult()] update result cache:" +
results.toString());
log.info("[StatisticsManager#setResult()] end" +
(System.currentTimeMillis() - elapse) + "mSec.");
}