List<ModelMBeanOperationInfo> lists = new ArrayList<ModelMBeanOperationInfo>();
Method[] methods = obj.getClass().getMethods();
if (methods != null) {
for (Method method : methods) {
method.setAccessible(true);
CMbeanMethod annotation = method
.getAnnotation(CMbeanMethod.class);
if (annotation != null) {
Class<?>[] parameterTypes = method.getParameterTypes();
MBeanParameterInfo[] signatures = null;
if (parameterTypes != null && parameterTypes.length > 0) {
signatures = new MBeanParameterInfo[parameterTypes.length];
int i = 0;
for (Class param : parameterTypes) {
signatures[i] = new MBeanParameterInfo("args" + i,
param.getName(), "");
}
}
ModelMBeanOperationInfo info = new ModelMBeanOperationInfo(
method.getName(), annotation.description(),
signatures, method.getReturnType().getName(),
annotation.impact());
lists.add(info);
}
}
}