Search in sources :

Example 1 with MBeanServerEvent

use of org.talend.designer.runtime.visualization.MBean.MBeanServerEvent in project tdi-studio-se by Talend.

the class MonitoredMXBeanGroup method addAttribute.

/**
     * Adds the attribute.
     * 
     * @param objectNameString The object name
     * @param attributeName The attribute name
     * @param rgb The RGB
     * @param fireEvent True to fire event
     * @throws JvmCoreException
     */
protected void addAttribute(String objectNameString, String attributeName, int[] rgb, boolean fireEvent) throws JvmCoreException {
    ObjectName objectName = mBeanServer.getObjectName(objectNameString);
    MonitoredMXBeanAttribute attribute = new MonitoredMXBeanAttribute(objectName, attributeName, rgb);
    attributes.add(attribute);
    if (fireEvent) {
        mBeanServer.fireMBeanServerChangeEvent(new MBeanServerEvent(MBeanServerState.MonitoredAttributeAdded, attribute));
    }
}
Also used : IMonitoredMXBeanAttribute(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute) MBeanServerEvent(org.talend.designer.runtime.visualization.MBean.MBeanServerEvent) ObjectName(javax.management.ObjectName)

Example 2 with MBeanServerEvent

use of org.talend.designer.runtime.visualization.MBean.MBeanServerEvent in project tdi-studio-se by Talend.

the class RuntimeGraphcsComposite method createControls.

@Override
protected void createControls(Composite parent) {
    chartsPage = new Composite(parent, SWT.NULL);
    parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    chartsPage.setBackground(parent.getBackground());
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = 0;
    formLayout.marginHeight = 0;
    chartsPage.setLayout(formLayout);
    FormData pageData = new FormData();
    pageData.top = new FormAttachment(0, 0);
    pageData.bottom = new FormAttachment(100, 0);
    pageData.left = new FormAttachment(0, 0);
    pageData.right = new FormAttachment(100, 0);
    chartsPage.setLayoutData(pageData);
    mBeanServerChangeListener = new IMBeanServerChangeListener() {

        @Override
        public void serverChanged(MBeanServerEvent event) {
            new RefreshJob(Messages.reconstructChartJobLabel, toString()) {

                @Override
                protected void refreshUI() {
                    IActiveJvm jvm = getJvm();
                    if (jvm != null) {
                        reconstructCharts(jvm, false);
                    }
                }
            }.schedule();
        }
    };
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.TIMELINE_PAGE);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) RefreshJob(org.talend.designer.runtime.visualization.internal.ui.RefreshJob) IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) IMBeanServerChangeListener(org.talend.designer.runtime.visualization.MBean.IMBeanServerChangeListener) MBeanServerEvent(org.talend.designer.runtime.visualization.MBean.MBeanServerEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 3 with MBeanServerEvent

use of org.talend.designer.runtime.visualization.MBean.MBeanServerEvent in project tdi-studio-se by Talend.

the class TimelineSection method createControls.

/*
     * @see AbstractJvmPropertySection#createControls(Composite)
     */
@Override
protected void createControls(Composite parent) {
    timelinePageBook = new PageBook(parent, SWT.NONE);
    chartsPage = new Composite(timelinePageBook, SWT.NONE);
    messagePage = createMessagePage();
    parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    GridLayout layout = new GridLayout(2, true);
    layout.horizontalSpacing = 15;
    chartsPage.setLayout(layout);
    timelinePageBook.showPage(chartsPage);
    mBeanServerChangeListener = new IMBeanServerChangeListener() {

        @Override
        public void serverChanged(MBeanServerEvent event) {
            new RefreshJob(Messages.reconstructChartJobLabel, toString()) {

                @Override
                protected void refreshUI() {
                    IActiveJvm jvm = getJvm();
                    if (jvm != null) {
                        reconstructCharts(jvm, false);
                    }
                }
            }.schedule();
        }
    };
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.TIMELINE_PAGE);
}
Also used : RefreshJob(org.talend.designer.runtime.visualization.internal.ui.RefreshJob) IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) GridLayout(org.eclipse.swt.layout.GridLayout) PageBook(org.eclipse.ui.part.PageBook) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) IMBeanServerChangeListener(org.talend.designer.runtime.visualization.MBean.IMBeanServerChangeListener) MBeanServerEvent(org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)

Example 4 with MBeanServerEvent

use of org.talend.designer.runtime.visualization.MBean.MBeanServerEvent in project tdi-studio-se by Talend.

the class MBeanServer method removeMonitoredAttributeGroup.

/*
     * @see IMBeanServer#removeMonitoredAttributeGroup(String)
     */
@Override
public void removeMonitoredAttributeGroup(String name) {
    Assert.isNotNull(name);
    IMonitoredMXBeanGroup targetGroup = null;
    for (IMonitoredMXBeanGroup group : monitoredAttributeGroups) {
        if (group.getName().equals(name)) {
            targetGroup = group;
            break;
        }
    }
    if (targetGroup != null) {
        monitoredAttributeGroups.remove(targetGroup);
        fireMBeanServerChangeEvent(new MBeanServerEvent(MBeanServerState.MonitoredAttributeGroupRemoved, targetGroup));
    }
}
Also used : IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) MBeanServerEvent(org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)

Example 5 with MBeanServerEvent

use of org.talend.designer.runtime.visualization.MBean.MBeanServerEvent 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;
}
Also used : IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) MBeanServerEvent(org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)

Aggregations

MBeanServerEvent (org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)6 Composite (org.eclipse.swt.widgets.Composite)2 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2 IActiveJvm (org.talend.designer.runtime.visualization.IActiveJvm)2 IMBeanServerChangeListener (org.talend.designer.runtime.visualization.MBean.IMBeanServerChangeListener)2 IMonitoredMXBeanAttribute (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute)2 IMonitoredMXBeanGroup (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)2 RefreshJob (org.talend.designer.runtime.visualization.internal.ui.RefreshJob)2 ObjectName (javax.management.ObjectName)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 PageBook (org.eclipse.ui.part.PageBook)1