}
}
} else {
// add Operation to the ModelMBean
ManagedOperation mo = getManagedOperation(methods[i]);
if (mo != null) {
Class<?>[] types = methods[i].getParameterTypes();
ManagedOperationParameter[] mop = getManagedOperationParameters(methods[i]);
String[] paramTypes = new String[types.length];
String[] paramNames = new String[types.length];
String[] paramDescs = new String[types.length];
for (int j = 0; j < types.length; j++) {
paramTypes[j] = types[j].getName();
if (j < mop.length) {
paramDescs[j] = mop[j].description();
paramNames[j] = mop[j].name();
} else {
paramDescs[j] = "";
paramNames[j] = types[j].getName();
}
}
Descriptor operationDescriptor =
supporter.buildOperationDescriptor(mo, methods[i].getName());
supporter.addModelMBeanMethod(methods[i].getName(),
paramTypes,
paramNames,
paramDescs,
mo.description(),
methods[i].getReturnType().getName(),
operationDescriptor);
}
}