edu.iastate.jtm.util
Class ProcessWrapper
java.lang.Object
edu.iastate.jtm.gui.DefaultMonitorable
edu.iastate.jtm.util.ProcessWrapper
- All Implemented Interfaces:
- Monitorable
public class ProcessWrapper
- extends DefaultMonitorable
A wrapper class for a commandline process.
- Author:
- Jing Ding
|
Field Summary |
protected java.lang.String |
cmdline
|
|
Constructor Summary |
ProcessWrapper(java.lang.String cmd)
Creates a new instance of ProcessMoniter |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cmdline
protected java.lang.String cmdline
ProcessWrapper
public ProcessWrapper(java.lang.String cmd)
throws ProcessWrapper.CmdNotFoundException
- Creates a new instance of ProcessMoniter
- Throws:
ProcessWrapper.CmdNotFoundException
setCmdline
public void setCmdline(java.lang.String c)
throws ProcessWrapper.CmdNotFoundException
- Throws:
ProcessWrapper.CmdNotFoundException
isTerminated
public boolean isTerminated()
getExitValue
public int getExitValue()
setWaitTime
public void setWaitTime(long wt)
addProcessListener
public void addProcessListener(ProcessListener pl)
removeProcessListener
public void removeProcessListener(ProcessListener pl)
report
protected void report(java.lang.String message,
float progress)
end
protected void end(int eValue)
run
public int run(java.lang.String args)
throws java.io.IOException
- Throws:
java.io.IOException
processStdout
protected void processStdout(char[] output,
int count)
processStderr
protected void processStderr(char[] output,
int count)
main
public static void main(java.lang.String[] args)
throws java.io.IOException,
ProcessWrapper.CmdNotFoundException
- Parameters:
args - the command line arguments
- Throws:
java.io.IOException
ProcessWrapper.CmdNotFoundException