use of org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup in project tdi-studio-se by Talend.
the class MBeanServer method addMonitoredAttributeGroup.
/*
* @see IMBeanServer#addMonitoredAttributeGroup(String, IMonitoredMXBeanGroup.AxisUnit)
*/
@Override
public IMonitoredMXBeanGroup addMonitoredAttributeGroup(String name, AxisUnit axisUnit) {
Assert.isNotNull(name);
Assert.isNotNull(axisUnit);
for (IMonitoredMXBeanGroup group : monitoredAttributeGroups) {
if (group.getName().equals(name)) {
group.setAxisUnit(axisUnit);
group.clearAttributes();
return group;
}
}
IMonitoredMXBeanGroup group = new MonitoredMXBeanGroup(this, name, axisUnit);
monitoredAttributeGroups.add(group);
fireMBeanServerChangeEvent(new MBeanServerEvent(MBeanServerState.MonitoredAttributeGroupAdded, group));
return group;
}
use of org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup in project tdi-studio-se by Talend.
the class ConfigureChartAction method performConfiguration.
/**
* Performs the configuration.
*
* @param chartTitle The chart title
* @param axisUnit The axis unit
* @param attributes The attributes
* @param removedAttributes The removed attributes
*/
private void performConfiguration(String chartTitle, AxisUnit axisUnit, List<MBeanAttribute> attributes, List<MBeanAttribute> removedAttributes) {
IMonitoredMXBeanGroup group = chart.getAttributeGroup();
group.setName(chartTitle);
group.setAxisUnit(axisUnit);
for (MBeanAttribute attribute : attributes) {
ObjectName objectName = attribute.getObjectName();
String attributeName = attribute.getAttributeName();
IMonitoredMXBeanAttribute monitoredAttribute = group.getAttribute(objectName, attributeName);
RGB rgb = attribute.getRgb();
if (monitoredAttribute == null) {
try {
group.addAttribute(objectName.getCanonicalName(), attributeName, new int[] { rgb.red, rgb.green, rgb.blue });
} catch (JvmCoreException e) {
Activator.log(Messages.addAttributeFailedMsg, e);
}
} else {
monitoredAttribute.setRGB(rgb.red, rgb.green, rgb.blue);
}
}
for (MBeanAttribute removedAttribute : removedAttributes) {
group.removeAttribute(removedAttribute.getObjectName().getCanonicalName(), removedAttribute.getAttributeName());
}
chart.refresh();
}
Aggregations