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 classLauncher.DrainerA 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.DrainercaptureStdErr(Process p)protected Launcher.DrainercaptureStdOut(Process p)protected ThreaddrainStdErr(Process p)protected ThreaddrainStdOut(Process p)Map<String,String>getEnv()byte[]getInput()byte[]getStderr()byte[]getStdOut()FilegetWorkingDir()booleanisCaptureErr()booleanisCaptureOutput()voidsetEnv(Map<String,String> newEnv)voidsetInput(byte[] input)Set input which will be fed to the launched process's stdinprotected voidsetStdErr(byte[] newErr)protected voidsetStdOut(byte[] newOutput)voidsetWorkingDir(File newWorkingDir)protected ProcessspawnProcess(String cmd)Spawn a process to execute the given commandprotected ProcessspawnProcess(String[] cmd)Spawn a process to execute the given commandStringtoString()
-
-
-
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:
IllegalArgumentExceptionIOException
-
spawnProcess
protected Process spawnProcess(String[] cmd) throws IllegalArgumentException, IOException
Spawn a process to execute the given command- Returns:
- an object representing the process
- Throws:
IllegalArgumentExceptionIOException
-
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
-
-