public class Spawner
extends java.lang.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(java.lang.String command)
Executes the specified string command in a separate process.
|
protected |
Spawner(java.lang.String[] cmdarray)
Executes the specified command and arguments in a separate process.
|
protected |
Spawner(java.lang.String[] cmdarray,
java.lang.String[] envp)
Executes the specified command and arguments in a separate process with the
specified environment.
|
protected |
Spawner(java.lang.String[] cmdarray,
java.lang.String[] envp,
java.io.File dir)
Executes the specified command and arguments in a separate process with the
specified environment and working directory.
|
protected |
Spawner(java.lang.String[] cmdarray,
java.lang.String[] envp,
java.io.File dir,
PTY pty) |
|
Spawner(java.lang.String command,
boolean bNoRedirect) |
protected |
Spawner(java.lang.String cmd,
java.lang.String[] envp)
Executes the specified string command in a separate process with the specified
environment.
|
protected |
Spawner(java.lang.String command,
java.lang.String[] envp,
java.io.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(java.lang.String[] cmdarray,
java.lang.String[] envp,
java.lang.String dirpath) |
int |
exec2(java.lang.String[] cmdarray,
java.lang.String[] envp,
java.lang.String dir,
int[] chan,
java.lang.String slaveName,
int masterFD,
boolean console)
Native method when executing with a terminal emulation.
|
int |
exitValue()
See java.lang.Process#exitValue ();
|
protected void |
finalize() |
java.io.InputStream |
getErrorStream()
See java.lang.Process#getErrorStream ();
The client is responsible for closing the stream explicitly.
|
java.io.InputStream |
getInputStream()
See java.lang.Process#getInputStream ();
The client is responsible for closing the stream explicitly.
|
java.io.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.
|
public int NOOP
public int HUP
public int KILL
public int TERM
public int INT
public int CTRLC
public Spawner(java.lang.String command, boolean bNoRedirect) throws java.io.IOException
java.io.IOException
protected Spawner(java.lang.String[] cmdarray, java.lang.String[] envp, java.io.File dir) throws java.io.IOException
java.io.IOException
protected Spawner(java.lang.String[] cmdarray, java.lang.String[] envp, java.io.File dir, PTY pty) throws java.io.IOException
java.io.IOException
protected Spawner(java.lang.String command) throws java.io.IOException
java.io.IOException
protected Spawner(java.lang.String[] cmdarray) throws java.io.IOException
java.io.IOException
protected Spawner(java.lang.String[] cmdarray, java.lang.String[] envp) throws java.io.IOException
java.io.IOException
protected Spawner(java.lang.String cmd, java.lang.String[] envp) throws java.io.IOException
java.io.IOException
protected Spawner(java.lang.String command, java.lang.String[] envp, java.io.File dir) throws java.io.IOException
java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.io.InputStream getInputStream()
getInputStream
in class java.lang.Process
public java.io.OutputStream getOutputStream()
getOutputStream
in class java.lang.Process
public java.io.InputStream getErrorStream()
getErrorStream
in class java.lang.Process
public int waitFor() throws java.lang.InterruptedException
waitFor
in class java.lang.Process
java.lang.InterruptedException
public int exitValue()
exitValue
in class java.lang.Process
public void destroy()
destroy
in class java.lang.Process
public int interrupt()
public int interruptCTRLC()
public int hangup()
public int kill()
public int terminate()
public boolean isRunning()
public void exec_detached(java.lang.String[] cmdarray, java.lang.String[] envp, java.lang.String dirpath) throws java.io.IOException
java.io.IOException
public int exec2(java.lang.String[] cmdarray, java.lang.String[] envp, java.lang.String dir, int[] chan, java.lang.String slaveName, int masterFD, boolean console) throws java.io.IOException
java.io.IOException
public int raise(int processID, int sig)
public int waitFor(int processID)
Copyright (c) IBM Corp. and others 2004, 2014. All Rights Reserved.