ReflectionException {
if (log.isDebugEnabled()) {
log.debugf("Invoke method called on %s", name);
}
MBeanOperationInfo opInfo = null;
for (IspnMBeanOperationInfo op : opInfos) {
if (op.getOperationName().equals(name)) {
opInfo = op;
break;
}
}
if (opInfo == null) {
final String msg = "Operation " + name + " not amongst operations in " + opInfos;
throw new MBeanException(new ServiceNotFoundException(msg), msg);
}
try {
Class<?>[] classes = new Class[sig.length];
for (int i = 0; i < classes.length; i++) {
classes[i] = ReflectionUtil.getClassForName(sig[i], null);
}
Method method = getObject().getClass().getMethod(opInfo.getName(), classes);
return method.invoke(getObject(), args);
} catch (Exception e) {
throw new MBeanException(e);
}
}