简体   繁体   中英

Can Description Be Set for Spring JMX MBeans Using InterfaceBasedMBeanInfoAssembler?

The Spring 2.5 reference documentation ( http://static.springsource.org/spring/docs/2.5.x/reference/jmx.html#jmx-interface-metadata ) demonstrates how to use MetaDataMBeanInfoAssembler and in-source annotations to provide a description and other metadata information that will be viewable for operations and attributes of MBeans from the JConsole client. Is there an approach that can be used to express this same type of metadata for Spring-backed MBeans via Spring's XML configuration and the InterfaceBasedMBeanInfoAssembler?

In other words, I'd like to be able to specify things like description, defaultValue, and other "source-level metadata parameters" described in Table 20.3 ( http://static.springframework.org/sp...metadata-types ) with the interface-based approach rather than the source-code annotation approach. The fact that these are referred to as source-level implies to me that these can only be specified for Springified JMX MBeans that use in-source annotations.

There might be a couple of ways to do that. The InterfaceBasedMBeanInfoAssembler itself reads descriptor information from the interface, so if you control the interface you can add @DescriptorKey annotations. MetaDataMBeanInfoAssembler is more powerful in that it allows you to plug in a JmxAttributeSource where you could add any meta data you liked (eg based on a lookup in an external source like a configured map or properties file).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM