JBoss MBeans:如何拥有数组属性?
是否可以定义具有数组属性的 MBean?我目前有一个 MBean 定义为:
<mbean code="corp.app.jmx.DNSServer" name="corp.app:service=DNSServer">
<attribute name="Server">
192.168.0.1 192.168.0.2 192.168.0.3
</attribute>
</mbean>
然后在 MBean 代码中分割字符串。然而,对于我的下一个 MBean,我需要支持其中包含空格的字符串。我可以用逗号分隔,但我确信 MBeans 将支持数组,以便我可以像这样定义它们:
<mbean code="corp.app.jmx.DNSServer" name="corp.app:service=DNSServer">
<attribute name="Server">
<item>192.168.0.1</item>
<item>192.168.0.2</item>
<item>192.168.0.3</item>
</attribute>
</mbean>
我错了吗?
Is it possible to define a MBean with an array attribute. I currently have an MBean defined as:
<mbean code="corp.app.jmx.DNSServer" name="corp.app:service=DNSServer">
<attribute name="Server">
192.168.0.1 192.168.0.2 192.168.0.3
</attribute>
</mbean>
In the MBean code I then split the String. However - for my next MBean I need to support Strings with spaces in them. I could do a comma-delimited, but I feel sure MBeans will have support for arrays so that I could define them something like this:
<mbean code="corp.app.jmx.DNSServer" name="corp.app:service=DNSServer">
<attribute name="Server">
<item>192.168.0.1</item>
<item>192.168.0.2</item>
<item>192.168.0.3</item>
</attribute>
</mbean>
Am I wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将部分 DOM 作为参数并在应用程序中对其进行评估。实际上 JBoss 服务器中有一些 MBean 可以执行此操作(并不是说我有一个方便的示例..:-(
You can have a partial DOM as argument and evaluate that in your application. There are actually a few MBeans in the JBoss server that do this (not that I had an example handy .. :-(
啊 - 你可以这样定义它们:
Ah - you can define them like this: