|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
nl.knowledgeplaza.util.Exec
public class Exec
Implements an exec() interface. The primary reason for this class is to insulate the developer from the vagaries of Runtime.exec(), which appears to have a number of problems depending on the environment in which it is run.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Exec(java.lang.String[] argv,
java.lang.String[] envp)
Create an exec object that will throw away all output. |
|
Exec(java.lang.String[] argv,
java.lang.String[] envp,
java.io.PrintWriter pWriter)
Create an exec object that will write output to a PrintWriter. |
|
Exec(java.lang.String[] argv,
java.lang.String[] envp,
java.lang.StringBuffer sBuffer)
Create an exec object that will write output into StringBuffer. |
|
| Method Summary | |
|---|---|
void |
debugExec(java.lang.StringBuffer buf)
Use this to append the parameters into the results. |
void |
dump()
Use this to dump the parameters to System.err. |
void |
exec()
Run the program. |
int |
getExitValue()
Get the exit value of the exec(). |
void |
run()
Runtime.exec() has a problem in that is the output streams (stdout and stderr) are not read in a timely manner (Bug parade indicates 512 byte buffers), the process will HANG as the stream BLOCKS forever on readLn(). |
void |
setErrPrefix(java.lang.String errPfx)
Set the string that will prefix all stderr lines. |
void |
setOutPrefix(java.lang.String outPfx)
Set the string that will prefix all stdout lines. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Exec(java.lang.String[] argv,
java.lang.String[] envp)
public Exec(java.lang.String[] argv,
java.lang.String[] envp,
java.lang.StringBuffer sBuffer)
public Exec(java.lang.String[] argv,
java.lang.String[] envp,
java.io.PrintWriter pWriter)
| Method Detail |
|---|
public void setErrPrefix(java.lang.String errPfx)
public void setOutPrefix(java.lang.String outPfx)
public int getExitValue()
public void exec()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void dump()
public void debugExec(java.lang.StringBuffer buf)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||