private void printComponentStats(PrintWriter pw, Cache<?, ?> cache, Object component) { if (component == null) { return; } ComponentMetadataRepo mr = cache.getAdvancedCache().getComponentRegistry().getComponentMetadataRepo(); ComponentMetadata cm = mr.findComponentMetadata(component.getClass().getName()); if (cm == null || !(cm instanceof ManageableComponentMetadata)) { return; } ManageableComponentMetadata mcm = cm.toManageableComponentMetadata(); pw.printf("%s: {\n", mcm.getJmxObjectName()); List<JmxAttributeMetadata> attrs = new ArrayList<>(mcm.getAttributeMetadata()); Collections.sort(attrs, Comparator.comparing(JmxAttributeMetadata::getName)); for (JmxAttributeMetadata s : attrs) { pw.printf(" %s: %s\n", s.getName(), getAttributeValue(component, s)); } pw.println("}"); }
private void printComponentStats(PrintWriter pw, Cache<?, ?> cache, Object component) { if (component == null) { return; } ComponentMetadataRepo mr = cache.getAdvancedCache().getComponentRegistry().getComponentMetadataRepo(); ComponentMetadata cm = mr.findComponentMetadata(component.getClass().getName()); if (cm == null || !(cm instanceof ManageableComponentMetadata)) { return; } ManageableComponentMetadata mcm = cm.toManageableComponentMetadata(); pw.printf("%s: {\n", mcm.getJmxObjectName()); for (JmxAttributeMetadata s : mcm.getAttributeMetadata()) { pw.printf(" %s: %s\n", s.getName(), getAttributeValue(component, s)); } pw.println("}"); }
ResourceDMBean mbean = new ResourceDMBean(massIndexer, massIndexerCompMetadata); ObjectName massIndexerObjName = new ObjectName(jmxDomain + ":" + queryGroupName + ",component=" + massIndexerCompMetadata.getJmxObjectName()); JmxUtil.registerMBean(mbean, massIndexerObjName, mbeanServer); } catch (Exception e) {
ResourceDMBean mbean = new ResourceDMBean(massIndexer, massIndexerCompMetadata); ObjectName massIndexerObjName = new ObjectName(jmxDomain + ":" + queryGroupName + ",component=" + massIndexerCompMetadata.getJmxObjectName()); JmxUtil.registerMBean(mbean, massIndexerObjName, mbeanServer); } catch (Exception e) {