Search in sources :

Example 1 with ThreadDumpParser

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

the class ThreadDumpEditor method parseDumpFile.

/**
     * Parses the dump file.
     * 
     * @param filePath The file path
     */
private void parseDumpFile(final String filePath) {
    Job job = new Job(Messages.parseThreadDumpFileJobLabel) {

        @Override
        protected IStatus run(IProgressMonitor monitor) {
            final ThreadDumpParser parser = new ThreadDumpParser(new File(filePath), threadListElements, monitor);
            try {
                parser.parse();
            } catch (ParserConfigurationException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
            } catch (SAXException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
            } catch (IOException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
            }
            setProfileInfo(parser.getProfileInfo());
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    if (threadSashForm != null) {
                        threadSashForm.refresh();
                    }
                }
            });
            return Status.OK_STATUS;
        }
    };
    job.schedule();
}
Also used : ThreadDumpParser(org.talend.designer.runtime.visualization.core.dump.ThreadDumpParser) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) Job(org.eclipse.core.runtime.jobs.Job) File(java.io.File) SAXException(org.xml.sax.SAXException)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 Job (org.eclipse.core.runtime.jobs.Job)1 ThreadDumpParser (org.talend.designer.runtime.visualization.core.dump.ThreadDumpParser)1 SAXException (org.xml.sax.SAXException)1