for (int i = 0; i < types.length; i++) {
String type = (String) parameterTypes.get(i);
try {
types[i] = ClassLoading.loadClass((String) parameterTypes.get(i), classLoader);
} catch (ClassNotFoundException e) {
throw new InvalidConfigurationException("Could not load operation parameter class:" +
" name=" + operationInfo.getName() +
" class=" + type);
}
}
// get a method invoker for the operation
if (operationInfo instanceof DynamicGOperationInfo) {
methodInvoker = new MethodInvoker() {
private String[] types = (String[]) parameterTypes.toArray(new String[parameterTypes.size()]);
public Object invoke(Object target, Object[] arguments) throws Exception {
DynamicGBean dynamicGBean = (DynamicGBean) target;
dynamicGBean.invoke(name, arguments, types);
return null;
}
};
} else {
try {
Method javaMethod = gbeanInstance.getType().getMethod(operationInfo.getMethodName(), types);
methodInvoker = new FastMethodInvoker(javaMethod);
} catch (Exception e) {
throw new InvalidConfigurationException("Target does not have specified method (declared in a GBeanInfo operation):" +
" name=" + operationInfo.getName() +
" methodName=" + operationInfo.getMethodName() +
" targetClass=" + gbeanInstance.getType().getName());
}
}