Package com.io7m.waxmill.process.posix

# Class WXMProcessesPOSIX

java.lang.Object
com.io7m.waxmill.process.posix.WXMProcessesPOSIX

All Implemented Interfaces:
  `WXMProcessesType`

    public final class WXMProcessesPOSIX
    extends java.lang.Object
    implements WXMProcessesType

A JNA POSIX implementation of the process creator.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `static WXMProcessesType` | `create()` |
  `void` | `processReplaceCurrent​(WXMProcessDescription description)` | Replace the current process with the process described by the given description.
  `java.lang.Process` | `processStart​(WXMProcessDescription description)` | Start a process described by the given description.
  `void` | `processStartAndWait​(WXMProcessDescription description)` | Start a process described by the given description.
  `java.lang.String` | `toString()` |

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### create

    public static WXMProcessesType create()
    Returns:
      A new process creator.

  - ### processReplaceCurrent

    public void processReplaceCurrent​(WXMProcessDescription description) throws java.io.IOException
    Description copied from interface: `WXMProcessesType`
    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.
    Specified by:
      `processReplaceCurrent` in interface `WXMProcessesType`
    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.IOException
    Description copied from interface: `WXMProcessesType`
    Start 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:
      `processStart` in interface `WXMProcessesType`
    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.InterruptedException
    Description copied from interface: `WXMProcessesType`
    Start 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 calling `WXMProcessesType.processStart(WXMProcessDescription)`, waiting indefinitely for the process to exit, and throwing an `IOException` if the process returns a non-zero exit code.
    Specified by:
      `processStartAndWait` in interface `WXMProcessesType`
    Parameters:
      `description` - The description
    Throws:
      `java.io.IOException` - If the process cannot be started, or if the process exits with a non-zero error code
      `java.lang.InterruptedException` - If waiting for the process is interrupted

  - ### toString

    public java.lang.String toString()
    Overrides:
      `toString` in class `java.lang.Object`