if (null == processExecutionEnvironmentVariables) { processExecutionEnvironmentVariables = new LinkedHashMap<String, String>(); processExecution.setEnvironmentVariables(processExecutionEnvironmentVariables);
private static void applyEnvironmentVars(PropertyList environment, ProcessExecution processExecution) { if (environment != null) { Map<String, String> environmentVariables = processExecution.getEnvironmentVariables(); for (Property prop : environment.getList()) { PropertyMap var = (PropertyMap) prop; environmentVariables.put(var.getSimpleValue("name", null), var.getSimpleValue("value", null)); } processExecution.setEnvironmentVariables(environmentVariables); } }
processExecution.setEnvironmentVariables(envVars);
processExecution.setEnvironmentVariables(envVars);
private ProcessExecution getRpmShutdown() { ProcessExecution processExecution; String rpm = getTomcatServiceNum(); if (isWindows()) { processExecution = new ProcessExecution("net"); // disable the executable existence check because it is a command on the supplied PATH processExecution.setCheckExecutableExists(false); processExecution.setArguments(new ArrayList<String>()); processExecution.getArguments().add("stop"); processExecution.getArguments().add(rpm); } else { processExecution = new ProcessExecution("service"); // disable the executable existence check because it is a command on the supplied PATH processExecution.setCheckExecutableExists(false); processExecution.setArguments(new ArrayList<String>()); processExecution.getArguments().add(rpm); processExecution.getArguments().add("stop"); } Map<String, String> envVars = new LinkedHashMap<String, String>(System.getenv()); log.info("Operation Envs: " + envVars); processExecution.setEnvironmentVariables(envVars); initProcessExecution(processExecution); return processExecution; }
private ProcessExecution getRpmStart(Configuration pluginConfiguration) { ProcessExecution processExecution; String rpm = getTomcatServiceNum(); if (isWindows()) { processExecution = new ProcessExecution("net"); // disable the executable existence check because it is a command on the supplied PATH processExecution.setCheckExecutableExists(false); processExecution.setArguments(new ArrayList<String>()); processExecution.getArguments().add("start"); processExecution.getArguments().add(rpm); } else { processExecution = new ProcessExecution("service"); // disable the executable existence check because it is a command on the supplied PATH processExecution.setCheckExecutableExists(false); processExecution.setArguments(new ArrayList<String>()); processExecution.getArguments().add(rpm); processExecution.getArguments().add("start"); } Map<String, String> envVars = new LinkedHashMap<String, String>(System.getenv()); processExecution.setEnvironmentVariables(envVars); initProcessExecution(processExecution); return processExecution; }
processExecution.setEnvironmentVariables(startScriptEnv);