binding.setVariable("logger", context.getListener().getLogger());
binding.setVariable("cancel", cancel);
binding.setVariable("trigger", context.getTrigger());
binding.setVariable("triggered", ImmutableMultimap.copyOf(context.getTriggered()));
GroovyShell shell = new GroovyShell(cl, binding, cc);
StringWriter out = new StringWriter();
PrintWriter pw = new PrintWriter(out);
if (sandbox != null) {
sandbox.register();
}
try {
Object output = shell.evaluate(script);
if (output != null) {
pw.println("Result: " + output);
cancel = ((Boolean) shell.getVariable("cancel")).booleanValue();
debug(context.getListener().getLogger(), "Pre-send script set cancel to %b", cancel);
}
} catch (SecurityException e) {
context.getListener().getLogger().println("Pre-send script tried to access secured objects: " + e.getMessage());
} catch (Throwable t) {