JMX CompositeDataSupport 属性在 JConsole 中始终是只读的吗?
遵循 Java SE 6 中的 MXBean:在没有特殊 JMX 客户端配置的情况下捆绑值 I设法实现一个 MXBean,它公开一个 Map
以获取配置参数列表。它按预期出现在 JConsole 中,但所有值都是只读的。
在 MXBEans 文章中,此插图显示了一个示例,其中属性是只读的,因为它们是内存使用值,因此有意义。
有没有办法使属性在 JConsole 中可编辑?
Following MXBeans in Java SE 6: Bundling Values Without Special JMX Client Configurations I managed to implement a MXBean which exposes a Map<String, String>
for a list of configuration parameters. It appears in JConsole as expected, but all values are readonly.
In the MXBEans article, this illustration shows an example where it makes sense that the attributes are read-only as they are memory usage values.
Is there a way to make the attributes editable in JConsole?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试使用 Spring MBeanExporter。
我不确定这对你来说是否可行。
但这很容易。 这里是一个很好的例子。
谢谢。
Try using Spring MBeanExporter.
I am not sure, if this is feasible with you or not.
But it is very easy. Here is a very good example.
Thanks.
要使属性可从 JConsole 写入,您还需要在 MBean 接口中公开 setter 方法。
在此名称中为只读
,cacheSize 既可读取也可写入。
To make attributes writable from JConsole, you need to expose the setter methods also in your MBean Interface.
}
In this name is readOnly, cacheSize is read as well as write enabled.
我不认为你可以使单个元素可写(从远程API的角度考虑,复合类型只是一个DTO,mbean是远程接口),但我确实认为你可以使整个复合属性可写,例如:
也就是说,我不确定 jconsole 是否支持编辑复合属性,即使它们是可写的。
I don't think you can make the individual elements writable (think about it from a remote API perspective, the compound type is simply a DTO, the mbean is the remote interface), but i do think you can make the whole compound attribute writable, e.g.:
that said, i'm not sure if jconsole supports editing compound attributes even if they are writable.