KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > monitor > registry > spi > MonitoringObjectNames


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /* MonitoringObjectNames.java
25  * $Id: MonitoringObjectNames.java,v 1.10 2005/12/25 03:43:34 tcfujii Exp $
26  * $Revision: 1.10 $
27  * $Date: 2005/12/25 03:43:34 $
28  * Indentation Information:
29  * 0. Please (try to) preserve these settings.
30  * 1. Tabs are preferred over spaces.
31  * 2. In vi/vim -
32  * :set tabstop=4 :set shiftwidth=4 :set softtabstop=4
33  * 3. In S1 Studio -
34  * 1. Tools->Options->Editor Settings->Java Editor->Tab Size = 4
35  * 2. Tools->Options->Indentation Engines->Java Indentation Engine->Expand Tabs to Spaces = False.
36  * 3. Tools->Options->Indentation Engines->Java Indentation Engine->Number of Spaces per Tab = 4.
37  */

38
39 package com.sun.enterprise.admin.monitor.registry.spi;
40
41 import java.util.Hashtable JavaDoc;
42 import java.util.logging.Logger JavaDoc;
43 import javax.management.ObjectName JavaDoc;
44 import com.sun.enterprise.admin.monitor.registry.MonitoredObjectType;
45 import com.sun.enterprise.admin.common.constant.AdminConstants; // for logger name
46
import com.sun.enterprise.server.ApplicationServer; // for instance name
47
import com.sun.enterprise.admin.server.core.AdminService; // for domain
48
import com.sun.enterprise.admin.AdminContext; // for domain
49

50 /**
51  * A class to provide the ObjectNames of various monitoring entities. It has a bunch
52  * of static methods to generate the ObjectName.
53  * @author <a HREF="mailto:Kedar.Mhaswade@sun.com">Kedar Mhaswade</a>
54  * @since S1AS8.0
55  * @version $Revision: 1.10 $
56  */

57 final class MonitoringObjectNames {
58     
59     private static final String JavaDoc SERVER_ID = ApplicationServer.getServerContext().getInstanceName();
60     private static final Logger JavaDoc logger = Logger.getLogger(AdminConstants.kLoggerName);
61     private static final String JavaDoc CATEGORY_PROPERTY = "category";
62     private static final String JavaDoc CATEGORY_PROPERTY_VAL = "monitor";
63     private static final String JavaDoc SERVER_PROPERTY = "server";
64     
65     private MonitoringObjectNames() {
66         //disallow
67
}
68     private static ObjectName JavaDoc formObjectName(Hashtable JavaDoc t) {
69
70         final String JavaDoc domain = getDomainName();
71         t.put(CATEGORY_PROPERTY, CATEGORY_PROPERTY_VAL);
72         t.put(SERVER_PROPERTY, SERVER_ID);
73         
74         ObjectName JavaDoc on = null;
75         try {
76             on = new ObjectName JavaDoc(domain, t);
77             logger.fine("MonitoringObjectNames:formObjectName - ObjectName = " + on.toString());
78         }
79         catch (Exception JavaDoc cause) {
80             //actually give one more chance if cause is an instance of MalformedObjectNameException - TBD
81
throw new RuntimeException JavaDoc(cause);
82         }
83         return ( on ); // may not return null
84
}
85     
86     private static String JavaDoc getDomainName() {
87         final AdminContext ac = AdminService.getAdminService().getAdminContext();
88         return ( ac.getDomainName() );
89     }
90     
91     static ObjectName JavaDoc getRootObjectName() {
92         final Hashtable JavaDoc t = new Hashtable JavaDoc();
93         t.put("type", MonitoredObjectType.ROOT.getTypeName());
94         return ( formObjectName(t) );
95     }
96     
97     static ObjectName JavaDoc getEjbObjectName(String JavaDoc ejb, String JavaDoc module, String JavaDoc app) {
98         final Hashtable JavaDoc t = new Hashtable JavaDoc();
99         t.put("type", MonitoredObjectType.EJB.getTypeName());
100         t.put("name", ejb);
101         if (app != null) {
102             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
103             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), module);
104         }
105         else {
106             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(), module);
107         }
108         return ( formObjectName(t) );
109     }
110
111 /*
112     static ObjectName getWebServiceObjectNameForWeb(
113         String endpoint,
114         String module,
115         String app) {
116         final Hashtable t = new Hashtable();
117         t.put("type", MonitoredObjectType.WEBSERVICE_ENDPOINT.getTypeName());
118         t.put("name", endpoint);
119         if (app != null) {
120             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
121             t.put(MonitoredObjectType.WEBMODULE.getTypeName(), module);
122         }
123         else {
124             t.put(MonitoredObjectType.STANDALONE_WEBMODULE.getTypeName(),
125                     module);
126         }
127         return ( formObjectName(t) );
128     }
129 */

130         static ObjectName JavaDoc
131     getWebServiceObjectNameForWeb(
132         final String JavaDoc endpoint,
133         final String JavaDoc app,
134         final String JavaDoc ctxRoot,
135         final String JavaDoc virtualServer ) {
136         final Hashtable JavaDoc t = new Hashtable JavaDoc();
137         
138         // this is the webmodule-virtual-server it belongs to
139
final ObjectName JavaDoc virtualServerObjectName =
140             getVirtualServerObjectName( app, ctxRoot, virtualServer );
141         
142         t.put("type", MonitoredObjectType.WEBSERVICE_ENDPOINT.getTypeName());
143         t.put("name", endpoint);
144         
145         // form pair based on virtual server type/name
146
t.put(
147             virtualServerObjectName.getKeyProperty( "type" ),
148             virtualServerObjectName.getKeyProperty( "name" ) );
149             
150         final String JavaDoc appPropName = MonitoredObjectType.APPLICATION.getTypeName();
151         String JavaDoc appName = virtualServerObjectName.getKeyProperty( appPropName );
152         if (appName == null) {
153             appName = "null";
154         }
155         t.put(appPropName, appName);
156
157         return formObjectName(t);
158     }
159
160     static ObjectName JavaDoc getWebServiceObjectNameForEjb(String JavaDoc endpoint,
161         String JavaDoc module, String JavaDoc app) {
162         final Hashtable JavaDoc t = new Hashtable JavaDoc();
163         t.put("type", MonitoredObjectType.WEBSERVICE_ENDPOINT.getTypeName());
164         t.put("name", endpoint);
165         if (app != null) {
166             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
167             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), module);
168         }
169         else {
170             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(),
171                     module);
172         }
173         return ( formObjectName(t) );
174     }
175
176     
177     static ObjectName JavaDoc getEjbMethodsObjectName(String JavaDoc app, String JavaDoc module, String JavaDoc ejb) {
178         final Hashtable JavaDoc t = new Hashtable JavaDoc();
179         t.put("type", MonitoredObjectType.BEAN_METHODS.getTypeName());
180         t.put(MonitoredObjectType.EJB.getTypeName(), ejb);
181         if (app != null) {
182             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
183             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), module);
184         }
185         else {
186             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(), module);
187         }
188         return ( formObjectName(t) );
189     }
190
191     static ObjectName JavaDoc getEjbMethodObjectName(String JavaDoc method, String JavaDoc ejb, String JavaDoc module, String JavaDoc app) {
192         final Hashtable JavaDoc t = new Hashtable JavaDoc();
193         t.put("type", MonitoredObjectType.BEAN_METHOD.getTypeName());
194         t.put("name", method);
195         t.put(MonitoredObjectType.EJB.getTypeName(), ejb);
196         if (app != null) {
197             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
198             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), module);
199         }
200         else {
201             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(), module);
202         }
203         return ( formObjectName(t) );
204     }
205     static ObjectName JavaDoc getEjbPoolObjectName(String JavaDoc ejb, String JavaDoc module, String JavaDoc app) {
206         final Hashtable JavaDoc t = new Hashtable JavaDoc();
207         t.put("type", MonitoredObjectType.BEAN_POOL.getTypeName());
208         t.put("name", MonitoredObjectType.BEAN_POOL.getTypeName());
209         t.put(MonitoredObjectType.EJB.getTypeName(), ejb);
210         if (app != null) {
211             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
212             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), module);
213         }
214         else {
215             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(), module);
216         }
217         return ( formObjectName(t) );
218     }
219     static ObjectName JavaDoc getEjbCacheObjectName(String JavaDoc ejb, String JavaDoc module, String JavaDoc app) {
220         final Hashtable JavaDoc t = new Hashtable JavaDoc();
221         t.put("type", MonitoredObjectType.BEAN_CACHE.getTypeName());
222         t.put("name", MonitoredObjectType.BEAN_CACHE.getTypeName());
223         t.put(MonitoredObjectType.EJB.getTypeName(), ejb);
224         if (app != null) {
225             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
226             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), module);
227         }
228         else {
229             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(), module);
230         }
231         return ( formObjectName(t) );
232     }
233     static ObjectName JavaDoc getConnectionPoolObjectName(String JavaDoc name, MonitoredObjectType type) {
234         final Hashtable JavaDoc t = new Hashtable JavaDoc();
235         if (type == MonitoredObjectType.CONNECTOR_CONN_POOL)
236             t.put("type", MonitoredObjectType.CONNECTOR_CONN_POOL.getTypeName());
237         else
238             t.put("type", MonitoredObjectType.JDBC_CONN_POOL.getTypeName());
239         t.put("name", name);
240         return ( formObjectName(t) );
241     }
242     
243     static ObjectName JavaDoc getOrbConnectionManagerObjectName(String JavaDoc name) {
244         final Hashtable JavaDoc t = new Hashtable JavaDoc();
245         t.put("type", MonitoredObjectType.CONNECTION_MANAGER.getTypeName());
246         t.put("name", name);
247         return ( formObjectName(t) );
248     }
249     static ObjectName JavaDoc getThreadPoolObjectName(String JavaDoc name) {
250         final Hashtable JavaDoc t = new Hashtable JavaDoc();
251         t.put("type", MonitoredObjectType.THREAD_POOL.getTypeName());
252         t.put("name", name);
253         return ( formObjectName(t) );
254     }
255     static ObjectName JavaDoc getTransactionServiceObjectName() {
256         final Hashtable JavaDoc t = new Hashtable JavaDoc();
257         t.put("type", MonitoredObjectType.TRANSACTION_SERVICE.getTypeName());
258         return ( formObjectName(t) );
259     }
260     static ObjectName JavaDoc getJvmObjectName() {
261         final Hashtable JavaDoc t = new Hashtable JavaDoc();
262         t.put("type", MonitoredObjectType.JVM.getTypeName());
263         return ( formObjectName(t) );
264     }
265         static ObjectName JavaDoc getJndiObjectName() {
266                 final Hashtable JavaDoc t = new Hashtable JavaDoc();
267                 t.put("type", MonitoredObjectType.JNDI.getTypeName());
268                 return ( formObjectName(t) );
269         }
270     static ObjectName JavaDoc getApplicationsObjectName() {
271         final Hashtable JavaDoc t = new Hashtable JavaDoc();
272         t.put("type", MonitoredObjectType.APPLICATIONS.getTypeName());
273         return ( formObjectName(t) );
274     }
275     static ObjectName JavaDoc getThreadPoolsObjectName() {
276         final Hashtable JavaDoc t = new Hashtable JavaDoc();
277         t.put("type", MonitoredObjectType.THREAD_POOLS.getTypeName());
278         return ( formObjectName(t) );
279     }
280     static ObjectName JavaDoc getOrbObjectName() {
281         final Hashtable JavaDoc t = new Hashtable JavaDoc();
282         t.put("type", MonitoredObjectType.ORB.getTypeName());
283         return ( formObjectName(t) );
284     }
285     static ObjectName JavaDoc getHttpServiceObjectName() {
286         final Hashtable JavaDoc t = new Hashtable JavaDoc();
287         t.put("type", MonitoredObjectType.HTTP_SERVICE.getTypeName());
288         return ( formObjectName(t) );
289     }
290     static ObjectName JavaDoc getResourcesObjectName() {
291         final Hashtable JavaDoc t = new Hashtable JavaDoc();
292         t.put("type", MonitoredObjectType.RESOURCES.getTypeName());
293         return ( formObjectName(t) );
294     }
295     static ObjectName JavaDoc getConnectionManagersObjectName() {
296         final Hashtable JavaDoc t = new Hashtable JavaDoc();
297         t.put("type", MonitoredObjectType.CONNECTION_MANAGERS.getTypeName());
298         return ( formObjectName(t) );
299     }
300     static ObjectName JavaDoc getVirtualServerObjectName(String JavaDoc vs) {
301         final Hashtable JavaDoc t = new Hashtable JavaDoc();
302         t.put("type", MonitoredObjectType.VIRTUAL_SERVER.getTypeName());
303         t.put("name", vs);
304         return ( formObjectName(t) );
305     }
306     static ObjectName JavaDoc getHttpListenerObjectName(String JavaDoc vs, String JavaDoc ls) {
307         final Hashtable JavaDoc t = new Hashtable JavaDoc();
308         t.put("type", MonitoredObjectType.HTTP_LISTENER.getTypeName());
309         t.put(MonitoredObjectType.VIRTUAL_SERVER.getTypeName(), vs);
310         t.put("name", ls);
311         return ( formObjectName(t) );
312     }
313     static ObjectName JavaDoc getApplicationObjectName(String JavaDoc app) {
314         final Hashtable JavaDoc t = new Hashtable JavaDoc();
315         t.put("type", MonitoredObjectType.APPLICATION.getTypeName());
316         t.put("name", app);
317         return ( formObjectName(t) );
318     }
319     static ObjectName JavaDoc getEjbModuleObjectName(String JavaDoc app, String JavaDoc module) {
320         final Hashtable JavaDoc t = new Hashtable JavaDoc();
321         t.put("name", module);
322         if (app != null) {
323             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
324             t.put("type", MonitoredObjectType.EJBMODULE.getTypeName());
325         }
326         else
327             t.put("type", MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName());
328         return ( formObjectName(t) );
329     }
330     static ObjectName JavaDoc getWebModuleObjectName(String JavaDoc app, String JavaDoc ctxRoot,
331                                                  String JavaDoc vs) {
332
333                 String JavaDoc module = "//" + ((vs==null) ? "DEFAULT" : vs) +
334                     (("".equals(ctxRoot)) ? "/" : ctxRoot);
335
336         final Hashtable JavaDoc t = new Hashtable JavaDoc();
337         t.put("name", module);
338
339         if (app != null) {
340             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
341             t.put("type", MonitoredObjectType.WEBMODULE.getTypeName());
342         }
343         else
344             t.put("type", MonitoredObjectType.STANDALONE_WEBMODULE.getTypeName());
345         return ( formObjectName(t) );
346     }
347     
348     static ObjectName JavaDoc getVirtualServerObjectName(String JavaDoc app,
349                                                      String JavaDoc ctxRoot,
350                                                      String JavaDoc vs) {
351
352         String JavaDoc module = "//" + ((vs==null) ? "DEFAULT" : vs) +
353             (("".equals(ctxRoot)) ? "/" : ctxRoot);
354
355         final Hashtable JavaDoc t = new Hashtable JavaDoc();
356         t.put("name", module);
357         t.put("type", MonitoredObjectType.WEBAPP_VIRTUAL_SERVER.getTypeName());
358
359         if (app != null) {
360             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
361         }
362         return ( formObjectName(t) );
363     }
364     
365     static ObjectName JavaDoc getServletObjectName(String JavaDoc app, String JavaDoc ctxRoot,
366                                                String JavaDoc vs, String JavaDoc servlet) {
367         
368         final ObjectName JavaDoc virtualServerObjectName =
369             getVirtualServerObjectName( app, ctxRoot, vs );
370
371         final Hashtable JavaDoc t = new Hashtable JavaDoc();
372         t.put("name", servlet);
373         t.put("type", MonitoredObjectType.SERVLET.getTypeName());
374         t.put(MonitoredObjectType.WEBAPP_VIRTUAL_SERVER.getTypeName(),
375             virtualServerObjectName.getKeyProperty( "name" ));
376
377         if (app != null) {
378             t.put(MonitoredObjectType.APPLICATION.getTypeName(), app);
379         }
380         return ( formObjectName(t) );
381     }
382     
383     // Connector modules, related changes
384
static ObjectName JavaDoc getConnectorServiceObjectName() {
385         
386         final Hashtable JavaDoc t = new Hashtable JavaDoc();
387         t.put("type",MonitoredObjectType.CONNECTOR_SERVICE.getTypeName());
388         return (formObjectName(t));
389     }
390     
391     static ObjectName JavaDoc getJmsServiceObjectName() {
392         
393         final Hashtable JavaDoc t = new Hashtable JavaDoc();
394         t.put("type",MonitoredObjectType.JMS_SERVICE.getTypeName());
395         return (formObjectName(t));
396     }
397     
398     static ObjectName JavaDoc getConnectorModuleObjectName(String JavaDoc j2eeAppName, String JavaDoc moduleName) {
399         
400         final Hashtable JavaDoc t = new Hashtable JavaDoc();
401         
402         if (j2eeAppName != null) {
403             t.put("name", j2eeAppName + "#" + moduleName);
404             t.put("type", MonitoredObjectType.CONNECTOR_MODULE.getTypeName());
405         }
406         else {
407             t.put("name", moduleName);
408             t.put("type", MonitoredObjectType.STANDALONE_CONNECTOR_MODULE.getTypeName());
409         }
410         return( formObjectName(t));
411     }
412     
413     static ObjectName JavaDoc getConnectorWorkMgmtObjectName(String JavaDoc j2eeAppName, String JavaDoc moduleName, boolean isJms) {
414         
415         final Hashtable JavaDoc t = new Hashtable JavaDoc();
416         
417         t.put("type", MonitoredObjectType.CONNECTOR_WORKMGMT.getTypeName());
418         if(!isJms) {
419             if(j2eeAppName != null) {
420                 t.put(MonitoredObjectType.CONNECTOR_MODULE.getTypeName(), j2eeAppName + "#" + moduleName);
421             } else
422             {
423                 t.put(MonitoredObjectType.STANDALONE_CONNECTOR_MODULE.getTypeName(), moduleName);
424             }
425         }
426         return (formObjectName(t));
427     }
428     
429     static ObjectName JavaDoc getConnectionFactoriesObjectName() {
430         final Hashtable JavaDoc t = new Hashtable JavaDoc();
431         t.put("type", MonitoredObjectType.CONNECTION_FACTORIES.getTypeName());
432         return(formObjectName(t));
433     }
434     
435     static ObjectName JavaDoc getConnectionFactoryObjectName(String JavaDoc factoryName) {
436         final Hashtable JavaDoc t = new Hashtable JavaDoc();
437         t.put("type", MonitoredObjectType.CONNECTION_FACTORY.getTypeName());
438         t.put("name", factoryName);
439         return(formObjectName(t));
440     }
441     
442     static ObjectName JavaDoc getConnectionPoolsObjectName(String JavaDoc j2eeAppName, String JavaDoc moduleName) {
443         final Hashtable JavaDoc t = new Hashtable JavaDoc();
444         t.put("type", MonitoredObjectType.CONNECTION_POOLS.getTypeName());
445         if(j2eeAppName != null) {
446             t.put(MonitoredObjectType.CONNECTOR_MODULE.getTypeName(), j2eeAppName + "#" + moduleName);
447         } else
448         {
449             t.put(MonitoredObjectType.STANDALONE_CONNECTOR_MODULE.getTypeName(), moduleName);
450         }
451         return(formObjectName(t));
452     }
453     
454     static ObjectName JavaDoc getConnectionPoolObjectName(String JavaDoc poolName, String JavaDoc j2eeAppName, String JavaDoc moduleName) {
455         final Hashtable JavaDoc t = new Hashtable JavaDoc();
456         t.put("type", MonitoredObjectType.CONNECTOR_CONN_POOL);
457         t.put("name", poolName);
458         if(j2eeAppName != null) {
459             t.put(MonitoredObjectType.CONNECTOR_MODULE.getTypeName(), j2eeAppName + "#" + moduleName);
460         } else
461         {
462             t.put(MonitoredObjectType.STANDALONE_CONNECTOR_MODULE.getTypeName(), moduleName);
463         }
464         return(formObjectName(t));
465     }
466     
467     // PWC integration related changes
468
static ObjectName JavaDoc getConnectionQueueObjectName() {
469         
470         final Hashtable JavaDoc t = new Hashtable JavaDoc();
471         t.put("type", MonitoredObjectType.CONNECTION_QUEUE.getTypeName());
472         return(formObjectName(t));
473     }
474     
475     static ObjectName JavaDoc getDnsObjectName() {
476         
477         final Hashtable JavaDoc t = new Hashtable JavaDoc();
478         t.put("type", MonitoredObjectType.DNS.getTypeName());
479         return(formObjectName(t));
480     }
481     
482     static ObjectName JavaDoc getKeepAliveObjectName() {
483         
484         final Hashtable JavaDoc t = new Hashtable JavaDoc();
485         t.put("type", MonitoredObjectType.KEEP_ALIVE.getTypeName());
486         return(formObjectName(t));
487     }
488     
489     static ObjectName JavaDoc getPWCThreadPoolObjectName() {
490         
491         final Hashtable JavaDoc t = new Hashtable JavaDoc();
492         t.put("type", MonitoredObjectType.PWC_THREAD_POOL.getTypeName());
493         return(formObjectName(t));
494     }
495     
496     static ObjectName JavaDoc getFileCacheObjectName() {
497         
498         final Hashtable JavaDoc t = new Hashtable JavaDoc();
499         t.put("type", MonitoredObjectType.FILE_CACHE.getTypeName());
500         return(formObjectName(t));
501     }
502     
503     static ObjectName JavaDoc getRequestObjectName(String JavaDoc vsId) {
504         
505         final Hashtable JavaDoc t = new Hashtable JavaDoc();
506         t.put("type", MonitoredObjectType.REQUEST.getTypeName());
507         t.put(MonitoredObjectType.VIRTUAL_SERVER.getTypeName(), vsId);
508         return(formObjectName(t));
509     }
510     
511     static ObjectName JavaDoc getStatefulSessionStoreObjectName(String JavaDoc ejbName, String JavaDoc moduleName, String JavaDoc j2eeAppName) {
512         
513         final Hashtable JavaDoc t = new Hashtable JavaDoc();
514         t.put("type", MonitoredObjectType.SESSION_STORE.getTypeName());
515         t.put("name", MonitoredObjectType.SESSION_STORE.getTypeName());
516         t.put(MonitoredObjectType.EJB.getTypeName(), ejbName);
517         if (j2eeAppName != null) {
518             t.put(MonitoredObjectType.APPLICATION.getTypeName(), j2eeAppName);
519             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), moduleName);
520         }
521         else {
522             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(), moduleName);
523         }
524         return ( formObjectName(t) );
525     }
526     
527     static ObjectName JavaDoc getTimerObjectName(String JavaDoc ejbName, String JavaDoc moduleName, String JavaDoc j2eeAppName) {
528         
529         final Hashtable JavaDoc t = new Hashtable JavaDoc();
530         t.put("type", MonitoredObjectType.TIMERS.getTypeName());
531         t.put("name", MonitoredObjectType.TIMERS.getTypeName());
532         t.put(MonitoredObjectType.EJB.getTypeName(), ejbName);
533         if (j2eeAppName != null) {
534             t.put(MonitoredObjectType.APPLICATION.getTypeName(), j2eeAppName);
535             t.put(MonitoredObjectType.EJBMODULE.getTypeName(), moduleName);
536         }
537         else {
538             t.put(MonitoredObjectType.STANDALONE_EJBMODULE.getTypeName(), moduleName);
539         }
540         return ( formObjectName(t) );
541     }
542     
543     // JVM1.5 related changes - BEGIN
544
static ObjectName JavaDoc getJVMCompilationObjectName() {
545         
546         final Hashtable JavaDoc t = new Hashtable JavaDoc();
547         t.put("type", MonitoredObjectType.JVM_COMPILATION.getTypeName());
548         t.put("name", MonitoredObjectType.JVM_COMPILATION.getTypeName());
549         return(formObjectName(t));
550     }
551     
552     static ObjectName JavaDoc getJVMClassLoadingObjectName() {
553         
554         final Hashtable JavaDoc t = new Hashtable JavaDoc();
555         t.put("type", MonitoredObjectType.JVM_CLASSLOADING.getTypeName());
556         t.put("name", MonitoredObjectType.JVM_CLASSLOADING.getTypeName());
557         return(formObjectName(t));
558     }
559     
560     static ObjectName JavaDoc getJVMRuntimeObjectName() {
561         
562         final Hashtable JavaDoc t = new Hashtable JavaDoc();
563         t.put("type", MonitoredObjectType.JVM_RUNTIME.getTypeName());
564         t.put("name", MonitoredObjectType.JVM_RUNTIME.getTypeName());
565         return(formObjectName(t));
566     }
567     
568     static ObjectName JavaDoc getJVMOSObjectName() {
569         
570         final Hashtable JavaDoc t = new Hashtable JavaDoc();
571         t.put("type", MonitoredObjectType.JVM_OS.getTypeName());
572         t.put("name", MonitoredObjectType.JVM_OS.getTypeName());
573         return(formObjectName(t));
574     }
575     
576     
577     static ObjectName JavaDoc getJVMGCSSObjectName() {
578         
579         final Hashtable JavaDoc t = new Hashtable JavaDoc();
580         t.put("type", MonitoredObjectType.JVM_GCS.getTypeName());
581         t.put("name", MonitoredObjectType.JVM_GCS.getTypeName());
582         return(formObjectName(t));
583     }
584     
585     
586     static ObjectName JavaDoc getJVMGCObjectName(String JavaDoc gcName) {
587         
588         final Hashtable JavaDoc t = new Hashtable JavaDoc();
589         t.put("type", MonitoredObjectType.JVM_GC.getTypeName());
590         t.put("name", gcName);
591         return(formObjectName(t));
592     }
593     
594     static ObjectName JavaDoc getJVMMemoryObjectName() {
595         
596         final Hashtable JavaDoc t = new Hashtable JavaDoc();
597         t.put("type", MonitoredObjectType.JVM_MEMORY.getTypeName());
598         t.put("name", MonitoredObjectType.JVM_MEMORY.getTypeName());
599         return(formObjectName(t));
600     }
601     
602     static ObjectName JavaDoc getJVMThreadObjectName() {
603         
604         final Hashtable JavaDoc t = new Hashtable JavaDoc();
605         t.put("type", MonitoredObjectType.JVM_THREAD.getTypeName());
606         t.put("name", MonitoredObjectType.JVM_THREAD.getTypeName());
607         return(formObjectName(t));
608     }
609     
610     static ObjectName JavaDoc getJVMThreadInfoObjectName(String JavaDoc threadName) {
611         
612         final Hashtable JavaDoc t = new Hashtable JavaDoc();
613         t.put("type", MonitoredObjectType.JVM_THREAD_INFO.getTypeName());
614         t.put("name", threadName);
615         return(formObjectName(t));
616     }
617     // JVM1.5 related changes - END
618
}
619
Popular Tags