if (result != null) {
result.setException(ex);
}
return null;
}
Script groovyObject = null;
try {
groovyObject = (Script) groovyClass.newInstance();
} catch (final InstantiationException ex) {
log.error(ex.getMessage(), ex);
if (result != null) {
result.setException(ex);
}
return null;
} catch (final IllegalAccessException ex) {
log.error(ex.getMessage(), ex);
if (result != null) {
result.setException(ex);
}
return null;
}
if (bindScriptResult == true) {
final Binding binding = groovyObject.getBinding();
final GroovyResult scriptResult = new GroovyResult();
binding.setVariable("scriptResult", scriptResult);
}
return groovyObject;
}