1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.cache.decorators;
17
18 import org.apache.ibatis.cache.Cache;
19
20
21
22
23 public class SynchronizedCache implements Cache {
24
25 private final Cache delegate;
26
27 public SynchronizedCache(Cache delegate) {
28 this.delegate = delegate;
29 }
30
31 @Override
32 public String getId() {
33 return delegate.getId();
34 }
35
36 @Override
37 public synchronized int getSize() {
38 return delegate.getSize();
39 }
40
41 @Override
42 public synchronized void putObject(Object key, Object object) {
43 delegate.putObject(key, object);
44 }
45
46 @Override
47 public synchronized Object getObject(Object key) {
48 return delegate.getObject(key);
49 }
50
51 @Override
52 public synchronized Object removeObject(Object key) {
53 return delegate.removeObject(key);
54 }
55
56 @Override
57 public synchronized void clear() {
58 delegate.clear();
59 }
60
61 @Override
62 public int hashCode() {
63 return delegate.hashCode();
64 }
65
66 @Override
67 public boolean equals(Object obj) {
68 return delegate.equals(obj);
69 }
70
71 }