use of org.talend.designer.esb.runcontainer.util.StatPortChecker in project tesb-studio-se by Talend.
the class JobJavaScriptOSGIForESBRuntimeManager method generateJobFiles.
@Override
protected IProcess generateJobFiles(ProcessItem process, String contextName, String version, boolean statistics, boolean trace, boolean applyContextToChildren, IProgressMonitor monitor) throws ProcessorException {
LastGenerationInfo.getInstance().getUseDynamicMap().clear();
// TODO stat port tracer, to replace the port, need to improve efficiency
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
IProcess currentProcess = service.getProcessFromProcessItem(process);
IProcessor processor = ProcessorUtilities.getProcessor(currentProcess, null);
StatPortChecker checker = null;
if (processor instanceof MavenJavaProcessor) {
MavenJavaProcessor mvnProcessor = (MavenJavaProcessor) processor;
checker = new StatPortChecker(processor.getCodeProject().getFile(mvnProcessor.getSrcCodePath()).getLocation(), statisticPort, tracePort);
new Thread(checker, "Statistic Port Finder").start();
mvnProcessor = null;
}
IProcessor processor2 = ProcessorUtilities.generateCode(process, contextName, version, statistics, trace, applyContextToChildren, isOptionChoosed(ExportChoice.needContext), monitor);
if (checker != null) {
checker.stop();
}
return processor2.getProcess();
}
Aggregations