Package com.io7m.waxmill.process.posix
Class WXMProcessesPOSIXService
java.lang.Object
com.io7m.waxmill.process.posix.WXMProcessesPOSIXService
- All Implemented Interfaces:
WXMProcessesType
public final class WXMProcessesPOSIXService extends java.lang.Object implements WXMProcessesType
A JNA POSIX implementation of the process creator.
-
Constructor Summary
Constructors Constructor Description WXMProcessesPOSIXService() -
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.java.lang.StringtoString()
-
Constructor Details
-
WXMProcessesPOSIXService
public WXMProcessesPOSIXService()
-
-
Method Details
-
processReplaceCurrent
Description copied from interface:WXMProcessesTypeReplace 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.- Specified by:
processReplaceCurrentin interfaceWXMProcessesType- Parameters:
description- The description- Throws:
java.io.IOException- If the process cannot be started
-
processStart
public java.lang.Process processStart(WXMProcessDescription description) throws java.io.IOExceptionDescription copied from interface:WXMProcessesTypeStart a process described by the given description. This creates a new process upon which the caller can wait, extract data from streams, etc.- Specified by:
processStartin interfaceWXMProcessesType- Parameters:
description- The description- Returns:
- The newly executing process
- Throws:
java.io.IOException- If the process cannot be started
-
processStartAndWait
public void processStartAndWait(WXMProcessDescription description) throws java.io.IOException, java.lang.InterruptedExceptionDescription copied from interface:WXMProcessesTypeStart 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 callingWXMProcessesType.processStart(WXMProcessDescription), waiting indefinitely for the process to exit, and throwing anIOExceptionif the process returns a non-zero exit code.- Specified by:
processStartAndWaitin interfaceWXMProcessesType- 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
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-