Search in sources :

Example 1 with StatPortChecker

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();
}
Also used : StatPortChecker(org.talend.designer.esb.runcontainer.util.StatPortChecker) MavenJavaProcessor(org.talend.designer.runprocess.maven.MavenJavaProcessor) IDesignerCoreService(org.talend.designer.core.IDesignerCoreService) IProcessor(org.talend.designer.runprocess.IProcessor) IProcess(org.talend.core.model.process.IProcess)

Aggregations

IProcess (org.talend.core.model.process.IProcess)1 IDesignerCoreService (org.talend.designer.core.IDesignerCoreService)1 StatPortChecker (org.talend.designer.esb.runcontainer.util.StatPortChecker)1 IProcessor (org.talend.designer.runprocess.IProcessor)1 MavenJavaProcessor (org.talend.designer.runprocess.maven.MavenJavaProcessor)1