Package com.ibm.wala.util.processes
Class Launcher
- java.lang.Object
-
- com.ibm.wala.util.processes.Launcher
-
- Direct Known Subclasses:
BasicLauncher
,JavaLauncher
public abstract class Launcher extends Object
Abstract base class for a process launcher
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
Launcher.Drainer
A thread that runs in a loop, performing the drain() action until a process terminates
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Launcher.Drainer
captureStdErr(Process p)
protected Launcher.Drainer
captureStdOut(Process p)
protected Thread
drainStdErr(Process p)
protected Thread
drainStdOut(Process p)
Map<String,String>
getEnv()
byte[]
getInput()
byte[]
getStderr()
byte[]
getStdOut()
File
getWorkingDir()
boolean
isCaptureErr()
boolean
isCaptureOutput()
void
setEnv(Map<String,String> newEnv)
void
setInput(byte[] input)
Set input which will be fed to the launched process's stdinprotected void
setStdErr(byte[] newErr)
protected void
setStdOut(byte[] newOutput)
void
setWorkingDir(File newWorkingDir)
protected Process
spawnProcess(String cmd)
Spawn a process to execute the given commandprotected Process
spawnProcess(String[] cmd)
Spawn a process to execute the given commandString
toString()
-
-
-
Method Detail
-
getWorkingDir
public File getWorkingDir()
-
setWorkingDir
public void setWorkingDir(File newWorkingDir)
-
spawnProcess
protected Process spawnProcess(String cmd) throws IllegalArgumentException, IOException
Spawn a process to execute the given command- Returns:
- an object representing the process
- Throws:
IllegalArgumentException
IOException
-
spawnProcess
protected Process spawnProcess(String[] cmd) throws IllegalArgumentException, IOException
Spawn a process to execute the given command- Returns:
- an object representing the process
- Throws:
IllegalArgumentException
IOException
-
captureStdOut
protected Launcher.Drainer captureStdOut(Process p)
-
captureStdErr
protected Launcher.Drainer captureStdErr(Process p)
-
isCaptureOutput
public boolean isCaptureOutput()
-
isCaptureErr
public boolean isCaptureErr()
-
getStdOut
public byte[] getStdOut()
-
getStderr
public byte[] getStderr()
-
setStdOut
protected void setStdOut(byte[] newOutput)
-
setStdErr
protected void setStdErr(byte[] newErr)
-
getInput
public byte[] getInput()
-
setInput
public void setInput(byte[] input)
Set input which will be fed to the launched process's stdin
-
-