
public class ProcessExecutor extends Object
| Constructor and Description |
|---|
ProcessExecutor() |
ProcessExecutor(Map<String,String> environmentProperies) |
| Modifier and Type | Method and Description |
|---|---|
ProcessExecution |
execute(ProcessInteraction interaction,
String[] command)
Executes a process defined by command.
|
ProcessExecution |
execute(String... command)
Executes a process defined by command.
|
ProcessExecutor |
removeShutdownHook(Process p) |
Boolean |
scheduleUntilTrue(Callable<Boolean> callable,
long timeout,
long step,
TimeUnit unit)
Schedules a callable to be executed in regular intervals
|
ProcessExecution |
spawn(ProcessInteraction interaction,
String[] command)
Spawns a process defined by command.
|
ProcessExecution |
spawn(String... command)
Spawns a process defined by command.
|
<T> Future<T> |
submit(Callable<T> callable)
Submit callable to be executed
|
public <T> Future<T> submit(Callable<T> callable)
callable - to be executedpublic Boolean scheduleUntilTrue(Callable<Boolean> callable, long timeout, long step, TimeUnit unit) throws InterruptedException, ExecutionException
callable - Callabletimeout - Total timeoutstep - delay before next executionunit - time unittrue if executed successfully, false otherwiseInterruptedExceptionExecutionExceptionpublic ProcessExecution spawn(ProcessInteraction interaction, String[] command) throws ProcessExecutionException
ProcessInteraction.interaction - command interactioncommand - command to be executionProcessExecutionExceptionpublic ProcessExecution spawn(String... command) throws ProcessExecutionException
command - command to be executionProcessExecutionException - if anything goes wrongpublic ProcessExecution execute(ProcessInteraction interaction, String[] command) throws ProcessExecutionException
ProcessInteraction. Waits for process to
finish and checks if process finished with status code 0interaction - command interactioncommand - command to be executionProcessExecutionException - if anything goes wrongpublic ProcessExecution execute(String... command) throws ProcessExecutionException
command - command to be executionProcessExecutionException - if anything goes wrongpublic ProcessExecutor removeShutdownHook(Process p)
Copyright © 2014 JBoss by Red Hat. All rights reserved.