How to show class description, attribute descriptions and operation descriptions jmx MBeans

I created several beans that implement the interface and created a custom MBean exporter to bring those beans to jconsole . Although everything works fine, descriptions are not displayed correctly. At the top of the bean, I see:

  Java Class: $ Proxy483
 Description: Information on the management interface of the MBean

and when describing the attributes and operations that I see:

  Operation exposed for management 

Is there a way to see the descriptions that I set in the @ManagedResource annotations?

Thank you in advance

+6
source share
2 answers

You will need a JmxAttributeSource implementation for your MBeanExporter (no by default). Spring reference provides the following example:

 <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"> <property name="assembler" ref="assembler"/> <property name="namingStrategy" ref="namingStrategy"/> <property name="autodetect" value="true"/> </bean> <!-- Implementation of the JmxAttributeSource interface that reads JDK 1.5+ annotations and exposes the corresponding attributes --> <bean id="jmxAttributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/> <!-- will create management interface using annotation metadata --> <bean id="assembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler"> <property name="attributeSource" ref="jmxAttributeSource"/> </bean> <!-- will pick up the ObjectName from the annotation --> <bean id="namingStrategy" class="org.springframework.jmx.export.naming.MetadataNamingStrategy"> <property name="attributeSource" ref="jmxAttributeSource"/> </bean> 
0
source

Try to specify the name and description of the object?

 @ManagedResource( objectName="org.springbyexample.jmx:name=ServerManager", description="Server manager." ) 
0
source

All Articles