blob: ee9e698f64959466f9c2616eb5bb2ff114434c24 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26package sun.management.snmp.jvmmib;
27
28//
29// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
30//
31
32// java imports
33//
34import java.io.Serializable;
35import java.util.Hashtable;
36
37// jmx imports
38//
39import javax.management.MBeanServer;
40import javax.management.ObjectName;
41import javax.management.InstanceAlreadyExistsException;
42
43// jdmk imports
44//
45import com.sun.jmx.snmp.agent.SnmpMib;
46import com.sun.jmx.snmp.agent.SnmpMibNode;
47import com.sun.jmx.snmp.agent.SnmpMibTable;
48import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
49
50/**
51 * The class is used for representing "JVM-MANAGEMENT-MIB".
52 * You can edit the file if you want to modify the behaviour of the MIB.
53 */
54public abstract class JVM_MANAGEMENT_MIB extends SnmpMib implements Serializable {
55
56 /**
57 * Default constructor. Initialize the Mib tree.
58 */
59 public JVM_MANAGEMENT_MIB() {
60 mibName = "JVM_MANAGEMENT_MIB";
61 }
62
63 /**
64 * Initialization of the MIB with no registration in Java DMK.
65 */
66 public void init() throws IllegalAccessException {
67 // Allow only one initialization of the MIB.
68 //
69 if (isInitialized == true) {
70 return ;
71 }
72
73 try {
74 populate(null, null);
75 } catch(IllegalAccessException x) {
76 throw x;
77 } catch(RuntimeException x) {
78 throw x;
79 } catch(Exception x) {
80 throw new Error(x.getMessage());
81 }
82
83 isInitialized = true;
84 }
85
86 /**
87 * Initialization of the MIB with AUTOMATIC REGISTRATION in Java DMK.
88 */
89 public ObjectName preRegister(MBeanServer server, ObjectName name)
90 throws Exception {
91 // Allow only one initialization of the MIB.
92 //
93 if (isInitialized == true) {
94 throw new InstanceAlreadyExistsException();
95 }
96
97 // Initialize MBeanServer information.
98 //
99 this.server = server;
100
101 populate(server, name);
102
103 isInitialized = true;
104 return name;
105 }
106
107 /**
108 * Initialization of the MIB with no registration in Java DMK.
109 */
110 public void populate(MBeanServer server, ObjectName name)
111 throws Exception {
112 // Allow only one initialization of the MIB.
113 //
114 if (isInitialized == true) {
115 return ;
116 }
117
118 if (objectserver == null)
119 objectserver = new SnmpStandardObjectServer();
120
121 // Initialization of the "JvmOS" group.
122 // To disable support of this group, redefine the
123 // "createJvmOSMetaNode()" factory method, and make it return "null"
124 //
125 initJvmOS(server);
126
127 // Initialization of the "JvmCompilation" group.
128 // To disable support of this group, redefine the
129 // "createJvmCompilationMetaNode()" factory method, and make it return "null"
130 //
131 initJvmCompilation(server);
132
133 // Initialization of the "JvmRuntime" group.
134 // To disable support of this group, redefine the
135 // "createJvmRuntimeMetaNode()" factory method, and make it return "null"
136 //
137 initJvmRuntime(server);
138
139 // Initialization of the "JvmThreading" group.
140 // To disable support of this group, redefine the
141 // "createJvmThreadingMetaNode()" factory method, and make it return "null"
142 //
143 initJvmThreading(server);
144
145 // Initialization of the "JvmMemory" group.
146 // To disable support of this group, redefine the
147 // "createJvmMemoryMetaNode()" factory method, and make it return "null"
148 //
149 initJvmMemory(server);
150
151 // Initialization of the "JvmClassLoading" group.
152 // To disable support of this group, redefine the
153 // "createJvmClassLoadingMetaNode()" factory method, and make it return "null"
154 //
155 initJvmClassLoading(server);
156
157 isInitialized = true;
158 }
159
160
161 // ------------------------------------------------------------
162 //
163 // Initialization of the "JvmOS" group.
164 //
165 // ------------------------------------------------------------
166
167
168 /**
169 * Initialization of the "JvmOS" group.
170 *
171 * To disable support of this group, redefine the
172 * "createJvmOSMetaNode()" factory method, and make it return "null"
173 *
174 * @param server MBeanServer for this group (may be null)
175 *
176 **/
177 protected void initJvmOS(MBeanServer server)
178 throws Exception {
179 final String oid = getGroupOid("JvmOS", "1.3.6.1.4.1.42.2.145.3.163.1.1.6");
180 ObjectName objname = null;
181 if (server != null) {
182 objname = getGroupObjectName("JvmOS", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmOS");
183 }
184 final JvmOSMeta meta = createJvmOSMetaNode("JvmOS", oid, objname, server);
185 if (meta != null) {
186 meta.registerTableNodes( this, server );
187
188 // Note that when using standard metadata,
189 // the returned object must implement the "JvmOSMBean"
190 // interface.
191 //
192 final JvmOSMBean group = (JvmOSMBean) createJvmOSMBean("JvmOS", oid, objname, server);
193 meta.setInstance( group );
194 registerGroupNode("JvmOS", oid, objname, meta, group, server);
195 }
196 }
197
198
199 /**
200 * Factory method for "JvmOS" group metadata class.
201 *
202 * You can redefine this method if you need to replace the default
203 * generated metadata class with your own customized class.
204 *
205 * @param groupName Name of the group ("JvmOS")
206 * @param groupOid OID of this group
207 * @param groupObjname ObjectName for this group (may be null)
208 * @param server MBeanServer for this group (may be null)
209 *
210 * @return An instance of the metadata class generated for the
211 * "JvmOS" group (JvmOSMeta)
212 *
213 **/
214 protected JvmOSMeta createJvmOSMetaNode(String groupName,
215 String groupOid, ObjectName groupObjname, MBeanServer server) {
216 return new JvmOSMeta(this, objectserver);
217 }
218
219
220 /**
221 * Factory method for "JvmOS" group MBean.
222 *
223 * You can redefine this method if you need to replace the default
224 * generated MBean class with your own customized class.
225 *
226 * @param groupName Name of the group ("JvmOS")
227 * @param groupOid OID of this group
228 * @param groupObjname ObjectName for this group (may be null)
229 * @param server MBeanServer for this group (may be null)
230 *
231 * @return An instance of the MBean class generated for the
232 * "JvmOS" group (JvmOS)
233 *
234 * Note that when using standard metadata,
235 * the returned object must implement the "JvmOSMBean"
236 * interface.
237 **/
238 protected abstract Object createJvmOSMBean(String groupName,
239 String groupOid, ObjectName groupObjname, MBeanServer server);
240
241
242 // ------------------------------------------------------------
243 //
244 // Initialization of the "JvmCompilation" group.
245 //
246 // ------------------------------------------------------------
247
248
249 /**
250 * Initialization of the "JvmCompilation" group.
251 *
252 * To disable support of this group, redefine the
253 * "createJvmCompilationMetaNode()" factory method, and make it return "null"
254 *
255 * @param server MBeanServer for this group (may be null)
256 *
257 **/
258 protected void initJvmCompilation(MBeanServer server)
259 throws Exception {
260 final String oid = getGroupOid("JvmCompilation", "1.3.6.1.4.1.42.2.145.3.163.1.1.5");
261 ObjectName objname = null;
262 if (server != null) {
263 objname = getGroupObjectName("JvmCompilation", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmCompilation");
264 }
265 final JvmCompilationMeta meta = createJvmCompilationMetaNode("JvmCompilation", oid, objname, server);
266 if (meta != null) {
267 meta.registerTableNodes( this, server );
268
269 // Note that when using standard metadata,
270 // the returned object must implement the "JvmCompilationMBean"
271 // interface.
272 //
273 final JvmCompilationMBean group = (JvmCompilationMBean) createJvmCompilationMBean("JvmCompilation", oid, objname, server);
274 meta.setInstance( group );
275 registerGroupNode("JvmCompilation", oid, objname, meta, group, server);
276 }
277 }
278
279
280 /**
281 * Factory method for "JvmCompilation" group metadata class.
282 *
283 * You can redefine this method if you need to replace the default
284 * generated metadata class with your own customized class.
285 *
286 * @param groupName Name of the group ("JvmCompilation")
287 * @param groupOid OID of this group
288 * @param groupObjname ObjectName for this group (may be null)
289 * @param server MBeanServer for this group (may be null)
290 *
291 * @return An instance of the metadata class generated for the
292 * "JvmCompilation" group (JvmCompilationMeta)
293 *
294 **/
295 protected JvmCompilationMeta createJvmCompilationMetaNode(String groupName,
296 String groupOid, ObjectName groupObjname, MBeanServer server) {
297 return new JvmCompilationMeta(this, objectserver);
298 }
299
300
301 /**
302 * Factory method for "JvmCompilation" group MBean.
303 *
304 * You can redefine this method if you need to replace the default
305 * generated MBean class with your own customized class.
306 *
307 * @param groupName Name of the group ("JvmCompilation")
308 * @param groupOid OID of this group
309 * @param groupObjname ObjectName for this group (may be null)
310 * @param server MBeanServer for this group (may be null)
311 *
312 * @return An instance of the MBean class generated for the
313 * "JvmCompilation" group (JvmCompilation)
314 *
315 * Note that when using standard metadata,
316 * the returned object must implement the "JvmCompilationMBean"
317 * interface.
318 **/
319 protected abstract Object createJvmCompilationMBean(String groupName,
320 String groupOid, ObjectName groupObjname, MBeanServer server);
321
322
323 // ------------------------------------------------------------
324 //
325 // Initialization of the "JvmRuntime" group.
326 //
327 // ------------------------------------------------------------
328
329
330 /**
331 * Initialization of the "JvmRuntime" group.
332 *
333 * To disable support of this group, redefine the
334 * "createJvmRuntimeMetaNode()" factory method, and make it return "null"
335 *
336 * @param server MBeanServer for this group (may be null)
337 *
338 **/
339 protected void initJvmRuntime(MBeanServer server)
340 throws Exception {
341 final String oid = getGroupOid("JvmRuntime", "1.3.6.1.4.1.42.2.145.3.163.1.1.4");
342 ObjectName objname = null;
343 if (server != null) {
344 objname = getGroupObjectName("JvmRuntime", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmRuntime");
345 }
346 final JvmRuntimeMeta meta = createJvmRuntimeMetaNode("JvmRuntime", oid, objname, server);
347 if (meta != null) {
348 meta.registerTableNodes( this, server );
349
350 // Note that when using standard metadata,
351 // the returned object must implement the "JvmRuntimeMBean"
352 // interface.
353 //
354 final JvmRuntimeMBean group = (JvmRuntimeMBean) createJvmRuntimeMBean("JvmRuntime", oid, objname, server);
355 meta.setInstance( group );
356 registerGroupNode("JvmRuntime", oid, objname, meta, group, server);
357 }
358 }
359
360
361 /**
362 * Factory method for "JvmRuntime" group metadata class.
363 *
364 * You can redefine this method if you need to replace the default
365 * generated metadata class with your own customized class.
366 *
367 * @param groupName Name of the group ("JvmRuntime")
368 * @param groupOid OID of this group
369 * @param groupObjname ObjectName for this group (may be null)
370 * @param server MBeanServer for this group (may be null)
371 *
372 * @return An instance of the metadata class generated for the
373 * "JvmRuntime" group (JvmRuntimeMeta)
374 *
375 **/
376 protected JvmRuntimeMeta createJvmRuntimeMetaNode(String groupName,
377 String groupOid, ObjectName groupObjname, MBeanServer server) {
378 return new JvmRuntimeMeta(this, objectserver);
379 }
380
381
382 /**
383 * Factory method for "JvmRuntime" group MBean.
384 *
385 * You can redefine this method if you need to replace the default
386 * generated MBean class with your own customized class.
387 *
388 * @param groupName Name of the group ("JvmRuntime")
389 * @param groupOid OID of this group
390 * @param groupObjname ObjectName for this group (may be null)
391 * @param server MBeanServer for this group (may be null)
392 *
393 * @return An instance of the MBean class generated for the
394 * "JvmRuntime" group (JvmRuntime)
395 *
396 * Note that when using standard metadata,
397 * the returned object must implement the "JvmRuntimeMBean"
398 * interface.
399 **/
400 protected abstract Object createJvmRuntimeMBean(String groupName,
401 String groupOid, ObjectName groupObjname, MBeanServer server);
402
403
404 // ------------------------------------------------------------
405 //
406 // Initialization of the "JvmThreading" group.
407 //
408 // ------------------------------------------------------------
409
410
411 /**
412 * Initialization of the "JvmThreading" group.
413 *
414 * To disable support of this group, redefine the
415 * "createJvmThreadingMetaNode()" factory method, and make it return "null"
416 *
417 * @param server MBeanServer for this group (may be null)
418 *
419 **/
420 protected void initJvmThreading(MBeanServer server)
421 throws Exception {
422 final String oid = getGroupOid("JvmThreading", "1.3.6.1.4.1.42.2.145.3.163.1.1.3");
423 ObjectName objname = null;
424 if (server != null) {
425 objname = getGroupObjectName("JvmThreading", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmThreading");
426 }
427 final JvmThreadingMeta meta = createJvmThreadingMetaNode("JvmThreading", oid, objname, server);
428 if (meta != null) {
429 meta.registerTableNodes( this, server );
430
431 // Note that when using standard metadata,
432 // the returned object must implement the "JvmThreadingMBean"
433 // interface.
434 //
435 final JvmThreadingMBean group = (JvmThreadingMBean) createJvmThreadingMBean("JvmThreading", oid, objname, server);
436 meta.setInstance( group );
437 registerGroupNode("JvmThreading", oid, objname, meta, group, server);
438 }
439 }
440
441
442 /**
443 * Factory method for "JvmThreading" group metadata class.
444 *
445 * You can redefine this method if you need to replace the default
446 * generated metadata class with your own customized class.
447 *
448 * @param groupName Name of the group ("JvmThreading")
449 * @param groupOid OID of this group
450 * @param groupObjname ObjectName for this group (may be null)
451 * @param server MBeanServer for this group (may be null)
452 *
453 * @return An instance of the metadata class generated for the
454 * "JvmThreading" group (JvmThreadingMeta)
455 *
456 **/
457 protected JvmThreadingMeta createJvmThreadingMetaNode(String groupName,
458 String groupOid, ObjectName groupObjname, MBeanServer server) {
459 return new JvmThreadingMeta(this, objectserver);
460 }
461
462
463 /**
464 * Factory method for "JvmThreading" group MBean.
465 *
466 * You can redefine this method if you need to replace the default
467 * generated MBean class with your own customized class.
468 *
469 * @param groupName Name of the group ("JvmThreading")
470 * @param groupOid OID of this group
471 * @param groupObjname ObjectName for this group (may be null)
472 * @param server MBeanServer for this group (may be null)
473 *
474 * @return An instance of the MBean class generated for the
475 * "JvmThreading" group (JvmThreading)
476 *
477 * Note that when using standard metadata,
478 * the returned object must implement the "JvmThreadingMBean"
479 * interface.
480 **/
481 protected abstract Object createJvmThreadingMBean(String groupName,
482 String groupOid, ObjectName groupObjname, MBeanServer server);
483
484
485 // ------------------------------------------------------------
486 //
487 // Initialization of the "JvmMemory" group.
488 //
489 // ------------------------------------------------------------
490
491
492 /**
493 * Initialization of the "JvmMemory" group.
494 *
495 * To disable support of this group, redefine the
496 * "createJvmMemoryMetaNode()" factory method, and make it return "null"
497 *
498 * @param server MBeanServer for this group (may be null)
499 *
500 **/
501 protected void initJvmMemory(MBeanServer server)
502 throws Exception {
503 final String oid = getGroupOid("JvmMemory", "1.3.6.1.4.1.42.2.145.3.163.1.1.2");
504 ObjectName objname = null;
505 if (server != null) {
506 objname = getGroupObjectName("JvmMemory", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmMemory");
507 }
508 final JvmMemoryMeta meta = createJvmMemoryMetaNode("JvmMemory", oid, objname, server);
509 if (meta != null) {
510 meta.registerTableNodes( this, server );
511
512 // Note that when using standard metadata,
513 // the returned object must implement the "JvmMemoryMBean"
514 // interface.
515 //
516 final JvmMemoryMBean group = (JvmMemoryMBean) createJvmMemoryMBean("JvmMemory", oid, objname, server);
517 meta.setInstance( group );
518 registerGroupNode("JvmMemory", oid, objname, meta, group, server);
519 }
520 }
521
522
523 /**
524 * Factory method for "JvmMemory" group metadata class.
525 *
526 * You can redefine this method if you need to replace the default
527 * generated metadata class with your own customized class.
528 *
529 * @param groupName Name of the group ("JvmMemory")
530 * @param groupOid OID of this group
531 * @param groupObjname ObjectName for this group (may be null)
532 * @param server MBeanServer for this group (may be null)
533 *
534 * @return An instance of the metadata class generated for the
535 * "JvmMemory" group (JvmMemoryMeta)
536 *
537 **/
538 protected JvmMemoryMeta createJvmMemoryMetaNode(String groupName,
539 String groupOid, ObjectName groupObjname, MBeanServer server) {
540 return new JvmMemoryMeta(this, objectserver);
541 }
542
543
544 /**
545 * Factory method for "JvmMemory" group MBean.
546 *
547 * You can redefine this method if you need to replace the default
548 * generated MBean class with your own customized class.
549 *
550 * @param groupName Name of the group ("JvmMemory")
551 * @param groupOid OID of this group
552 * @param groupObjname ObjectName for this group (may be null)
553 * @param server MBeanServer for this group (may be null)
554 *
555 * @return An instance of the MBean class generated for the
556 * "JvmMemory" group (JvmMemory)
557 *
558 * Note that when using standard metadata,
559 * the returned object must implement the "JvmMemoryMBean"
560 * interface.
561 **/
562 protected abstract Object createJvmMemoryMBean(String groupName,
563 String groupOid, ObjectName groupObjname, MBeanServer server);
564
565
566 // ------------------------------------------------------------
567 //
568 // Initialization of the "JvmClassLoading" group.
569 //
570 // ------------------------------------------------------------
571
572
573 /**
574 * Initialization of the "JvmClassLoading" group.
575 *
576 * To disable support of this group, redefine the
577 * "createJvmClassLoadingMetaNode()" factory method, and make it return "null"
578 *
579 * @param server MBeanServer for this group (may be null)
580 *
581 **/
582 protected void initJvmClassLoading(MBeanServer server)
583 throws Exception {
584 final String oid = getGroupOid("JvmClassLoading", "1.3.6.1.4.1.42.2.145.3.163.1.1.1");
585 ObjectName objname = null;
586 if (server != null) {
587 objname = getGroupObjectName("JvmClassLoading", oid, mibName + ":name=sun.management.snmp.jvmmib.JvmClassLoading");
588 }
589 final JvmClassLoadingMeta meta = createJvmClassLoadingMetaNode("JvmClassLoading", oid, objname, server);
590 if (meta != null) {
591 meta.registerTableNodes( this, server );
592
593 // Note that when using standard metadata,
594 // the returned object must implement the "JvmClassLoadingMBean"
595 // interface.
596 //
597 final JvmClassLoadingMBean group = (JvmClassLoadingMBean) createJvmClassLoadingMBean("JvmClassLoading", oid, objname, server);
598 meta.setInstance( group );
599 registerGroupNode("JvmClassLoading", oid, objname, meta, group, server);
600 }
601 }
602
603
604 /**
605 * Factory method for "JvmClassLoading" group metadata class.
606 *
607 * You can redefine this method if you need to replace the default
608 * generated metadata class with your own customized class.
609 *
610 * @param groupName Name of the group ("JvmClassLoading")
611 * @param groupOid OID of this group
612 * @param groupObjname ObjectName for this group (may be null)
613 * @param server MBeanServer for this group (may be null)
614 *
615 * @return An instance of the metadata class generated for the
616 * "JvmClassLoading" group (JvmClassLoadingMeta)
617 *
618 **/
619 protected JvmClassLoadingMeta createJvmClassLoadingMetaNode(String groupName,
620 String groupOid, ObjectName groupObjname, MBeanServer server) {
621 return new JvmClassLoadingMeta(this, objectserver);
622 }
623
624
625 /**
626 * Factory method for "JvmClassLoading" group MBean.
627 *
628 * You can redefine this method if you need to replace the default
629 * generated MBean class with your own customized class.
630 *
631 * @param groupName Name of the group ("JvmClassLoading")
632 * @param groupOid OID of this group
633 * @param groupObjname ObjectName for this group (may be null)
634 * @param server MBeanServer for this group (may be null)
635 *
636 * @return An instance of the MBean class generated for the
637 * "JvmClassLoading" group (JvmClassLoading)
638 *
639 * Note that when using standard metadata,
640 * the returned object must implement the "JvmClassLoadingMBean"
641 * interface.
642 **/
643 protected abstract Object createJvmClassLoadingMBean(String groupName,
644 String groupOid, ObjectName groupObjname, MBeanServer server);
645
646
647 // ------------------------------------------------------------
648 //
649 // Implements the "registerTableMeta" method defined in "SnmpMib".
650 // See the "SnmpMib" Javadoc API for more details.
651 //
652 // ------------------------------------------------------------
653
654 public void registerTableMeta( String name, SnmpMibTable meta) {
655 if (metadatas == null) return;
656 if (name == null) return;
657 metadatas.put(name,meta);
658 }
659
660
661 // ------------------------------------------------------------
662 //
663 // Implements the "getRegisteredTableMeta" method defined in "SnmpMib".
664 // See the "SnmpMib" Javadoc API for more details.
665 //
666 // ------------------------------------------------------------
667
668 public SnmpMibTable getRegisteredTableMeta( String name ) {
669 if (metadatas == null) return null;
670 if (name == null) return null;
671 return metadatas.get(name);
672 }
673
674 public SnmpStandardObjectServer getStandardObjectServer() {
675 if (objectserver == null)
676 objectserver = new SnmpStandardObjectServer();
677 return objectserver;
678 }
679
680 private boolean isInitialized = false;
681
682 protected SnmpStandardObjectServer objectserver;
683
684 protected final Hashtable<String, SnmpMibTable> metadatas =
685 new Hashtable<String, SnmpMibTable>();
686}