@Test public void testOSPlugin() { assertTrue(listContains(OSReportPlugin.class)); final TreeMap<String, org.springframework.core.io.Resource> entries = m_osReportPlugin.getEntries(); assertTrue(entries.containsKey("Architecture")); assertTrue(entries.containsKey("Name")); assertTrue(entries.containsKey("Distribution")); }
public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); map.put("Class Version", getResourceFromProperty("java.class.version")); map.put("Compiler", getResourceFromProperty("java.compiler")); map.put("Home", getResourceFromProperty("java.home")); map.put("Version", getResourceFromProperty("java.version")); map.put("Vendor", getResourceFromProperty("java.vendor")); map.put("VM Version", getResourceFromProperty("java.vm.version")); map.put("VM Name", getResourceFromProperty("java.vm.name")); MemoryMXBean memoryBean = getBean(ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class); if (memoryBean == null) { LogUtils.infof(this, "falling back to local VM MemoryMXBean"); memoryBean = ManagementFactory.getMemoryMXBean(); } addGetters(memoryBean, map); RuntimeMXBean runtimeBean = getBean(ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); if (runtimeBean == null) { LogUtils.infof(this, "falling back to local VM RuntimeMXBean"); runtimeBean = ManagementFactory.getRuntimeMXBean(); } addGetters(runtimeBean, map); ClassLoadingMXBean classBean = getBean(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class); if (classBean == null) { LogUtils.infof(this, "falling back to local VM ClassLoadingMXBean"); classBean = ManagementFactory.getClassLoadingMXBean(); } addGetters(classBean, map); return map; }
JavaReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); map.put("Class Version", getResourceFromProperty("java.class.version")); map.put("Compiler", getResourceFromProperty("java.compiler")); map.put("Home", getResourceFromProperty("java.home")); map.put("Version", getResourceFromProperty("java.version")); map.put("Vendor", getResourceFromProperty("java.vendor")); map.put("VM Version", getResourceFromProperty("java.vm.version")); map.put("VM Name", getResourceFromProperty("java.vm.name")); MemoryMXBean memoryBean = getBean(ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class); if (memoryBean == null) { LogUtils.infof(this, "falling back to local VM MemoryMXBean"); memoryBean = ManagementFactory.getMemoryMXBean(); } addGetters(memoryBean, map); RuntimeMXBean runtimeBean = getBean(ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); if (runtimeBean == null) { LogUtils.infof(this, "falling back to local VM RuntimeMXBean"); runtimeBean = ManagementFactory.getRuntimeMXBean(); } addGetters(runtimeBean, map); ClassLoadingMXBean classBean = getBean(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class); if (classBean == null) { LogUtils.infof(this, "falling back to local VM ClassLoadingMXBean"); classBean = ManagementFactory.getClassLoadingMXBean(); } addGetters(classBean, map); return map; } }
JavaReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); map.put("Class Version", getResourceFromProperty("java.class.version")); map.put("Compiler", getResourceFromProperty("java.compiler")); map.put("Home", getResourceFromProperty("java.home")); map.put("Version", getResourceFromProperty("java.version")); map.put("Vendor", getResourceFromProperty("java.vendor")); map.put("VM Version", getResourceFromProperty("java.vm.version")); map.put("VM Name", getResourceFromProperty("java.vm.name")); MemoryMXBean memoryBean = getBean(ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class); if (memoryBean == null) { LogUtils.infof(this, "falling back to local VM MemoryMXBean"); memoryBean = ManagementFactory.getMemoryMXBean(); } addGetters(memoryBean, map); RuntimeMXBean runtimeBean = getBean(ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); if (runtimeBean == null) { LogUtils.infof(this, "falling back to local VM RuntimeMXBean"); runtimeBean = ManagementFactory.getRuntimeMXBean(); } addGetters(runtimeBean, map); ClassLoadingMXBean classBean = getBean(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class); if (classBean == null) { LogUtils.infof(this, "falling back to local VM ClassLoadingMXBean"); classBean = ManagementFactory.getClassLoadingMXBean(); } addGetters(classBean, map); return map; }  }
JavaReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); map.put("Class Version", getResourceFromProperty("java.class.version")); map.put("Compiler", getResourceFromProperty("java.compiler")); map.put("Home", getResourceFromProperty("java.home")); map.put("Version", getResourceFromProperty("java.version")); map.put("Vendor", getResourceFromProperty("java.vendor")); map.put("VM Version", getResourceFromProperty("java.vm.version")); map.put("VM Name", getResourceFromProperty("java.vm.name")); MemoryMXBean memoryBean = getBean(ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class); if (memoryBean == null) { LogUtils.infof(this, "falling back to local VM MemoryMXBean"); memoryBean = ManagementFactory.getMemoryMXBean(); } addGetters(memoryBean, map); RuntimeMXBean runtimeBean = getBean(ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); if (runtimeBean == null) { LogUtils.infof(this, "falling back to local VM RuntimeMXBean"); runtimeBean = ManagementFactory.getRuntimeMXBean(); } addGetters(runtimeBean, map); ClassLoadingMXBean classBean = getBean(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class); if (classBean == null) { LogUtils.infof(this, "falling back to local VM ClassLoadingMXBean"); classBean = ManagementFactory.getClassLoadingMXBean(); } addGetters(classBean, map); return map; }  String getName(); String getDescription(); int getPriority(); TreeMap<String, Resource> getEntries(); }
JavaReportPlugin extends AbstractSystemReportPlugin { public TreeMap<String, Resource> getEntries() { final TreeMap<String,Resource> map = new TreeMap<String,Resource>(); map.put("Class Version", getResourceFromProperty("java.class.version")); map.put("Compiler", getResourceFromProperty("java.compiler")); map.put("Home", getResourceFromProperty("java.home")); map.put("Version", getResourceFromProperty("java.version")); map.put("Vendor", getResourceFromProperty("java.vendor")); map.put("VM Version", getResourceFromProperty("java.vm.version")); map.put("VM Name", getResourceFromProperty("java.vm.name")); MemoryMXBean memoryBean = getBean(ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class); if (memoryBean == null) { LogUtils.infof(this, "falling back to local VM MemoryMXBean"); memoryBean = ManagementFactory.getMemoryMXBean(); } addGetters(memoryBean, map); RuntimeMXBean runtimeBean = getBean(ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class); if (runtimeBean == null) { LogUtils.infof(this, "falling back to local VM RuntimeMXBean"); runtimeBean = ManagementFactory.getRuntimeMXBean(); } addGetters(runtimeBean, map); ClassLoadingMXBean classBean = getBean(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class); if (classBean == null) { LogUtils.infof(this, "falling back to local VM ClassLoadingMXBean"); classBean = ManagementFactory.getClassLoadingMXBean(); } addGetters(classBean, map); return map; }  String getName(); String getDescription(); int getPriority(); TreeMap<String, Resource> getEntries();  }