/**
* Call the named method of the given object.
*/
public Object call(Object sourceCode, String method, Object[] args) throws BSFException {
GroovyClassLoader gcl = new GroovyClassLoader();
try {
return ((GroovyObject)gcl.parseClass(sourceCode.toString()).newInstance()).invokeMethod(method, args);
} catch (Exception e) {
throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Groovy: " + e, e);
}
}