Interface MNativeProcessesType
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
MNativeProcesses
An interface for running external native processes.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intexecuteAndWait(Map<String, String> environment, ConcurrentLinkedQueue<String> standardOut, ConcurrentLinkedQueue<String> standardError, List<String> commandLine) Execute a process, waiting for it to complete, and return the exit code.default voidexecuteAndWaitChecked(Map<String, String> environment, ConcurrentLinkedQueue<String> standardOut, ConcurrentLinkedQueue<String> standardError, List<String> commandLine) Execute a process, waiting for it to complete, and raise an exception if the exit code returned is non-zero.
-
Method Details
-
executeAndWait
int executeAndWait(Map<String, String> environment, ConcurrentLinkedQueue<String> standardOut, ConcurrentLinkedQueue<String> standardError, List<String> commandLine) throws MException, InterruptedExceptionExecute a process, waiting for it to complete, and return the exit code.- Parameters:
environment- The environmentstandardOut- The standard out logstandardError- The standard error logcommandLine- The command line- Returns:
- The exit code
- Throws:
MException- On errorsInterruptedException- On interruption
-
executeAndWaitChecked
default void executeAndWaitChecked(Map<String, String> environment, ConcurrentLinkedQueue<String> standardOut, ConcurrentLinkedQueue<String> standardError, List<String> commandLine) throws MException, InterruptedExceptionExecute a process, waiting for it to complete, and raise an exception if the exit code returned is non-zero.- Parameters:
environment- The environmentstandardOut- The standard out logstandardError- The standard error logcommandLine- The command line- Throws:
MException- On errorsInterruptedException- On interruption
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
MException
-