01: package ri.cache.eviction;
02:
03: import javax.cache.CacheEntry;
04: import javax.cache.Cache;
05: import java.util.Map;
06:
07: /**
08: *
09: *
10: */
11: public interface EvictionStrategy<K, V> {
12: /**
13: *
14: * @param key
15: * @param value
16: * @param ttl
17: */
18: public CacheEntry<K, V> createEntry(K key, V value, long ttl);
19:
20: /**
21: *
22: * @param entry
23: */
24: public void discardEntry(CacheEntry<K, V> entry);
25:
26: /**
27: *
28: * @param entry
29: */
30: public void touchEntry(CacheEntry<K, V> entry);
31:
32: /**
33: *
34: */
35: public void clear();
36:
37: /**
38: *
39: * @param cache
40: */
41: public Map<K, V> evict(Cache<K, V> cache);
42: }
|