1 22 23 package org.snmp4j.agent.mo.jmx.mibs; 24 25 import java.io.File ; 26 import java.lang.management.ManagementFactory ; 27 import java.lang.management.MemoryType ; 28 import java.util.Arrays ; 29 import java.util.HashMap ; 30 import java.util.Map ; 31 import javax.management.MBeanServerConnection ; 32 import javax.management.MalformedObjectNameException ; 33 import javax.management.ObjectName ; 34 35 import org.snmp4j.agent.*; 36 import org.snmp4j.agent.mo.MOScalar; 37 import org.snmp4j.agent.mo.jmx.*; 38 import org.snmp4j.agent.mo.jmx.MBeanNotificationInfo; 39 import org.snmp4j.agent.mo.jmx.types.*; 40 import org.snmp4j.agent.mo.jmx.util.AbstractSyntheticJMXIndexSupport; 41 import org.snmp4j.agent.mo.snmp.smi.EnumerationConstraint; 42 import org.snmp4j.agent.mo.snmp.smi.ValueConstraint; 43 import org.snmp4j.agent.mo.snmp.smi.ValueConstraintValidator; 44 import org.snmp4j.smi.Counter64; 45 import org.snmp4j.smi.OID; 46 import org.snmp4j.smi.OctetString; 47 import org.snmp4j.smi.Variable; 48 49 58 public class JvmManagementMibInst extends JvmManagementMib { 59 60 private static final OID[] ACTION_OIDS = new OID[] { 61 JvmManagementMib.oidJvmMemoryGCCall 62 }; 63 64 private static final MBeanNotificationObjectInfo[] jvmLowMemoryPoolUsageNotif = 65 new MBeanNotificationObjectInfo[] { 66 new MBeanNotificationObjectInfo( 67 new OID(JvmManagementMib.oidJvmMemPoolEntry.getValue(), 68 new int[] { JvmManagementMib.colJvmMemPoolName }), 69 new OctetString(), new TypedAttribute("poolName", String .class)), 70 new MBeanNotificationObjectInfo( 71 new OID(JvmManagementMib.oidJvmMemPoolEntry.getValue(), 72 new int[] { JvmManagementMib.colJvmMemPoolUsed }), 73 new Counter64(), 74 new TypedCompositeDataAttribute("usage", "used", Long .class)), 75 new MBeanNotificationObjectInfo( 76 new OID(JvmManagementMib.oidJvmMemPoolEntry.getValue(), 77 new int[] { JvmManagementMib.colJvmMemPoolThreshdCount }), 78 new Counter64(), new TypedAttribute("count", Long .class)) 79 }; 80 81 private static final MBeanNotificationObjectInfo[] jvmLowMemoryPoolCollectNotif = 82 new MBeanNotificationObjectInfo[] { 83 new MBeanNotificationObjectInfo( 84 new OID(JvmManagementMib.oidJvmMemPoolEntry.getValue(), 85 new int[] { JvmManagementMib.colJvmMemPoolName }), 86 new OctetString(), new TypedAttribute("poolName", String .class)), 87 new MBeanNotificationObjectInfo( 88 new OID(JvmManagementMib.oidJvmMemPoolEntry.getValue(), 89 new int[] { JvmManagementMib.colJvmMemPoolCollectUsed }), 90 new Counter64(), 91 new TypedCompositeDataAttribute("usage", "used", Long .class)), 92 new MBeanNotificationObjectInfo( 93 new OID(JvmManagementMib.oidJvmMemPoolEntry.getValue(), 94 new int[] { JvmManagementMib.colJvmMemPoolCollectThreshdCount }), 95 new Counter64(), new TypedAttribute("count", Long .class)) 96 }; 97 98 private static final Object [][] SCALAR_MBEANS_JVM_MEMORY_ACTIONS = { 99 { JvmManagementMib.oidJvmMemoryGCCall, 100 new MBeanStateInfo[] { 101 new MBeanStateInfo(2, null, null) 102 }, 103 new MBeanActionInfo[] { 104 new MBeanActionInfo(3, "gc", new Object [0]) 105 } 106 } 107 }; 108 109 private static final Object [][] SCALAR_MBEANS_JVM_MEMORY = { 110 { JvmManagementMib.oidJvmMemoryPendingFinalCount, 111 "ObjectPendingFinalizationCount", Long .class }, 112 { JvmManagementMib.oidJvmMemoryGCVerboseLevel, 113 new InverseBooleanType("Verbose") }, 114 { JvmManagementMib.oidJvmMemoryHeapInitSize, 116 new TypedCompositeDataAttribute("HeapMemoryUsage", "init", Long .class) }, 117 { JvmManagementMib.oidJvmMemoryHeapUsed, 118 new TypedCompositeDataAttribute("HeapMemoryUsage", "used", Long .class) }, 119 { JvmManagementMib.oidJvmMemoryHeapCommitted, 120 new TypedCompositeDataAttribute("HeapMemoryUsage", "committed", Long .class) }, 121 { JvmManagementMib.oidJvmMemoryHeapMaxSize, 122 new TypedCompositeDataAttribute("HeapMemoryUsage", "max", Long .class) }, 123 124 { JvmManagementMib.oidJvmMemoryNonHeapInitSize, 125 new TypedCompositeDataAttribute("NonHeapMemoryUsage", "init", Long .class) }, 126 { JvmManagementMib.oidJvmMemoryNonHeapUsed, 127 new TypedCompositeDataAttribute("NonHeapMemoryUsage", "used", Long .class) }, 128 { JvmManagementMib.oidJvmMemoryNonHeapCommitted, 129 new TypedCompositeDataAttribute("NonHeapMemoryUsage", "committed", Long .class) }, 130 { JvmManagementMib.oidJvmMemoryNonHeapMaxSize, 131 new TypedCompositeDataAttribute("NonHeapMemoryUsage", "max", Long .class) } 132 133 }; 134 135 private static final Object [][] SCALAR_MBEANS_JVM_CLASSES = { 136 { JvmManagementMib.oidJvmClassesLoadedCount, 137 "LoadedClassCount", Integer .class }, 138 { JvmManagementMib.oidJvmClassesTotalLoadedCount, 139 "TotalLoadedClassCount", Long .class }, 140 { JvmManagementMib.oidJvmClassesUnloadedCount, 141 "UnloadedClassCount", Long .class }, 142 { JvmManagementMib.oidJvmClassesVerboseLevel, 143 new InverseBooleanType("Verbose")}, 144 }; 145 146 private static final Object [][] SCALAR_MBEANS_JVM_RUNTIME = { 147 { JvmManagementMib.oidJvmRTName, "Name", String .class }, 148 { JvmManagementMib.oidJvmRTVMName, "VmName", String .class }, 149 { JvmManagementMib.oidJvmRTVMVendor, "VmVendor", String .class }, 150 { JvmManagementMib.oidJvmRTVMVersion, "VmVersion", String .class }, 151 { JvmManagementMib.oidJvmRTSpecName, "SpecName", String .class }, 152 { JvmManagementMib.oidJvmRTSpecVendor, "SpecVendor", String .class }, 153 { JvmManagementMib.oidJvmRTSpecVersion, "SpecVersion", String .class }, 154 { JvmManagementMib.oidJvmRTManagementSpecVersion, "ManagementSpecVersion", 155 String .class }, 156 { JvmManagementMib.oidJvmRTBootClassPathSupport, 157 new InverseBooleanType("BootClassPathSupported") }, 158 { JvmManagementMib.oidJvmRTInputArgsCount,"InputArguments", Long .class }, 159 { JvmManagementMib.oidJvmRTUptimeMs, "Uptime", Long .class }, 160 { JvmManagementMib.oidJvmRTStartTimeMs, "StartTime", Long .class } 161 162 }; 163 164 private static final Object [][] SCALAR_MBEANS_JIT_COMPILER = { 165 { JvmManagementMib.oidJvmJITCompilerName, "Name", String .class }, 166 { JvmManagementMib.oidJvmJITCompilerTimeMs, 167 "TotalCompilationTime", Long .class }, 168 { JvmManagementMib.oidJvmJITCompilerTimeMonitoring, 169 new InverseBooleanType("CompilationTimeMonitoringSupported") } 170 }; 171 172 private static final Object [][] SCALAR_MBEANS_JVM_OS = { 173 { JvmManagementMib.oidJvmOSName, "Name", String .class }, 174 { JvmManagementMib.oidJvmOSArch, "Arch", String .class }, 175 { JvmManagementMib.oidJvmOSVersion, "Version", String .class }, 176 { JvmManagementMib.oidJvmOSProcessorCount, "AvailableProcessors", 177 Integer .class } 178 }; 179 180 private static final Object [][] SCALAR_MBEANS_JVM_THREADING = { 181 { JvmManagementMib.oidJvmThreadCount, "ThreadCount", Integer .class }, 182 { JvmManagementMib.oidJvmThreadDaemonCount, "DaemonThreadCount", Integer .class }, 183 { JvmManagementMib.oidJvmThreadPeakCount, "PeakThreadCount", Integer .class }, 184 { JvmManagementMib.oidJvmThreadTotalStartedCount, "TotalStartedThreadCount", 185 Integer .class }, 186 { JvmManagementMib.oidJvmThreadPeakCount, "PeakThreadCount", Integer .class }, 187 { JvmManagementMib.oidJvmThreadContentionMonitoring, 188 new CombinedTypedAttribute("", 189 Integer .class, 190 new TypedAttribute[] { 191 new Boolean2IntegerType("ThreadContentionMonitoringSupported", 192 null, new Integer (1)), 193 new Boolean2IntegerType("ThreadContentionMonitoringEnabled", 194 new Integer (3), new Integer (4))}) 195 }, 196 { JvmManagementMib.oidJvmThreadCpuTimeMonitoring, 197 new CombinedTypedAttribute("", 198 Integer .class, 199 new TypedAttribute[] { 200 new Boolean2IntegerType("ThreadCpuTimeSupported", 201 null, new Integer (1)), 202 new Boolean2IntegerType("ThreadCpuTimeEnabled", 203 new Integer (3), new Integer (4))}) 204 } 205 }; 206 207 private NotificationOriginator notificationOriginator; 208 209 public JvmManagementMibInst(NotificationOriginator notificationOriginator) { 210 super(); 211 this.notificationOriginator = notificationOriginator; 212 addJvmManagementMibInstrumentaton(); 213 } 214 215 class TimeAction extends TypedAttribute { 216 217 private Map values = new HashMap (); 218 private MBeanServerConnection server; 219 private String action; 220 221 public TimeAction(String name, String action, 222 MBeanServerConnection server) { 223 super(name, Long .class); 225 this.server = server; 226 this.action = action; 227 } 228 229 public boolean isNativeValueAlwaysNeeded() { 230 return true; 231 } 232 233 public Object transformToNative(Object transformedValue, 234 Object oldNativeValue, 235 ObjectName objectName) { 236 Long nl = (Long )transformedValue; 237 Long ol = (Long )values.get(objectName); 238 if ((ol == null) || (nl > ol)) { 239 try { 240 values.put(objectName, new Long (System.currentTimeMillis())); 241 server.invoke(objectName, action, null, null); 242 } 243 catch (Exception ex) { 244 ex.printStackTrace(); 245 } 246 } 247 return null; 249 } 250 251 public Object transformFromNative(Object nativeValue, 252 ObjectName objectName) { 253 Long value = (Long ) values.get(objectName); 254 if (value == null) { 255 return new Long (0); 256 } 257 return value; 258 } 259 260 } 261 262 public void registerMOs(MOServer server, OctetString context) throws 263 DuplicateRegistrationException { 264 super.registerMOs(server, context); 265 if (server instanceof DefaultMOServer) { 266 addJvmManagementMibConstraints((DefaultMOServer)server); 267 } 268 } 269 270 private void addJvmManagementMibInstrumentaton() { 271 final MBeanServerConnection server = 272 ManagementFactory.getPlatformMBeanServer(); 273 274 final MBeanAttributeMOTableSupport tableSupport = 275 new MBeanAttributeMOTableSupport(server); 276 final MBeanAttributeMOScalarSupport scalarSupport = 277 new MBeanAttributeMOScalarSupport(server); 278 final MBeanActionMOScalarSupport scalarSupportActions = 279 new MBeanActionMOScalarSupport(server); 280 final JMXNotificationSupport notificationSupport = 281 new JMXNotificationSupport(notificationOriginator); 282 283 JMXDefaultMOFactory jmxFactory = 284 new JMXDefaultMOFactory(server, scalarSupport) { 285 public MOScalar createScalar(OID id, MOAccess access, Variable value) { 286 if (Arrays.binarySearch(ACTION_OIDS, id) >= 0) { 287 return new MOScalarJMX(scalarSupportActions, id, access, value); 288 } 289 return super.createScalar(id, access, value); 290 } 291 }; 292 createMO(jmxFactory); 294 295 try { 296 ObjectName onameJvmMemManagerEntry = 297 new ObjectName (ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE+ 298 ",*"); 299 300 JMXIndexSupport jvmMemManagerIndexSupport = 301 new AbstractSyntheticJMXIndexSupport() { 302 public ObjectName mapToRowMBean(Object rowIdentifier) { 303 try { 304 return new ObjectName (ManagementFactory. 305 MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE + 306 ",name=" + rowIdentifier); 307 } 308 catch (Exception ex) { 309 ex.printStackTrace(); 310 return null; 311 } 312 } 313 }; 314 315 tableSupport.add(super.oidJvmMemManagerEntry, 316 new MBeanAttributeMOTableInfo(onameJvmMemManagerEntry, 317 null, 318 new TypedAttribute[] { 319 new TypedAttribute("Name", String .class), 320 new InverseBooleanType("Valid")}, 321 new String [] { "Name" }, 322 jvmMemManagerIndexSupport)); 323 324 ObjectName onameJvmMem = 325 new ObjectName (ManagementFactory.MEMORY_MXBEAN_NAME); 326 notificationSupport.add(JvmManagementMib.oidJvmLowMemoryPoolUsageNotif, 327 new MBeanNotificationInfo(jvmLowMemoryPoolUsageNotif, 328 new JMXAttributeNotificationIndexSupport( 329 new TypedAttribute("poolName", String .class), 330 jvmMemManagerIndexSupport))); 331 try { 332 server.addNotificationListener(onameJvmMem, 333 notificationSupport, null, 334 JvmManagementMib. 335 oidJvmLowMemoryPoolUsageNotif); 336 } 337 catch (Exception ex) { 338 ex.printStackTrace(); 339 } 340 notificationSupport.add(JvmManagementMib.oidJvmLowMemoryPoolCollectNotif, 341 new MBeanNotificationInfo(jvmLowMemoryPoolCollectNotif, 342 new JMXAttributeNotificationIndexSupport( 343 new TypedAttribute("poolName", String .class), 344 jvmMemManagerIndexSupport))); 345 try { 346 server.addNotificationListener(onameJvmMem, 347 notificationSupport, null, 348 JvmManagementMib. 349 oidJvmLowMemoryPoolCollectNotif); 350 } 351 catch (Exception ex) { 352 ex.printStackTrace(); 353 } 354 355 ObjectName onameJvmMemPoolEntry = 356 new ObjectName (ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE+",*"); 357 358 tableSupport.add(super.oidJvmMemPoolEntry, 359 new MBeanAttributeMOTableInfo(onameJvmMemPoolEntry, 360 null, 361 new TypedAttribute[] { 362 new TypedAttribute("Name", String .class), 363 new EnumStringType("Type", MemoryType .class, MemoryType.values() ), 364 new InverseBooleanType("Valid"), 365 new TimeAction("Name","resetPeakUsage", server), 366 new TypedCompositeDataAttribute("Usage", "init", Long .class), 367 new TypedCompositeDataAttribute("Usage", "used", Long .class), 368 new TypedCompositeDataAttribute("Usage", "committed", Long .class), 369 new TypedCompositeDataAttribute("Usage", "max", Long .class), 370 new TypedCompositeDataAttribute("PeakUsage", "used", Long .class), 371 new TypedCompositeDataAttribute("PeakUsage", "committed", Long .class), 372 new TypedCompositeDataAttribute("PeakUsage", "max", Long .class), 373 new TypedCompositeDataAttribute("CollectionUsage", "used", Long .class), 374 new TypedCompositeDataAttribute("CollectionUsage", "committed", Long .class), 375 new TypedCompositeDataAttribute("CollectionUsage", "max", Long .class), 376 new TypedAttribute("UsageThreshold", Long .class), 377 new TypedAttribute("UsageThresholdCount", Long .class), 378 new InverseBooleanType("UsageThresholdSupported"), 379 new TypedAttribute("CollectionUsageThreshold", Long .class), 380 new TypedAttribute("CollectionUsageThresholdCount", Long .class), 381 new InverseBooleanType("CollectionUsageThresholdSupported") 382 }, 383 new String [] { "Name" }, 384 new AbstractSyntheticJMXIndexSupport() { 385 public ObjectName mapToRowMBean(Object rowIdentifier) { 386 try { 387 return new ObjectName (ManagementFactory. 388 MEMORY_POOL_MXBEAN_DOMAIN_TYPE + 389 ",name=" + rowIdentifier); 390 } 391 catch (Exception ex) { 392 ex.printStackTrace(); 393 return null; 394 } 395 } 396 })); 397 398 ObjectName onameJvmThreading = 399 new ObjectName (ManagementFactory.THREAD_MXBEAN_NAME); 400 401 tableSupport.add(super.oidJvmThreadInstanceEntry, 402 new MBeanAttributeMOTableInfo(onameJvmThreading, 403 new MBeanInvokationKeyProvider(onameJvmThreading, 404 new TypedAttribute("AllThreadIds", long.class), 405 "getThreadInfo", true), 406 new TypedAttribute[] { 407 new TypedCompositeDataAttribute(new TypedAttribute("threadId", Long .class)), 408 new CombinedBitsType(new TypedAttribute[] { 409 new EnumBitsType("threadState", Thread.State .class, Thread.State.values(), 3), 410 new BooleanBitsType("inNative", 1), 411 new BooleanBitsType("suspended", 2)}), 412 new TypedCompositeDataAttribute(new TypedAttribute("blockedCount", Long .class)), 413 new TypedCompositeDataAttribute(new TypedAttribute("blockedTime", Long .class)), 414 new TypedCompositeDataAttribute(new TypedAttribute("waitedCount", Long .class)), 415 new TypedCompositeDataAttribute(new TypedAttribute("waitedTime", Long .class)), 416 new MBeanProxyType(server, onameJvmThreading, Long .class, 417 "getThreadUserTime", 418 new TypedCompositeDataAttribute(new TypedAttribute("threadId", long.class))) { 419 public Object transformFromNative(Object nativeValue, ObjectName objectName) { 420 Long result = (Long ) super.transformFromNative(nativeValue, objectName); 421 if ((result == null) || (result.longValue() < 0)) { 422 return 0L; 423 } 424 return result; 425 } 426 }, 427 new TypedCompositeDataAttribute(new TypedAttribute("threadName", String .class)), 428 new TypedCompositeDataAttribute(new TypedAttribute("lockOwnerName", String .class)), 429 new TypedCompositeDataAttribute(new TypedAttribute("lockOwnerId", Long .class)) { 430 public Object transformFromNative(Object nativeValue, ObjectName objectName) { 431 Long result = (Long )super.transformFromNative(nativeValue, objectName); 432 if ((result == null) || (result.longValue() < 0)) { 433 return "0.0"; 434 } 435 OID rowPointer = new OID(JvmManagementMib.oidJvmThreadInstanceEntry); 436 rowPointer.append(JvmManagementMib.colJvmThreadInstId); 437 String index = Long.toHexString(result.longValue()); 438 OctetString os = new OctetString(); 439 os.fromHexString(index); 440 rowPointer.append(os.toSubIndex(true)); 441 return rowPointer.toString(); 442 } 443 }}, 444 new String [] { "ThreadId" }, 445 new JMXIndexSupport() { 446 public ObjectName mapToRowMBean(Object rowIdentifier) { 447 return null; 448 } 449 450 public Object getRowIdentifier(Object nativeRowId, int nativeIndex) { 451 return nativeRowId; 452 } 453 454 public OID mapToIndex(Object rowIdentifier) { 455 Long l = (Long )rowIdentifier; 456 return OctetString.fromHexString(Long.toHexString(l)).toSubIndex(true); 457 } 458 459 public Object mapToRowIdentifier(OID rowIndex) { 460 if (rowIndex == null) { 461 return null; 462 } 463 OctetString os = new OctetString(); 464 os.fromSubIndex(rowIndex, true); 465 String hexString = os.toHexString(); 466 return new Long (Long.parseLong(hexString, 16)); 467 } 468 })); 469 470 ObjectName onameJvmClasses = 471 new ObjectName (ManagementFactory.CLASS_LOADING_MXBEAN_NAME); 472 ObjectName onameJvmRT = 473 new ObjectName (ManagementFactory.RUNTIME_MXBEAN_NAME); 474 ObjectName onameJitCompiler = 475 new ObjectName (ManagementFactory.COMPILATION_MXBEAN_NAME); 476 ObjectName onameJvmOS = 477 new ObjectName (ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME); 478 ObjectName onameJvmMemory = 479 new ObjectName (ManagementFactory.MEMORY_MXBEAN_NAME); 480 481 scalarSupport.addAll(onameJvmClasses, SCALAR_MBEANS_JVM_CLASSES); 482 scalarSupport.addAll(onameJvmRT, SCALAR_MBEANS_JVM_RUNTIME); 483 scalarSupport.addAll(onameJitCompiler, SCALAR_MBEANS_JIT_COMPILER); 484 scalarSupport.addAll(onameJvmOS, SCALAR_MBEANS_JVM_OS); 485 scalarSupport.addAll(onameJvmMemory, SCALAR_MBEANS_JVM_MEMORY); 486 scalarSupport.addAll(onameJvmThreading, SCALAR_MBEANS_JVM_THREADING); 487 488 scalarSupportActions.addAll(onameJvmMemory, 489 SCALAR_MBEANS_JVM_MEMORY_ACTIONS); 490 491 tableSupport.add(super.oidJvmRTInputArgsEntry, 492 new MBeanAttributeListMOTableInfo(onameJvmRT, 493 new MBeanArrayIndexKeyProvider(onameJvmRT, 494 new TypedAttribute("InputArguments", 495 String [].class)))); 496 497 tableSupport.add(super.oidJvmRTBootClassPathEntry, 498 new MBeanAttributeListMOTableInfo(onameJvmRT, 499 new MBeanArrayIndexKeyProvider(onameJvmRT, 500 new SplitStringType("BootClassPath", 501 File.pathSeparator)))); 502 503 tableSupport.add(super.oidJvmRTClassPathEntry, 504 new MBeanAttributeListMOTableInfo(onameJvmRT, 505 new MBeanArrayIndexKeyProvider(onameJvmRT, 506 new SplitStringType("ClassPath", 507 File.pathSeparator)))); 508 509 tableSupport.add(super.oidJvmRTLibraryPathEntry, 510 new MBeanAttributeListMOTableInfo(onameJvmRT, 511 new MBeanArrayIndexKeyProvider(onameJvmRT, 512 new SplitStringType("LibraryPath", 513 File.pathSeparator)))); 514 515 } 516 catch (NullPointerException ex) { 517 ex.printStackTrace(); 518 } 519 catch (MalformedObjectNameException ex) { 520 ex.printStackTrace(); 521 } 522 523 JMXTableModel jvmMemManagerEntryModel = 524 new JMXTableModel(super.oidJvmMemManagerEntry, 525 tableSupport, 526 super.getJvmMemManagerEntry().getColumns()); 527 ((MOTableJMX)super.getJvmMemManagerEntry()). 528 setModel(jvmMemManagerEntryModel); 529 530 JMXTableModel jvmMemPoolEntryModel = 531 new JMXTableModel(super.oidJvmMemPoolEntry, 532 tableSupport, 533 super.getJvmMemPoolEntry().getColumns()); 534 ((MOTableJMX)super.getJvmMemPoolEntry()). 535 setModel(jvmMemPoolEntryModel); 536 537 JMXTableModel jvmThreadInstanceEntryModel = 538 new JMXTableModel(super.oidJvmThreadInstanceEntry, 539 tableSupport, 540 super.getJvmThreadInstanceEntry().getColumns()); 541 ((MOTableJMX)super.getJvmThreadInstanceEntry()). 542 setModel(jvmThreadInstanceEntryModel); 543 544 545 JMXTableModel jvmJvmRTInputArgsEntryModel = 546 new JMXTableModel(super.oidJvmRTInputArgsEntry, 547 tableSupport, 548 super.getJvmRTInputArgsEntry().getColumns()); 549 ((MOTableJMX)super.getJvmRTInputArgsEntry()). 550 setModel(jvmJvmRTInputArgsEntryModel); 551 552 553 JMXTableModel jvmJvmRTBootClassPathEntryModel = 554 new JMXTableModel(super.oidJvmRTBootClassPathEntry, 555 tableSupport, 556 super.getJvmRTBootClassPathEntry().getColumns()); 557 ((MOTableJMX)super.getJvmRTBootClassPathEntry()). 558 setModel(jvmJvmRTBootClassPathEntryModel); 559 560 JMXTableModel jvmJvmRTClassPathEntryModel = 561 new JMXTableModel(super.oidJvmRTClassPathEntry, 562 tableSupport, 563 super.getJvmRTClassPathEntry().getColumns()); 564 ((MOTableJMX)super.getJvmRTClassPathEntry()). 565 setModel(jvmJvmRTClassPathEntryModel); 566 567 JMXTableModel jvmJvmRTLibraryPathEntryModel = 568 new JMXTableModel(super.oidJvmRTLibraryPathEntry, 569 tableSupport, 570 super.getJvmRTLibraryPathEntry().getColumns()); 571 ((MOTableJMX)super.getJvmRTLibraryPathEntry()). 572 setModel(jvmJvmRTLibraryPathEntryModel); 573 574 } 575 576 private void addJvmManagementMibConstraints(DefaultMOServer server) { 577 MOScalar scalar = (MOScalar) 578 server.getManagedObject(JvmManagementMib.oidJvmThreadContentionMonitoring, 579 null); 580 ValueConstraint jvmThreadContentionMonitoringVC = new EnumerationConstraint( 581 new int[] { JvmManagementMib.JvmThreadContentionMonitoringEnum.enabled, 582 JvmManagementMib.JvmThreadContentionMonitoringEnum.disabled }); 583 scalar.addMOValueValidationListener( 584 new ValueConstraintValidator(jvmThreadContentionMonitoringVC)); 585 scalar = (MOScalar) 586 server.getManagedObject(JvmManagementMib.oidJvmThreadCpuTimeMonitoring, 587 null); 588 ValueConstraint jvmThreadCpuTimeMonitoringVC = new EnumerationConstraint( 589 new int[] { JvmManagementMib.JvmThreadContentionMonitoringEnum.enabled, 590 JvmManagementMib.JvmThreadContentionMonitoringEnum.disabled }); 591 scalar.addMOValueValidationListener( 592 new ValueConstraintValidator(jvmThreadCpuTimeMonitoringVC)); 593 } 594 595 } 596 | Popular Tags |