processExecution = new ProcessExecution(executable); processExecution.setArguments(args);
processExecution = new ProcessExecution(executable); processExecution.setArguments(args);
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; }