use of org.talend.designer.esb.runcontainer.ui.dialog.RuntimeInfoDialog in project tesb-studio-se by Talend.
the class OpenRuntimeInfoAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
MBeanServerConnection mbsc;
try {
mbsc = JMXUtil.createJMXconnection();
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
//$NON-NLS-1$
String JOB_MBEAN = "TalendAgent:type=O.S. Informations";
ObjectName objectJob = new ObjectName(JOB_MBEAN);
MBeanInfo info = mbsc.getMBeanInfo(objectJob);
MBeanAttributeInfo[] attrInfo = info.getAttributes();
for (int i = 0; i < attrInfo.length; i++) {
try {
Map<String, String> attributeMap = new HashMap<String, String>();
String attributeName = attrInfo[i].getName();
//$NON-NLS-1$
attributeMap.put("name", attributeName);
String attributeDesc = attrInfo[i].getType();
//$NON-NLS-1$
attributeMap.put("desc", attributeDesc);
String attributeValue = mbsc.getAttribute(objectJob, attributeName).toString();
attributeMap.put(attributeName, attributeValue);
//$NON-NLS-1$
attributeMap.put("value", attributeValue);
list.add(attributeMap);
} catch (Exception e) {
e.printStackTrace();
}
}
RuntimeInfoDialog dlg = new RuntimeInfoDialog(list);
dlg.open();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations