1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.mycore.common;
20
21
22
23
24
25
26
27
28 public class MCRCacheManager implements MCRCacheManagerMBean {
29
30 @SuppressWarnings("rawtypes")
31 private final MCRCache cache;
32
33 public MCRCacheManager(@SuppressWarnings("rawtypes") final MCRCache cache) {
34 this.cache = cache;
35 }
36
37 public long getCapacity() {
38 return cache.getCapacity();
39 }
40
41 public double getFillRate() {
42 return cache.getFillRate();
43 }
44
45 public double getHitRate() {
46 return cache.getHitRate();
47 }
48
49 public long getHits() {
50 return cache.backingCache.stats().hitCount();
51 }
52
53 public long getRequests() {
54 return cache.backingCache.stats().requestCount();
55 }
56
57 public long getEvictions() {
58 return cache.backingCache.stats().evictionCount();
59 }
60
61 public long getSize() {
62 return cache.getCurrentSize();
63 }
64
65
66
67
68 public void setCapacity(long capacity) {
69 cache.setCapacity(capacity);
70 }
71
72 public void clear() {
73 cache.clear();
74 }
75
76 }