Как показать описание класса, описания атрибутов и описания операций jmx MBeans

Я создал несколько bean-компонентов, которые реализуют интерфейс, и создал собственный экспортер MBean, чтобы предоставить эти bean-компоненты jconsole. Хотя все работает нормально, описания отображаются некорректно. В верхней части боба я вижу:

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

а в описаниях атрибутов и операций вижу:

Operation exposed for management

Есть ли способ увидеть описания, которые я установил в @ManagedResource аннотациях?

заранее спасибо


person mprasinos    schedule 21.02.2013    source источник


Ответы (2)


Вам понадобится реализация JmxAttributeSource для вашего MBeanExporter (по умолчанию нет). Spring ссылка приводит следующий пример:

<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>
person Szymon Jednac    schedule 17.03.2013

Вы пытались указать имя и описание объекта?

@ManagedResource(
    objectName="org.springbyexample.jmx:name=ServerManager", 
    description="Server manager."
)
person Sylvain    schedule 13.04.2013