Search in sources :

Example 1 with ITargetExecutionConfig

use of org.talend.core.model.process.ITargetExecutionConfig in project tdi-studio-se by Talend.

the class JavaProcessor method getJVMArgs.

@Override
public String[] getJVMArgs() {
    String[] vmargs = getSettingsJVMArguments();
    /* check parameter won't happened on exportingJob */
    List<String> asList = convertArgsToList(vmargs);
    if (!isExportConfig() && !isRunAsExport()) {
        //$NON-NLS-1$
        String fileEncoding = System.getProperty("file.encoding");
        //$NON-NLS-1$
        String encodingFromIni = "-Dfile.encoding=" + fileEncoding;
        boolean encodingSetInjob = false;
        for (String arg : asList) {
            if (arg.startsWith("-Dfile.encoding") && fileEncoding != null) {
                //$NON-NLS-1$
                /* if user has set the encoding on .ini file,should use this when exetucte job */
                arg = encodingFromIni;
                encodingSetInjob = true;
            }
        }
        if (!encodingSetInjob) {
            asList.add(encodingFromIni);
        }
    }
    // add args if using JMX.
    RunProcessContext runProcessContext = RunProcessPlugin.getDefault().getRunProcessContextManager().getActiveContext();
    if (runProcessContext != null) {
        ITargetExecutionConfig config = runProcessContext.getSelectedTargetExecutionConfig();
        if (config != null && config.getCommandlineServerConfig() == null) {
            if (config.isRemote()) {
                if (config.isUseJMX()) {
                    //$NON-NLS-1$
                    asList.add("-Dcom.sun.management.jmxremote");
                    //$NON-NLS-1$
                    asList.add("-Dcom.sun.management.jmxremote.port=" + config.getRemotePort());
                    //$NON-NLS-1$
                    asList.add("-Dcom.sun.management.jmxremote.ssl=false");
                    //$NON-NLS-1$
                    asList.add("-Dcom.sun.management.jmxremote.authenticate=false");
                }
            }
        }
    }
    vmargs = asList.toArray(new String[0]);
    return vmargs;
}
Also used : RunProcessContext(org.talend.designer.runprocess.RunProcessContext) ITargetExecutionConfig(org.talend.core.model.process.ITargetExecutionConfig)

Example 2 with ITargetExecutionConfig

use of org.talend.core.model.process.ITargetExecutionConfig in project tdi-studio-se by Talend.

the class MemoryRuntimeComposite method getRemoteStatus.

private void getRemoteStatus() {
    ITargetExecutionConfig config = processContext.getSelectedTargetExecutionConfig();
    if (config != null) {
        remoteHost = config.getHost();
        isRemoteRun = config.isRemote();
        isCommandlineRun = config.getCommandlineServerConfig() == null ? false : true;
        this.isRemoteMonitoring = config.isUseJMX();
        this.remotePort = config.getRemotePort();
    }
}
Also used : ITargetExecutionConfig(org.talend.core.model.process.ITargetExecutionConfig)

Aggregations

ITargetExecutionConfig (org.talend.core.model.process.ITargetExecutionConfig)2 RunProcessContext (org.talend.designer.runprocess.RunProcessContext)1