|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.groboutils.util.thread.v1.BackgroundProcess
Creates and executes the given process. Ensures that all the output
is properly read without overflowing or dead-locking the process.
Outside of the streaming, this class has an identical API to that
of Process
.
Creation of a background process begins at the creation of this object.
Constructor Summary | |
BackgroundProcess(java.lang.Process p)
Initializes the background process with an existing process. |
|
BackgroundProcess(java.lang.String command)
|
|
BackgroundProcess(java.lang.String[] cmdarray)
|
|
BackgroundProcess(java.lang.String[] cmdarray,
java.lang.String[] envp)
|
|
BackgroundProcess(java.lang.String[] cmdarray,
java.lang.String[] envp,
java.io.File dir)
|
|
BackgroundProcess(java.lang.String command,
java.lang.String[] envp)
|
|
BackgroundProcess(java.lang.String command,
java.lang.String[] envp,
java.io.File dir)
|
Method Summary | |
void |
destroy()
|
protected static java.lang.Process |
exec(java.lang.String[] cmd,
java.lang.String[] env,
java.io.File dir)
|
protected java.lang.Process |
exec(java.lang.String cmd,
java.lang.String[] env,
java.io.File dir)
Invoke the correct Exec method for the given parameters. |
int |
exitValue()
|
java.io.InputStream |
getStdErr()
Get the InputStream that retrieves the data from the StdErr of the process. |
java.io.OutputStream |
getStdIn()
Get the OutputStream that is sent to the StdIn of the process. |
java.io.InputStream |
getStdOut()
Get the InputStream that retrieves the data from the StdOut of the process. |
protected static java.lang.Process |
reflectExec(java.lang.Object cmd,
java.lang.String[] env,
java.io.File dir)
Attempts to invoke the JDK 1.3 exec method with the given dir. |
protected static java.lang.String[] |
setPWD(java.lang.String[] env,
java.io.File dir)
Don't change env! |
protected void |
setupProcess(java.lang.Process p)
Initalize the process for internal use. |
int |
waitFor()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BackgroundProcess(java.lang.String command) throws java.io.IOException
Runtime.exec( String )
public BackgroundProcess(java.lang.String[] cmdarray) throws java.io.IOException
Runtime.exec( String[] )
public BackgroundProcess(java.lang.String[] cmdarray, java.lang.String[] envp, java.io.File dir) throws java.io.IOException
Runtime.exec( String[], String[], File )
public BackgroundProcess(java.lang.String command, java.lang.String[] envp, java.io.File dir) throws java.io.IOException
Runtime.exec( String, String[], File )
public BackgroundProcess(java.lang.String[] cmdarray, java.lang.String[] envp) throws java.io.IOException
Runtime.exec( String[], String[] )
public BackgroundProcess(java.lang.String command, java.lang.String[] envp) throws java.io.IOException
Runtime.exec( String, String[] )
public BackgroundProcess(java.lang.Process p) throws java.io.IOException
Method Detail |
public java.io.OutputStream getStdIn()
public java.io.InputStream getStdOut()
public java.io.InputStream getStdErr()
public void destroy()
Process.destroy()
public int exitValue()
Process.exitValue()
public int waitFor() throws java.lang.InterruptedException
java.lang.InterruptedException
Process.waitFor()
protected void setupProcess(java.lang.Process p) throws java.io.IOException
java.io.IOException
protected java.lang.Process exec(java.lang.String cmd, java.lang.String[] env, java.io.File dir) throws java.io.IOException
java.io.IOException
protected static java.lang.Process exec(java.lang.String[] cmd, java.lang.String[] env, java.io.File dir) throws java.io.IOException
java.io.IOException
protected static java.lang.Process reflectExec(java.lang.Object cmd, java.lang.String[] env, java.io.File dir) throws java.io.IOException
java.io.IOException
protected static java.lang.String[] setPWD(java.lang.String[] env, java.io.File dir)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |