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