use of org.talend.designer.runtime.visualization.MBean.IMBeanServer in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method loadOverviewChartSet.
private void loadOverviewChartSet(IActiveJvm activeJvm) throws JvmCoreException {
final int[] blue = new int[] { 0, 255, 255 };
final int[] red = new int[] { 255, 0, 0 };
final int[] green = new int[] { 0, 255, 0 };
final int[] lightgeen = new int[] { 128, 255, 0 };
final int[] darkRed = new int[] { 255, 0, 128 };
final int[] orange = new int[] { 255, 255, 0 };
IMBeanServer server = activeJvm.getMBeanServer();
server.getMonitoredAttributeGroups().clear();
IMonitoredMXBeanGroup group = server.addMonitoredAttributeGroup(MonitorAttributeName.HEAP_MEMORY, AxisUnit.MBytes);
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, MonitorAttributeName.HEAP_MEMORY_USE, green);
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, MonitorAttributeName.HEAP_MEMORY_SIZE, darkRed);
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, MonitorAttributeName.HEAP_MEMORY_NINTY, blue);
group.addAttribute(ManagementFactory.MEMORY_MXBEAN_NAME, MonitorAttributeName.HEAP_MEMORY_THREE_QUARTER, orange);
group = server.addMonitoredAttributeGroup(MonitorAttributeName.CPU_USE, AxisUnit.Percent);
group.addAttribute(ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME, MonitorAttributeName.CPU_TIME, lightgeen);
}
use of org.talend.designer.runtime.visualization.MBean.IMBeanServer in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method setInput.
@Override
protected void setInput(ISelection selection, IActiveJvm newJvm, IActiveJvm oldJvm) {
if (newJvm == null || newJvm.equals(oldJvm)) {
return;
}
reconstructCharts(newJvm, false);
if (oldJvm != null && mBeanServerChangeListener != null) {
IMBeanServer server = oldJvm.getMBeanServer();
if (server != null) {
server.removeServerChangeListener(mBeanServerChangeListener);
}
}
newJvm.getMBeanServer().addServerChangeListener(mBeanServerChangeListener);
}
use of org.talend.designer.runtime.visualization.MBean.IMBeanServer in project tdi-studio-se by Talend.
the class TimelineSection method setInput.
/*
* @see AbstractJvmPropertySection#setInput(IWorkbenchPart, ISelection, IActiveJvm, IActiveJvm)
*/
@Override
protected void setInput(IWorkbenchPart part, ISelection selection, IActiveJvm newJvm, IActiveJvm oldJvm) {
if (newJvm == null || newJvm.equals(oldJvm)) {
return;
}
reconstructCharts(newJvm, false);
if (oldJvm != null && mBeanServerChangeListener != null) {
IMBeanServer server = oldJvm.getMBeanServer();
if (server != null) {
server.removeServerChangeListener(mBeanServerChangeListener);
}
}
newJvm.getMBeanServer().addServerChangeListener(mBeanServerChangeListener);
}
use of org.talend.designer.runtime.visualization.MBean.IMBeanServer in project tdi-studio-se by Talend.
the class TimelineSection method dispose.
/*
* @see AbstractJvmPropertySection#dispose()
*/
@Override
public void dispose() {
super.dispose();
IActiveJvm jvm = getJvm();
if (jvm != null) {
IMBeanServer server = jvm.getMBeanServer();
if (server != null) {
server.removeServerChangeListener(mBeanServerChangeListener);
}
}
}
use of org.talend.designer.runtime.visualization.MBean.IMBeanServer in project tdi-studio-se by Talend.
the class LoadChartSetAction method loadChartSet.
/**
* Loads the given memento of chart set.
*
* @param memento The memento
* @throws JvmCoreException
*/
private void loadChartSet(IMemento memento) throws JvmCoreException {
IMBeanServer server = section.getJvm().getMBeanServer();
server.getMonitoredAttributeGroups().clear();
StringBuffer buffer = new StringBuffer();
for (IMemento groupMemento : memento.getChildren(GROUP)) {
IMonitoredMXBeanGroup group = server.addMonitoredAttributeGroup(groupMemento.getID(), AxisUnit.valueOf(groupMemento.getString(UNIT)));
for (IMemento attributeMemento : groupMemento.getChildren(ATTRIBUTE)) {
String objectName = attributeMemento.getString(OBJECT_NAME);
String attributeName = attributeMemento.getID();
if (attributeExist(objectName, attributeName)) {
group.addAttribute(objectName, attributeName, getRGB(attributeMemento.getString(COLOR)));
} else {
buffer.append('\n');
buffer.append(objectName + ':' + attributeName);
}
}
}
if (buffer.length() > 0) {
MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.errorDialogTitle, NLS.bind(Messages.attributeNotSupportedMsg, buffer.toString()));
}
}
Aggregations