}
else if (this.xmlBlasterScript != null && this.xmlBlasterScript.trim().length() > 0) {
this.reader = new StringReader(this.xmlBlasterScript);
}
else {
throw new BuildException("Please provide a script");
}
if (this.responseFile == null)
this.responseStream = System.out;
else {
this.responseStream = new FileOutputStream(this.responseFile);
closeResponseStream = true;
}
if (this.updateFile == null)
this.updateStream = this.responseStream;
else {
this.updateStream = new FileOutputStream(this.updateFile);
closeUpdateStream = true;
}
this.interpreter = new XmlScriptClient(this.glob, this.glob.getXmlBlasterAccess(), this.updateStream, this.responseStream, null);
if (this.prepareForPublish) {
this.interpreter.registerMsgUnitCb(new I_MsgUnitCb() {
public boolean intercept(MsgUnit msgUnit) {
msgUnit.getQosData().clearRoutes();
return true;
}
});
}
if (verbose > 0) System.out.println("scriptFile=" + this.scriptFile + " propertyFile=" + this.propertyFile + " loggingFile=" + this.loggingFile);
if (verbose > 2) System.out.println(this.glob.getProperty().toXml());
this.interpreter.parse(this.reader);
}
catch (XmlBlasterException e) {
log("Scripting to xmlBlaster failed " + getLocation() + ": " + e.getMessage());
throw new BuildException(e.getMessage());
}
catch (Throwable e) {
log("Scripting to xmlBlaster failed " + getLocation() + ": " + e.toString());
e.printStackTrace();
throw new BuildException(e.toString());
}
finally {
if (closeResponseStream) {
try {
this.responseStream.close();