1
2
3
4
5
6
7
8
9
10
11 package psiprobe.controllers.threads;
12
13 import jakarta.inject.Inject;
14 import jakarta.servlet.http.HttpServletRequest;
15 import jakarta.servlet.http.HttpServletResponse;
16
17 import java.util.List;
18
19 import org.springframework.beans.factory.annotation.Value;
20 import org.springframework.stereotype.Controller;
21 import org.springframework.web.bind.annotation.RequestMapping;
22 import org.springframework.web.servlet.ModelAndView;
23
24 import psiprobe.beans.ContainerListenerBean;
25 import psiprobe.controllers.AbstractTomcatContainerController;
26 import psiprobe.model.ThreadPool;
27
28
29
30
31 @Controller
32 public class ListThreadPoolsController extends AbstractTomcatContainerController {
33
34
35 @Inject
36 private ContainerListenerBean containerListenerBean;
37
38
39
40
41
42
43 public ContainerListenerBean getContainerListenerBean() {
44 return containerListenerBean;
45 }
46
47
48
49
50
51
52 public void setContainerListenerBean(ContainerListenerBean containerListenerBean) {
53 this.containerListenerBean = containerListenerBean;
54 }
55
56 @RequestMapping(path = "/threadpools.htm")
57 @Override
58 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
59 throws Exception {
60 return super.handleRequest(request, response);
61 }
62
63 @Override
64 public ModelAndView handleRequestInternal(HttpServletRequest request,
65 HttpServletResponse response) throws Exception {
66
67 List<ThreadPool> pools = containerListenerBean.getThreadPools();
68 return new ModelAndView(getViewName()).addObject("pools", pools);
69 }
70
71 @Value("threadpools")
72 @Override
73 public void setViewName(String viewName) {
74 super.setViewName(viewName);
75 }
76
77 }