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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProcessHandle.ProcessFlags -
Field Summary
-
Method Summary
Modifier and Type Method Description voidclose()intkill(int signal)Sends the specified signal to the given process handle.voidsetCloseCallback(ProcessCloseCallback callback)voidsetExitCallback(ProcessExitCallback callback)intspawn(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.
-
Method Details
-
setCloseCallback
-
setExitCallback
-
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.
-