英文:
JMX: how add description for Operations/Attributes through plain Java
问题
对于与 JMX 一起工作的 Java 应用程序,我可以注册自定义 MBean,它们可以通过 JConsole 或 VisualVM 来使用。
通过 Spring,通过框架本身提供的一组注释,可以为要在 JConsole 中显示的“操作”和“属性”添加描述。
在纯 Java 中如何实现相同的目标?(这里不涉及 Spring)。我已经在 StackOverflow 上进行了研究,并找到了一些第三方解决方案,例如:
- 如何为 JMX MXBean 添加描述,涉及到 JMX 注释
- 如何为 MBean 方法添加描述以在 JBOSS 的 jmx-console 中看到它,涉及到 使用注释包装器为 JMX bean 添加描述
但似乎没有直接的 Java 方法。
是否可能?如何实现?
英文:
For a Java App working with JMX I am able to register my custom MBeans, they are available to be used through either JConsole or VisualVM.
Through Spring, with a set of annotations available through the Framework itself, is possible add descriptions for the Operations and Attributes to be shown through JConsole.
How accomplish the same goal through plain Java? (Spring is not involved) here. I already did do a research in StackOverflow and I found some third party solutions, such as:
- How to add description to JMX MXBean that refers to JMX Annotations
- How to add description for MBean method to see it in jmx-console of JBOSS that refers to Adding descriptions to JMX beans using an annotation wrapper
but seems there is no a direct approach by Java itself.
Is it possible? How?
专注分享java语言的经验与见解,让所有开发者获益!
评论