填写MBeanParameterInfo
在 JConsole 的 MBeans 选项卡中查看我的应用程序的 MBean 时,有“属性”和“操作”的子菜单。如果将这些树结构展开到最大程度,然后单击其中一个操作,右侧的面板将显示三个部分:操作调用、MBeanOperationInfo 和描述符。我的问题与第二点有关。
如何填充 MBeanOperationalInfo?我尝试将标准 javadoc 添加到 MBean 接口,但这不起作用。能够记录参数将非常有用 - 特别是当它们的名称衰减为 p1,p2,...
When looking at the MBean for my application in the MBeans tab in JConsole there are submenus for 'Attributes' and 'Operations'. If these tree structures are expanded to their maximum extent and then one of the operations is clicked on, the panel on the right presents three sections: Operation invocation, MBeanOperationInfo and Descriptor. My question relates to the 2nd.
How can you populate the MBeanOperationalInfo? I have tried adding standard javadoc to the MBean interface but that does not work. It would be really useful to be able to document the parameters - especially as their names decay to p1,p2,...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 MBean 必须是 DynamicMBean并实现方法 getMBeanInfo()。这也适用于 Open MBean 和 Model MBean。
这里有一个示例:http://docs。 sun.com/app/docs/doc/816-7609/6mdjrf83d?a=view
Your MBean must be a DynamicMBean and implement the method getMBeanInfo(). This also works for Open MBean and Model MBean.
There is an example here: http://docs.sun.com/app/docs/doc/816-7609/6mdjrf83d?a=view
虽然成为 DynamicMBean 可以解决此问题,但似乎不再需要。 最佳实践的动态 MBean 部分< Oracle 的 JMX 站点上的 /a> 表示最好对 StandardMBean 进行子类化,除非有其他原因需要使 MBean 动态化:
While being a DynamicMBean will work for this, it appears to no longer be necessary. The Dynamic MBeans section of the Best Practices on Oracle's JMX site indicates that subclassing StandardMBean would be preferable unless there are other reasons for making your MBean dynamic: