|
||||||||||
| 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 Commandline. 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 | |
void |
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)
command - command to be executed
public CommandExecutor(Commandline command,
org.apache.log4j.Logger log)
command - command to be executedlog - logger to which process streams should be written| 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 void executeAndWait()
throws CruiseControlException
CruiseControlException - for non-zero exit codes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||