01: package ri.cache.loader;
02:
03: import java.util.Collection;
04: import java.util.HashMap;
05: import java.util.Map;
06: import java.util.concurrent.Future;
07: import java.util.concurrent.ConcurrentMap;
08: import java.util.concurrent.ConcurrentHashMap;
09:
10: import javax.cache.spi.CacheLoader;
11: import javax.cache.spi.CacheLoaderException;
12:
13: /**
14: * AbstractCacheLoader
15: *
16: * @author Brian Goetz
17: */
18: public abstract class AbstractCacheLoader<K, V> implements
19: CacheLoader<K, V> {
20:
21: public Map<K, V> loadAll(Collection<? extends K> keys)
22: throws CacheLoaderException {
23: Map<K, V> results = new HashMap<K, V>(keys.size());
24: for (K key : keys)
25: results.put(key, load(key));
26:
27: return results;
28: }
29:
30: public void censorPut(K key, V value) throws CacheLoaderException {
31: // do nothing
32: }
33:
34: }
|