01: package org.shiftone.cache.util.reaper;
02:
03: import org.shiftone.cache.Cache;
04: import org.shiftone.cache.util.Log;
05:
06: import java.util.Timer;
07:
08: /**
09: * Class CacheReaper
10: * @author <a href="mailto:jeff@shiftone.org">Jeff Drost</a>
11: * @version $Revision: 1.4 $
12: */
13: public class CacheReaper {
14:
15: private static final Log LOG = new Log(CacheReaper.class);
16: private static final Timer TIMER = new Timer(true);
17:
18: public static Cache register(ReapableCache cache, long period) {
19:
20: LOG.debug("register : " + cache);
21: TIMER
22: .scheduleAtFixedRate(new ReaperTask(cache), period,
23: period);
24:
25: return cache;
26: }
27: }
|