|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ccs.utils.ProcessMonitor
public class ProcessMonitor
A ProcessMonitor monitors a running child Process
object and transfers
its stdout and stderr streams to System.out and System.err respectively.
Without this, more "conversational" apps may block when the stream buffers
get full (and you have no debugging diagnostics if something goes wrong).
Constructor Summary | |
---|---|
ProcessMonitor(java.lang.Process proc)
Create a new ProcessMonitor with a default catnap period. |
|
ProcessMonitor(java.lang.Process proc,
int catnap)
Create a new ProcessMonitor. |
Method Summary | |
---|---|
int |
getExitCode()
Obtain the process' exit code. |
void |
run()
Monitor the process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProcessMonitor(java.lang.Process proc)
proc
- The process to monitor.public ProcessMonitor(java.lang.Process proc, int catnap)
proc
- The process to monitor.catnap
- The time in ms to wait, when there is no output from
the child process, before trying again.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
public int getExitCode() throws java.lang.IllegalThreadStateException
java.lang.IllegalThreadStateException
- If the process hasn't finished
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |