2013-02-21 14 views
6

Utworzono kilka komponentów bean, które implementują interfejs i utworzono niestandardowego eksportera, aby odsłonić te fasole do jconsole. Chociaż wszystko działa poprawnie, opisy nie są wyświetlane poprawnie. Na szczycie fasoli widzę:Jak wyświetlić opis klasy, opisy atrybutu i opisy operacji jmx MBeans

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

i na opisy atrybutów i operacji widzę:

Operation exposed for management

Czy istnieje jakiś sposób, aby zobaczyć opisy mam ustawić w @ManagedResource adnotacje?

góry dzięki

Odpowiedz

0

Musisz implementację JmxAttributeSource dla MBeanExporter (nie ma domyślnie). Wiosna reference zapewnia następujący przykład:

<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

masz próbować dostarczyć nazwę obiektu i opis?

@ManagedResource(
    objectName="org.springbyexample.jmx:name=ServerManager", 
    description="Server manager." 
) 
Powiązane problemy