*/
public Object execProcedure(String procName, List args) throws WGProcedureException, WGBackendException {
Method proc = (Method) _procs.get(procName);
if (proc == null) {
throw new WGProcedureException("No procedure of name '" + procName + "'");
}
Object result = null;
try {
result = proc.invoke(this, args.toArray());
}
catch (IllegalArgumentException e) {
throw new WGProcedureException("Argument types and/or count does not match arguments of procedure '" + procName + "'");
}
catch (IllegalAccessException e) {
throw new WGProcedureException("Unable to access procedure '" + procName + "'. Method not visible.");
}
catch (InvocationTargetException e) {
WGFactory.getLogger().error("Error invoking procedure '" + procName + "':" + e.getTargetException().getMessage(), e);
throw new WGProcedureException("Error invoking procedure '" + procName + "':" + e.getTargetException().getMessage());
}
return result;