1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.jcs3.jcache;
20
21 import java.util.Collection;
22
23 import javax.cache.Cache;
24 import javax.cache.integration.CacheWriter;
25 import javax.cache.integration.CacheWriterException;
26
27 public class NoWriter<K, V> implements CacheWriter<K, V>
28 {
29 public static final NoWriter<?, ?> INSTANCE = new NoWriter<>();
30
31 @Override
32 public void write(final Cache.Entry<? extends K, ? extends V> entry) throws CacheWriterException
33 {
34
35 }
36
37 @Override
38 public void delete(final Object key) throws CacheWriterException
39 {
40
41 }
42
43 @Override
44 public void writeAll(final Collection<Cache.Entry<? extends K, ? extends V>> entries) throws CacheWriterException
45 {
46 entries.forEach(this::write);
47 }
48
49 @Override
50 public void deleteAll(final Collection<?> keys) throws CacheWriterException
51 {
52 keys.forEach(this::delete);
53 }
54 }