public class ProcessHandle extends Handle
| Modifier and Type | Class and Description |
|---|---|
static class |
ProcessHandle.ProcessFlags |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
kill(int signal)
Sends the specified signal to the given process handle.
|
void |
setCloseCallback(ProcessCloseCallback callback) |
void |
setExitCallback(ProcessExitCallback callback) |
int |
spawn(String program,
String[] args,
String[] env,
String dir,
EnumSet<ProcessHandle.ProcessFlags> flags,
StdioOptions[] stdio,
int uid,
int gid)
Initializes the process handle and starts the process.
|
public void setCloseCallback(ProcessCloseCallback callback)
public void setExitCallback(ProcessExitCallback callback)
public int spawn(String program, String[] args, String[] env, String dir, EnumSet<ProcessHandle.ProcessFlags> flags, StdioOptions[] stdio, int uid, int gid)
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.
public void close()
public int kill(int signal)
Copyright © 2021 WebFolder. All rights reserved.