use of org.talend.designer.runtime.visualization.internal.ui.properties.MBean.MBeanDomain in project tdi-studio-se by Talend.
the class AttributeContentProvider method refresh.
/**
* Refreshes the content provider.
*
* @param jvm The active JVM
*/
public void refresh(IActiveJvm jvm) {
domains = new HashMap<String, MBeanDomain>();
// add or update elements
for (ObjectName objectName : getObjectNames(jvm)) {
MBeanInfo mBeanInfo = getMBeanInfo(jvm, objectName);
if (mBeanInfo == null) {
continue;
}
List<AttributeNode> mBeanAttributes = new ArrayList<AttributeNode>();
for (MBeanAttributeInfo attributeInfo : mBeanInfo.getAttributes()) {
String attributeName = attributeInfo.getName();
Object value = getContents(jvm, objectName, attributeName);
addAttributeRoots(mBeanAttributes, new AttributeNode(attributeName, null, objectName), value);
}
for (AttributeNode node : mBeanAttributes.toArray(new AttributeNode[0])) {
validateAttributes(node);
if (node.getChildren().size() == 0 && !node.isValidLeaf()) {
mBeanAttributes.remove(node);
}
}
if (mBeanAttributes.size() == 0) {
continue;
}
attributes.put(objectName, mBeanAttributes);
String domainName = objectName.getDomain();
MBeanDomain domain;
if (domains.containsKey(domainName)) {
domain = domains.get(domainName);
} else {
domain = new MBeanDomain(domainName);
}
domain.refresh(objectName, jvm);
domains.put(domainName, domain);
}
}
Aggregations