Class ProcessHandle

java.lang.Object
com.oracle.libuv.Handle
com.oracle.libuv.ProcessHandle
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class ProcessHandle
extends Handle
  • Method Details

    • setCloseCallback

      public void setCloseCallback​(ProcessCloseCallback callback)
    • setExitCallback

      public void setExitCallback​(ProcessExitCallback callback)
    • spawn

      public int spawn​(java.lang.String program, java.lang.String[] args, java.lang.String[] env, java.lang.String dir, java.util.EnumSet<ProcessHandle.ProcessFlags> flags, StdioOptions[] stdio, int uid, int gid)
      Initializes the process handle and starts the process.

      If the process is successfully spawned, this function will return 0. Otherwise, the negative error code corresponding to the reason it couldn't spawn is returned.

      Possible reasons for failing to spawn would include (but not be limited to) the file to execute not existing, not having permissions to use the setuid or setgid specified, or not having enough memory to allocate for the new process.

    • close

      public void close()
    • kill

      public int kill​(int signal)
      Sends the specified signal to the given process handle.