1 package mircoders.producer;
6 // ML: needs to be tested!
8 public class ScriptCallProducer implements mir.producer.Producer {
11 public ScriptCallProducer(String aScript) {
15 public void produce( PrintWriter aLogger ) throws ProducerFailure {
19 aLogger.println("Executing " + script + ":");
22 process = Runtime.getRuntime().exec(script);
23 returnValue = process.waitFor();
24 aLogger.println("Terminated successfully, return value = " + returnValue + ".");
27 aLogger.println("Exception has occurred: " + e.getMessage() + ":");
28 e.printStackTrace(aLogger);
29 throw new ProducerFailure("Executing script failed",e);