1
2
3
4
5 package gboat2.base.cache;
6
7
8
9
10
11
12
13
14
15
16 public class CacheManager {
17
18 private BaseCache cache = null;
19
20 private static CacheManager instance;
21
22 private static Object lock = new Object();
23
24
25
26
27 private CacheManager() {
28 cache = new BaseCache();
29 }
30
31
32
33
34
35 public static CacheManager getInstance() {
36 if (instance == null) {
37 synchronized (lock) {
38 instance = new CacheManager();
39 }
40 }
41
42 return instance;
43 }
44
45
46
47
48
49
50 public static BaseCache getCache() {
51 return getInstance().cache;
52 }
53 }