|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.cruisecontrol.util.CommandExecutor
Class for executing a . It setups an extra thread to consume stderr and blocks until the process and the extra thread has finished.
Constructor Summary | |
CommandExecutor(Commandline command)
Creates a new instance of CommandExecutor. |
|
CommandExecutor(Commandline command,
org.apache.log4j.Logger log)
Creates a new instance of CommandExecutor. |
Method Summary | |
int |
executeAndWait()
Executes the command and wait for the process to finish. |
void |
logErrorStreamTo(org.apache.log4j.Logger log)
Sends the process' error stream (stderr) to a log as warnings. |
void |
logOutputStreamTo(org.apache.log4j.Logger log)
Sends the process' output stream (stdout) to a log as info. |
void |
setOutputConsumer(StreamConsumer outConsumer)
Sends the process' output stream (stdout) to a StreamConsumer . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandExecutor(Commandline command)
public CommandExecutor(Commandline command, org.apache.log4j.Logger log)
Method Detail |
public void logErrorStreamTo(org.apache.log4j.Logger log)
log
- where to log the error stream.public void logOutputStreamTo(org.apache.log4j.Logger log)
log
- where to log the output stream.public void setOutputConsumer(StreamConsumer outConsumer)
StreamConsumer
.
outConsumer
- consumes the process's output stream.public int executeAndWait() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |