{
throw new IllegalStateException("Class " + clazz.getName() + " does not contain management annotation");
}
//
ManagedDescription typeDescriptionAnn =
AnnotationIntrospector.resolveClassAnnotations(clazz, ManagedDescription.class);
String typeDescription = typeDescriptionAnn != null ? typeDescriptionAnn.value() : null;
//
Map<Method, Managed> managedMethods = AnnotationIntrospector.resolveMethodAnnotations(clazz, Managed.class);
Map<Method, ManagedName> methodNames = AnnotationIntrospector.resolveMethodAnnotations(clazz, ManagedName.class);
Map<Method, ManagedDescription> methodDescriptions =
AnnotationIntrospector.resolveMethodAnnotations(clazz, ManagedDescription.class);
//
Map<Method, ManagedMethodMetaData> bilto = new HashMap<Method, ManagedMethodMetaData>();
for (Map.Entry<Method, Managed> entry : managedMethods.entrySet())
{
Method method = entry.getKey();
//
ManagedDescription methodDescriptionAnn = methodDescriptions.get(method);
String methodDescription = methodDescriptionAnn != null ? methodDescriptionAnn.value() : null;
// Build the default mbean info
ManagedMethodMetaData managedMethod = new ManagedMethodMetaData(method);
managedMethod.setDescription(methodDescription);