org.apache.commons.exec.ProcessDestroyer Java Examples

The following examples show how to use org.apache.commons.exec.ProcessDestroyer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProcessUtil.java    From elasticsearch-maven-plugin with Apache License 2.0 3 votes vote down vote up
/**
 * Run the given command as a process within the supplied instance config context
 * and wait until it finalizes. An ElasticsearchSetupException is thrown if the exit code
 * is not 0.
 * @param config - the instance config
 * @param command - the command to execute
 * @param environment - a map of environment variables; can be null
 * @param processDestroyer - a destroyer handler for the spawned process; can be null 
 * @return the output (not trimmed of whitespaces) of the given command, as separate lines
 */
public static List<String> executeScript(InstanceConfiguration config,
        CommandLine command,
        Map<String, String> environment,
        ProcessDestroyer processDestroyer)
{
    return executeScript(config, command, environment, processDestroyer, false);
}