return m.invoke(null, args);
} catch (IllegalArgumentException e1) {
// DO NOTHING, LOOK FOR ANOTHER METHOD
} catch (Exception e1) {
OLogManager.instance().error(this, "Error on calling function '%s'", e, function);
throw new OProcessException("Error on calling function '" + function + "'", e);
}
}
}
// METHOD NOT FOUND!
debug(iContext, "Method not found: " + clsName + "." + methodName + "(" + Arrays.toString(args) + ")");
for (Method m : cls.getMethods()) {
final StringBuilder candidates = new StringBuilder();
if (m.getName().equals(methodName)) {
candidates.append("-" + m + "\n");
}
if (candidates.length() > 0)
debug(iContext, "Candidate methods were: \n" + candidates);
else
debug(iContext, "No candidate methods were found");
}
} catch (ClassNotFoundException e) {
throw new OProcessException("Function '" + function + "' was not found because the class '" + clsName + "' was not found");
} catch (Exception e) {
OLogManager.instance().error(this, "Error on executing function block", e);
}
}
throw new OProcessException("Function '" + function + "' was not found");
}