import javax.management.MBeanServer; import java.lang.management.ManagementFactory; import javax.management.ObjectName; import javax.management.JMX; static virtual OpenJ9DiagnosticsMXBean openJ9_diagnosticsBean() ctex { Class beanClass = classForNameOpt("openj9.lang.management.OpenJ9DiagnosticsMXBean"); if (beanClass == null) null; // Not on OpenJ9 ObjectName mxbeanName = new("openj9.lang.management:type=OpenJ9Diagnostics"); MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); if (!mbeanServer.isRegistered(mxbeanName)) null; ret JMX.newMXBeanProxy(mbeanServer, mxbeanName, beanClass); }