6

インターフェイスを実装するBeanをいくつか作成し、MBeanそれらのBeanをに公開するカスタムエクスポーターを作成しましたjconsole。すべて正常に動作しますが、説明が正しく表示されません。Beanの上部に次のように表示されます。

Javaクラス:$ Proxy483
説明:MBeanの管理インターフェースに関する情報

そして、私が見る属性と操作の説明で:

管理のために公開された操作

@ManagedResource注釈に設定した説明を確認する方法はありますか?

前もって感謝します

4

2 に答える 2

0

MBeanExporterにはJmxAttributeSource実装が必要です(デフォルトはありません)。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>
于 2013-03-17T09:40:02.917 に答える
0

オブジェクト名と説明を提供しようとしましたか?

@ManagedResource(
    objectName="org.springbyexample.jmx:name=ServerManager", 
    description="Server manager."
)
于 2013-04-13T01:08:36.937 に答える