use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class HeapHistogramPage method refresh.
/**
* Refreshes the appearance.
*/
public void refresh() {
// for dump editor
if (section == null || isDisposed()) {
return;
}
final boolean isVisible = isVisible();
new RefreshJob(NLS.bind(Messages.refreshMemorySectionJobLabel, section.getJvm().getPid()), getId()) {
@Override
protected void refreshModel(IProgressMonitor monitor) {
if (!isSupported() || !isVisible) {
return;
}
try {
IActiveJvm jvm = section.getJvm();
if (jvm != null && jvm.isConnected() && !jvm.isRemote() && !section.isRefreshSuspended()) {
jvm.getMBeanServer().refreshHeapCache();
}
} catch (JvmCoreException e) {
Activator.log(Messages.refreshHeapDataFailedMsg, e);
}
}
@Override
protected void refreshUI() {
IActiveJvm jvm = section.getJvm();
boolean isConnected = jvm != null && jvm.isConnected();
boolean isRemote = jvm != null && jvm.isRemote();
boolean isSupported = isSupported();
if (!heapViewer.getControl().isDisposed() && heapViewer.getControl().isVisible() && isSupported) {
heapViewer.refresh();
}
if (!isDisposed()) {
refreshBackground();
}
dumpHprofAction.setEnabled(isConnected);
dumpHeapAction.setEnabled(!section.hasErrorMessage() && !isRemote && isSupported);
refreshAction.setEnabled(isConnected && !isRemote && isSupported);
garbageCollectorAction.setEnabled(isConnected);
clearHeapDeltaAction.setEnabled(isConnected && !isRemote && isSupported);
}
}.schedule();
}
use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class ResumeCpuProfilingAction method performRun.
/*
* @see AbstractJobAction#performRun(IProgressMonitor)
*/
@Override
protected IStatus performRun(IProgressMonitor monitor) {
IActiveJvm jvm = section.getJvm();
if (jvm == null) {
return Status.CANCEL_STATUS;
}
if (jvm.getCpuProfiler().getProfilerType() == ProfilerType.BCI) {
try {
jvm.getCpuProfiler().transformClasses(monitor);
} catch (JvmCoreException e) {
Activator.log(Messages.resumeCpuProfilingFailedMsg, e);
} catch (InterruptedException e) {
return Status.CANCEL_STATUS;
}
}
try {
jvm.getCpuProfiler().resume();
} catch (JvmCoreException e) {
Activator.log(Messages.resumeCpuProfilingFailedMsg, e);
}
suspendAction.setEnabled(true);
return Status.OK_STATUS;
}
use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class DumpCpuProfilingDataAction method performRun.
/*
* @see AbstractJobAction#performRun(IProgressMonitor)
*/
@Override
protected IStatus performRun(IProgressMonitor monitor) {
IActiveJvm jvm = section.getJvm();
if (jvm == null) {
return Status.CANCEL_STATUS;
}
IFileStore fileStore = null;
try {
fileStore = jvm.getCpuProfiler().dump();
} catch (JvmCoreException e) {
Activator.log(Messages.dumpCpuProfileDataFailedMsg, e);
return Status.CANCEL_STATUS;
}
section.setPinned(true);
OpenSnapshotAction.openEditor(fileStore);
return Status.OK_STATUS;
}
use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.
the class AbstractJvmPropertySection method setInput.
/*
* @see AbstractPropertySection#setInput(IWorkbenchPart, ISelection)
*/
@Override
public final void setInput(IWorkbenchPart part, ISelection selection) {
super.setInput(part, selection);
if (!(selection instanceof StructuredSelection)) {
return;
}
StructuredSelection structuredSelection = (StructuredSelection) selection;
Object firstElement = structuredSelection.getFirstElement();
if (!(firstElement instanceof IActiveJvm)) {
super.setInput(part, null);
return;
}
IActiveJvm oldJvm = jvm;
IActiveJvm newJvm = (IActiveJvm) firstElement;
jvm = newJvm;
if (oldJvm != newJvm || newJvm.isConnected()) {
updatePage();
}
addToolBarActions();
addLocalMenus();
if (newJvm.isConnected()) {
activateSection();
}
setInput(part, selection, newJvm, oldJvm);
}
Aggregations