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.model.jmx;
12  
13  import java.util.ArrayList;
14  import java.util.Collection;
15  import java.util.List;
16  
17  import javax.management.ObjectName;
18  
19  /**
20   * This bean represens a hierarchy of Tomcat's ObjectNames necessary to display real-time connection
21   * information on "status" tab.
22   */
23  public class ThreadPoolObjectName {
24  
25    /** The thread pool name. */
26    private ObjectName threadPoolName;
27  
28    /** The global request processor name. */
29    private ObjectName globalRequestProcessorName;
30  
31    /** The request processor names. */
32    private List<ObjectName> requestProcessorNames = new ArrayList<>();
33  
34    /**
35     * Gets the thread pool name.
36     *
37     * @return the thread pool name
38     */
39    public ObjectName getThreadPoolName() {
40      return threadPoolName;
41    }
42  
43    /**
44     * Gets the global request processor name.
45     *
46     * @return the global request processor name
47     */
48    public ObjectName getGlobalRequestProcessorName() {
49      return globalRequestProcessorName;
50    }
51  
52    /**
53     * Gets the request processor names.
54     *
55     * @return the request processor names
56     */
57    public List<ObjectName> getRequestProcessorNames() {
58      return requestProcessorNames == null ? List.of() : new ArrayList<>(requestProcessorNames);
59    }
60  
61    /**
62     * Sets the thread pool name.
63     *
64     * @param threadPoolName the new thread pool name
65     */
66    public void setThreadPoolName(ObjectName threadPoolName) {
67      this.threadPoolName = threadPoolName;
68    }
69  
70    /**
71     * Sets the global request processor name.
72     *
73     * @param globalRequestProcessorName the new global request processor name
74     */
75    public void setGlobalRequestProcessorName(ObjectName globalRequestProcessorName) {
76      this.globalRequestProcessorName = globalRequestProcessorName;
77    }
78  
79    /**
80     * Sets the request processor names.
81     *
82     * @param requestProcessorNames the new request processor names
83     */
84    public void setRequestProcessorNames(Collection<ObjectName> requestProcessorNames) {
85      this.requestProcessorNames =
86          requestProcessorNames == null ? List.of() : new ArrayList<>(requestProcessorNames);
87    }
88  
89  }