Package com.io7m.waxmill.process.api
Interface WXMProcessesType
- All Known Implementing Classes:
WXMProcessesPOSIX,WXMProcessesPOSIXService
public interface WXMProcessesType
An API for creating processes.
-
Method Summary
Modifier and Type Method Description voidprocessReplaceCurrent(WXMProcessDescription description)Replace the current process with the process described by the given description.java.lang.ProcessprocessStart(WXMProcessDescription description)Start a process described by the given description.voidprocessStartAndWait(WXMProcessDescription description)Start a process described by the given description.
-
Method Details
-
processReplaceCurrent
Replace the current process with the process described by the given description. This method, if it executes successfully, replaces the current JVM process entirely and therefore never returns.- Parameters:
description- The description- Throws:
java.io.IOException- If the process cannot be started
-
processStart
Start a process described by the given description. This creates a new process upon which the caller can wait, extract data from streams, etc.- Parameters:
description- The description- Returns:
- The newly executing process
- Throws:
java.io.IOException- If the process cannot be started
-
processStartAndWait
void processStartAndWait(WXMProcessDescription description) throws java.io.IOException, java.lang.InterruptedExceptionStart a process described by the given description. This creates a new process upon which the caller can wait, extract data from streams, etc. This method is equivalent to callingprocessStart(WXMProcessDescription), waiting indefinitely for the process to exit, and throwing anIOExceptionif the process returns a non-zero exit code.- Parameters:
description- The description- Throws:
java.io.IOException- If the process cannot be started, or if the process exits with a non-zero error codejava.lang.InterruptedException- If waiting for the process is interrupted
-