1
2
3
4
5
6
7
8
9
10
11 package psiprobe.controllers.system;
12
13 import jakarta.inject.Inject;
14 import jakarta.servlet.http.HttpServletRequest;
15 import jakarta.servlet.http.HttpServletResponse;
16
17 import org.springframework.web.servlet.ModelAndView;
18 import org.springframework.web.servlet.mvc.ParameterizableViewController;
19
20 import psiprobe.beans.JvmMemoryInfoAccessorBean;
21
22
23
24
25 public class BaseMemoryStatsController extends ParameterizableViewController {
26
27
28 @Inject
29 private JvmMemoryInfoAccessorBean jvmMemoryInfoAccessorBean;
30
31
32 private long collectionPeriod;
33
34
35
36
37
38
39 public JvmMemoryInfoAccessorBean getJvmMemoryInfoAccessorBean() {
40 return jvmMemoryInfoAccessorBean;
41 }
42
43
44
45
46
47
48 public void setJvmMemoryInfoAccessorBean(JvmMemoryInfoAccessorBean jvmMemoryInfoAccessorBean) {
49 this.jvmMemoryInfoAccessorBean = jvmMemoryInfoAccessorBean;
50 }
51
52
53
54
55
56
57 public long getCollectionPeriod() {
58 return collectionPeriod;
59 }
60
61
62
63
64
65
66 public void setCollectionPeriod(long collectionPeriod) {
67 this.collectionPeriod = collectionPeriod;
68 }
69
70 @Override
71 protected ModelAndView handleRequestInternal(HttpServletRequest request,
72 HttpServletResponse response) throws Exception {
73
74 ModelAndView mv = new ModelAndView(getViewName());
75 mv.addObject("pools", getJvmMemoryInfoAccessorBean().getPools());
76 mv.addObject("collectionPeriod", getCollectionPeriod());
77 return mv;
78 }
79
80 }