public class Spawner extends Process
Modifier and Type | Field and Description |
---|---|
int |
CTRLC
A fabricated signal number for use on Windows only.
|
int |
HUP |
int |
INT
On Windows, what this does is far from easy to explain.
|
int |
KILL |
int |
NOOP |
int |
TERM |
Modifier | Constructor and Description |
---|---|
protected |
Spawner(String command)
Executes the specified string command in a separate process.
|
protected |
Spawner(String[] cmdarray)
Executes the specified command and arguments in a separate process.
|
protected |
Spawner(String[] cmdarray,
String[] envp)
Executes the specified command and arguments in a separate process with the
specified environment.
|
protected |
Spawner(String[] cmdarray,
String[] envp,
File dir)
Executes the specified command and arguments in a separate process with the
specified environment and working directory.
|
protected |
Spawner(String[] cmdarray,
String[] envp,
File dir,
PTY pty) |
|
Spawner(String command,
boolean bNoRedirect) |
protected |
Spawner(String cmd,
String[] envp)
Executes the specified string command in a separate process with the specified
environment.
|
protected |
Spawner(String command,
String[] envp,
File dir)
Executes the specified string command in a separate process with the specified
environment and working directory.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
See java.lang.Process#destroy ();
Clients are responsible for explicitly closing any streams
that they have requested through
getErrorStream(), getInputStream() or getOutputStream()
|
void |
exec_detached(String[] cmdarray,
String[] envp,
String dirpath) |
int |
exec2(String[] cmdarray,
String[] envp,
String dir,
int[] chan,
String slaveName,
int masterFD,
boolean console)
Native method when executing with a terminal emulation.
|
int |
exitValue()
See java.lang.Process#exitValue ();
|
protected void |
finalize() |
InputStream |
getErrorStream()
See java.lang.Process#getErrorStream ();
The client is responsible for closing the stream explicitly.
|
InputStream |
getInputStream()
See java.lang.Process#getInputStream ();
The client is responsible for closing the stream explicitly.
|
OutputStream |
getOutputStream()
See java.lang.Process#getOutputStream ();
The client is responsible for closing the stream explicitly.
|
int |
hangup() |
int |
interrupt()
On Windows, interrupt the spawned program by using Cygwin's utility 'kill -SIGINT' if it's a Cgywin
program, otherwise send it a CTRL-C.
|
int |
interruptCTRLC()
On Windows, interrupt the spawned program by send it a CTRL-C (even if it's a Cygwin program).
|
boolean |
isRunning() |
int |
kill() |
int |
raise(int processID,
int sig)
Native method to drop a signal on the process with pid.
|
int |
terminate() |
int |
waitFor()
See java.lang.Process#waitFor ();
|
int |
waitFor(int processID)
Native method to wait(3) for process to terminate.
|
destroyForcibly, isAlive, waitFor
public int NOOP
public int HUP
public int KILL
public int TERM
public int INT
public int CTRLC
public Spawner(String command, boolean bNoRedirect) throws IOException
IOException
protected Spawner(String[] cmdarray, String[] envp, File dir) throws IOException
IOException
protected Spawner(String[] cmdarray, String[] envp, File dir, PTY pty) throws IOException
IOException
protected Spawner(String command) throws IOException
IOException
protected Spawner(String[] cmdarray) throws IOException
IOException
protected Spawner(String[] cmdarray, String[] envp) throws IOException
IOException
protected Spawner(String cmd, String[] envp) throws IOException
IOException
protected Spawner(String command, String[] envp, File dir) throws IOException
IOException
protected void finalize() throws Throwable
public InputStream getInputStream()
getInputStream
in class Process
public OutputStream getOutputStream()
getOutputStream
in class Process
public InputStream getErrorStream()
getErrorStream
in class Process
public int waitFor() throws InterruptedException
waitFor
in class Process
InterruptedException
public int exitValue()
public void destroy()
public int interrupt()
public int interruptCTRLC()
public int hangup()
public int kill()
public int terminate()
public boolean isRunning()
public void exec_detached(String[] cmdarray, String[] envp, String dirpath) throws IOException
IOException
public int exec2(String[] cmdarray, String[] envp, String dir, int[] chan, String slaveName, int masterFD, boolean console) throws IOException
IOException
public int raise(int processID, int sig)
public int waitFor(int processID)
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.