KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jmx > CatalinaObjectName


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2003-2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: CatalinaObjectName.java,v 1.2 2005/04/08 14:52:25 danesa Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jmx;
27
28 import javax.management.ObjectName JavaDoc;
29
30 /**
31  * A set of static classes used to build the names of Catalina MBeans used in JOnAS.
32  * This class was initially located in package org.objectweb.jonas.webapp.jonasadmin.
33  *
34  * @author Michel-Ange ANTON
35  */

36 public class CatalinaObjectName {
37
38     public static ObjectName JavaDoc catalinaServer() {
39         try {
40             return ObjectName.getInstance("Catalina:type=Server");
41         }
42         catch (javax.management.MalformedObjectNameException JavaDoc e) {
43             // this should never occur
44
return null;
45         }
46     }
47
48     public static ObjectName JavaDoc catalinaServices() {
49         try {
50             return ObjectName.getInstance("*:type=Service,*");
51         }
52         catch (javax.management.MalformedObjectNameException JavaDoc e) {
53             // this should never occur
54
return null;
55         }
56     }
57
58     public static ObjectName JavaDoc catalinaServices(String JavaDoc p_Domain) {
59         try {
60             return ObjectName.getInstance(p_Domain + ":type=Service, *");
61         }
62         catch (javax.management.MalformedObjectNameException JavaDoc e) {
63             // this should never occur
64
return null;
65         }
66     }
67
68     public static ObjectName JavaDoc catalinaService(String JavaDoc p_Domain, String JavaDoc p_ServiceName) {
69         try {
70             return ObjectName.getInstance(p_Domain + ":type=Service,name=" + p_ServiceName);
71         }
72         catch (javax.management.MalformedObjectNameException JavaDoc e) {
73             // this should never occur
74
return null;
75         }
76     }
77
78     public static ObjectName JavaDoc catalinaEngines() {
79         try {
80             return ObjectName.getInstance("*:type=Engine");
81         }
82         catch (javax.management.MalformedObjectNameException JavaDoc e) {
83             // this should never occur
84
return null;
85         }
86     }
87
88     public static ObjectName JavaDoc catalinaEngine(String JavaDoc p_Domain) {
89         try {
90             return ObjectName.getInstance(p_Domain + ":type=Engine");
91         }
92         catch (javax.management.MalformedObjectNameException JavaDoc e) {
93             // this should never occur
94
return null;
95         }
96     }
97
98     public static ObjectName JavaDoc catalinaConnectors() {
99         try {
100             return ObjectName.getInstance("*:type=Connector");
101         }
102         catch (javax.management.MalformedObjectNameException JavaDoc e) {
103             // this should never occur
104
return null;
105         }
106     }
107
108     public static ObjectName JavaDoc catalinaConnectors(String JavaDoc p_Domain) {
109         try {
110             return ObjectName.getInstance(p_Domain + ":type=Connector,*");
111         }
112         catch (javax.management.MalformedObjectNameException JavaDoc e) {
113             // this should never occur
114
return null;
115         }
116     }
117
118     public static ObjectName JavaDoc catalinaConnector(String JavaDoc p_Domain, String JavaDoc p_Port) {
119         try {
120             return ObjectName.getInstance(p_Domain + ":type=Connector,port=" + p_Port);
121         }
122         catch (javax.management.MalformedObjectNameException JavaDoc e) {
123             // this should never occur
124
return null;
125         }
126     }
127
128     public static ObjectName JavaDoc catalinaHosts() {
129         try {
130             return ObjectName.getInstance("*:type=Host,*");
131         }
132         catch (javax.management.MalformedObjectNameException JavaDoc e) {
133             // this should never occur
134
return null;
135         }
136     }
137
138     public static ObjectName JavaDoc catalinaHosts(String JavaDoc p_Domain) {
139         try {
140             return ObjectName.getInstance(p_Domain + ":type=Host,*");
141         }
142         catch (javax.management.MalformedObjectNameException JavaDoc e) {
143             // this should never occur
144
return null;
145         }
146     }
147
148     public static ObjectName JavaDoc catalinaHost(String JavaDoc p_Domain, String JavaDoc p_HostName) {
149         try {
150             return ObjectName.getInstance(p_Domain + ":type=Host,host=" + p_HostName);
151         }
152         catch (javax.management.MalformedObjectNameException JavaDoc e) {
153             // this should never occur
154
return null;
155         }
156     }
157
158     public static ObjectName JavaDoc catalinaFactory() {
159         try {
160             return ObjectName.getInstance("Catalina:type=MBeanFactory");
161         }
162         catch (javax.management.MalformedObjectNameException JavaDoc e) {
163             // this should never occur
164
return null;
165         }
166     }
167
168     public static ObjectName JavaDoc catalinaRealms() {
169         try {
170             return ObjectName.getInstance("*:type=Realm,*");
171         }
172         catch (javax.management.MalformedObjectNameException JavaDoc e) {
173             // this should never occur
174
return null;
175         }
176     }
177
178     public static ObjectName JavaDoc catalinaRealm(String JavaDoc p_Domain) {
179         try {
180             return ObjectName.getInstance(p_Domain + ":type=Realm");
181         }
182         catch (javax.management.MalformedObjectNameException JavaDoc e) {
183             // this should never occur
184
return null;
185         }
186     }
187
188     public static ObjectName JavaDoc catalinaManager(String JavaDoc p_ServiceName, String JavaDoc p_Host, String JavaDoc p_Path) {
189         try {
190             return ObjectName.getInstance("Catalina:type=Manager,service=" + p_ServiceName + ",host="
191                 + p_Host + ",path=" + p_Path);
192         }
193         catch (javax.management.MalformedObjectNameException JavaDoc e) {
194             // this should never occur
195
return null;
196         }
197     }
198
199     public static ObjectName JavaDoc catalinaLoader(String JavaDoc p_ServiceName, String JavaDoc p_Host, String JavaDoc p_Path) {
200         try {
201             return ObjectName.getInstance("Catalina:type=Loader,service=" + p_ServiceName + ",host="
202                 + p_Host + ",path=" + p_Path);
203         }
204         catch (javax.management.MalformedObjectNameException JavaDoc e) {
205             // this should never occur
206
return null;
207         }
208     }
209
210     public static ObjectName JavaDoc catalinaValves() {
211         try {
212             return ObjectName.getInstance("*:type=Valve,*");
213         }
214         catch (javax.management.MalformedObjectNameException JavaDoc e) {
215             // this should never occur
216
return null;
217         }
218     }
219
220     public static ObjectName JavaDoc catalinaValves(String JavaDoc p_Domain) {
221         try {
222             return ObjectName.getInstance(p_Domain + ":type=Valve,*");
223         }
224         catch (javax.management.MalformedObjectNameException JavaDoc e) {
225             // this should never occur
226
return null;
227         }
228     }
229     public static ObjectName JavaDoc catalinaAccessLogValves(String JavaDoc p_Domain) {
230         try {
231             return ObjectName.getInstance(p_Domain + ":type=Valve,name=AccessLogValve,*");
232         }
233         catch (javax.management.MalformedObjectNameException JavaDoc e) {
234             // this should never occur
235
return null;
236         }
237     }
238
239     public static ObjectName JavaDoc catalinaValves(String JavaDoc p_Domain, String JavaDoc p_Host) {
240         try {
241             return ObjectName.getInstance(p_Domain + ":type=Valve,host=" + p_Host + ",*");
242         }
243         catch (javax.management.MalformedObjectNameException JavaDoc e) {
244             // this should never occur
245
return null;
246         }
247     }
248
249     public static ObjectName JavaDoc catalinaValve(String JavaDoc p_Domain, String JavaDoc p_Name) {
250         try {
251             return ObjectName.getInstance(p_Domain + ":type=Valve,name=" + p_Name);
252         }
253         catch (javax.management.MalformedObjectNameException JavaDoc e) {
254             // this should never occur
255
return null;
256         }
257     }
258
259     public static ObjectName JavaDoc catalinaValve(String JavaDoc p_Domain, String JavaDoc p_Name, String JavaDoc p_Host) {
260         try {
261             return ObjectName.getInstance(p_Domain + ":type=Valve,name=" + p_Name + ",host=" + p_Host);
262         }
263         catch (javax.management.MalformedObjectNameException JavaDoc e) {
264             // this should never occur
265
return null;
266         }
267     }
268
269 }
270
Popular Tags