
public class ProcessExecutor extends Object
| Modifier and Type | Field and Description |
|---|---|
static Map<String,String> |
ENVIRONMENT_PROPERTIES |
| Constructor and Description |
|---|
ProcessExecutor() |
ProcessExecutor(Map<String,String> environmentProperies) |
| Modifier and Type | Method and Description |
|---|---|
ProcessExecution |
execute(Command command)
Executes a process defined by command.
|
ProcessExecution |
execute(ProcessInteraction interaction,
Command 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(Command command)
Spawns a process defined by command.
|
ProcessExecution |
spawn(ProcessInteraction interaction,
Command 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, Command command) throws AndroidExecutionException
ProcessInteraction.interaction - command interactioncommand - command to be executionAndroidExecutionException - if anything goes wrongpublic ProcessExecution spawn(Command command) throws AndroidExecutionException
command - command to be executionAndroidExecutionException - if anything goes wrongpublic ProcessExecution execute(ProcessInteraction interaction, Command command) throws AndroidExecutionException
ProcessInteraction. Waits for process to
finish and checks if process finished with status code 0interaction - command interactioncommand - command to be executionAndroidExecutionException - if anything goes wrongpublic ProcessExecution execute(Command command) throws AndroidExecutionException
command - command to be executionAndroidExecutionException - if anything goes wrongpublic ProcessExecutor removeShutdownHook(Process p)
Copyright © 2013 JBoss by Red Hat. All rights reserved.