TreeNode createJmxAttributeSubResource(MBeanAttributeInfo attr,
ObjectName mbeanName) throws Exception {
TreeNodeMenuEntry[] entries = null;
if (graphableClasses.contains(attr.getType()))
{
SimpleTreeNodeMenuEntryImpl entry = new SimpleTreeNodeMenuEntryImpl("graph", new GraphMBeanAttributeAction(mbeanName, attr.getName()));
SimpleTreeNodeMenuEntryImpl entry2 = new SimpleTreeNodeMenuEntryImpl("create monitor", new HttpLinkTreeAction(
"/web-console/createThresholdMonitor.jsp?attribute=" + attr.getName() + "&objectName=" + encode(mbeanName.toString())));
SimpleTreeNodeMenuEntryImpl entry3 = new SimpleTreeNodeMenuEntryImpl("create snapshot", new HttpLinkTreeAction(
"/web-console/createSnapshot.jsp?attribute=" + attr.getName() + "&objectName=" + encode(mbeanName.toString())));
entries = new TreeNodeMenuEntry[3];
entries[0] = entry;
entries[1] = entry2;
entries[2] = entry3;
}
else if (attr.getType().equals("String") || attr.getType().equals("java.lang.String"))
{
SimpleTreeNodeMenuEntryImpl entry = new SimpleTreeNodeMenuEntryImpl("create monitor", new HttpLinkTreeAction(
"/web-console/createStringThresholdMonitor.jsp?attribute=" + attr.getName() + "&objectName=" + encode(mbeanName.toString())));
entries = new TreeNodeMenuEntry[1];
entries[0] = entry;
}
return createTreeNode(
attr.getName(),
attr.getDescription(),
"images/container.gif",
"/jmx-console/HtmlAdaptor?action=inspectMBean&name=" + encode("" + mbeanName), // Default URL
entries,
null,
null
//name,
//data.getClassName() TOO HEAVY TO GENERATE RESOURCE LOOKUP FOR EACH MBEAN!
);
}
|