// Create configuration
Configuration configuration = new ConfigBuilder("bash", "./script.sh")
.setMasterLogFile(new File("~/masterlog.json"), Boolean.TRUE, Charset.defaultCharset())
.enableLogStreaming(Boolean.TRUE).setParam("param1")
.setParamList(Arrays.asList("param2", "param3"))
.build();
{
// Method 1 - start the runner at later point of time in sync and async manner.
Runner runner = RunnerFactory.getRunner(configuration);
Output output = runner.run();
output = runner.runAsync().get();
}
{
// Method 2 - Start instantly synchronously and async only.
Output output = RunnerFactory.startProcess(configuration);
output = RunnerFactory.startAsyncProcess(configuration).get();
}
ProcessRunner library can run any system process from java and have the following features :-