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