View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.controllers.system;
12  
13  import jakarta.servlet.http.HttpServletRequest;
14  import jakarta.servlet.http.HttpServletResponse;
15  
16  import org.springframework.beans.factory.annotation.Value;
17  import org.springframework.stereotype.Controller;
18  import org.springframework.web.bind.annotation.RequestMapping;
19  import org.springframework.web.servlet.ModelAndView;
20  
21  import psiprobe.tools.TimeExpression;
22  
23  /**
24   * The Class MemoryStatsController.
25   */
26  @Controller
27  public class MemoryStatsController extends BaseMemoryStatsController {
28  
29    /**
30     * Sets the collection period.
31     *
32     * @param collectionPeriod the new collection period
33     */
34    @Value("${psiprobe.beans.stats.collectors.memory.period}")
35    public void setCollectionPeriod(String collectionPeriod) {
36      super.setCollectionPeriod(TimeExpression.inSeconds(collectionPeriod));
37    }
38  
39    @RequestMapping(path = "/memory.htm")
40    @Override
41    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
42        throws Exception {
43      return super.handleRequest(request, response);
44    }
45  
46    @Value("memory")
47    @Override
48    public void setViewName(String viewName) {
49      super.setViewName(viewName);
50    }
51  
52  }