填写MBeanParameterInfo

发布于 2024-08-15 02:59:19 字数 250 浏览 3 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三寸金莲 2024-08-22 02:59:19

您的 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

陌伤ぢ 2024-08-22 02:59:19

虽然成为 DynamicMBean 可以解决此问题,但似乎不再需要。 最佳实践的动态 MBean 部分< Oracle 的 JMX 站点上的 /a> 表示最好对 StandardMBean 进行子类化,除非有其他原因需要使 MBean 动态化:

几乎没有必要为其管理接口在编译时已知的 MBean 实现 DynamicMBean 接口。如果您需要 Dynamic MBean 的某些特定功能,例如提供属性或操作的描述的能力,或者禁用某些属性或操作的能力,那么您应该考虑子类化 javax.management.StandardMBean 而不是实现 DynamicMBean 接口。这意味着管理接口仍然是通过Java接口来描述的,这又意味着客户端可以使用该接口进行代理以方便访问。

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:

It is almost never necessary to implement the DynamicMBean interface for an MBean whose management interface is known at compile time. If you need some particular abilities of Dynamic MBeans, for example the ability to supply descriptions for the attributes or operations, or the ability to disable certain attributes or operations, then you should consider subclassing javax.management.StandardMBean rather than implementing the DynamicMBean interface. That means that the management interface is still described by a Java interface, which in turn means that clients can use that interface to make a proxy for convenient access.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文