Search in sources :

Example 21 with IActiveJvm

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

the class SuspendCpuProfilingAction method performRun.

/*
     * @see AbstractJobAction#performRun(IProgressMonitor)
     */
@Override
protected IStatus performRun(IProgressMonitor monitor) {
    IActiveJvm jvm = section.getJvm();
    if (jvm == null) {
        return Status.CANCEL_STATUS;
    }
    try {
        jvm.getCpuProfiler().suspend();
    } catch (JvmCoreException e) {
        Activator.log(Messages.suspendingCpuProfilingFailedMsg, e);
    }
    resumeAction.setEnabled(true);
    return Status.OK_STATUS;
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) JvmCoreException(org.talend.designer.runtime.visualization.JvmCoreException)

Example 22 with IActiveJvm

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

the class CpuSection method setProfilerSamplingPeriod.

/**
     * Sets the profiler sampling period.
     */
void setProfilerSamplingPeriod() {
    IActiveJvm jvm = getJvm();
    if (jvm == null) {
        return;
    }
    Integer period = null;
    String periodString = Activator.getDefault().getDialogSettings(CpuSection.class.getName()).get(IConstants.PROFILER_SAMPLING_PERIOD_KEY);
    if (periodString != null) {
        try {
            period = Integer.valueOf(periodString);
        } catch (NumberFormatException e) {
        // do nothing
        }
    }
    if (period == null) {
        period = DEFAULT_SAMPLING_PERIOD;
    }
    jvm.getCpuProfiler().setSamplingPeriod(period);
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm)

Example 23 with IActiveJvm

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

the class CpuSection method jvmModelChanged.

/*
     * @see AbstractJvmPropertySection#jvmModelChanged(JvmModelEvent)
     */
@Override
public void jvmModelChanged(JvmModelEvent event) {
    super.jvmModelChanged(event);
    IActiveJvm jvm = getJvm();
    if (jvm == null || event.jvm == null || event.jvm.getPid() != jvm.getPid() || !(event.jvm instanceof IActiveJvm)) {
        return;
    }
    if (event.state == State.JvmConnected) {
        refresh(true);
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm)

Example 24 with IActiveJvm

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

the class ConfigChartAction method run.

/*
     * @see Action#run()
     */
@Override
public void run() {
    IActiveJvm jvm = runtimeComposite.getJvm();
    if (jvm == null) {
        return;
    }
    String title = chart.getSection().getText();
    IMonitoredMXBeanGroup group = chart.getAttributeGroup();
    AxisUnit unit = group.getAxisUnit();
    List<MBeanAttribute> attributes = getAttributes();
    ConfigureChartDialog dialog = new ConfigureChartDialog(chart.getShell(), title, unit, attributes, jvm, true);
    if (dialog.open() == Window.OK) {
        performConfiguration(dialog.getChartTitle(), dialog.getAxisUnit(), dialog.getAttributes(), dialog.getRemovedAttributes());
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) AxisUnit(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup.AxisUnit)

Example 25 with IActiveJvm

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

the class OverviewSection method getDialogSettings.

/**
     * Gets the dialog settings for the tree expansion state.
     * 
     * @return The dialog settings
     */
private IDialogSettings getDialogSettings() {
    String id = sectionName;
    IActiveJvm jvm = getJvm();
    if (jvm != null) {
        id += jvm.getPid();
    }
    IDialogSettings settings = Activator.getDefault().getDialogSettings();
    IDialogSettings section = settings.getSection(id);
    if (section == null) {
        section = settings.addNewSection(id);
    }
    return section;
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings)

Aggregations

IActiveJvm (org.talend.designer.runtime.visualization.IActiveJvm)54 JvmCoreException (org.talend.designer.runtime.visualization.JvmCoreException)14 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)7 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)6 RefreshJob (org.talend.designer.runtime.visualization.internal.ui.RefreshJob)6 IMonitoredMXBeanGroup (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)5 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 ObjectName (javax.management.ObjectName)2 Job (org.eclipse.core.runtime.jobs.Job)2 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 Composite (org.eclipse.swt.widgets.Composite)2 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2 IHost (org.talend.designer.runtime.visualization.IHost)2 JvmModelEvent (org.talend.designer.runtime.visualization.JvmModelEvent)2 IMBeanServerChangeListener (org.talend.designer.runtime.visualization.MBean.IMBeanServerChangeListener)2 IMonitoredMXBeanAttribute (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute)2 AxisUnit (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup.AxisUnit)2 MBeanServerEvent (org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)2