JBoss MBeans:如何拥有数组属性?

发布于 2024-08-08 19:31:09 字数 670 浏览 5 评论 0原文

是否可以定义具有数组属性的 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 技术交流群。

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

发布评论

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

评论(2

千鲤 2024-08-15 19:31:09

您可以将部分 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 .. :-(

瑾兮 2024-08-15 19:31:09

啊 - 你可以这样定义它们:

<attribute name="Server">192.168.0.1,192.168.0.2,192.168.0.3</attribute>

Ah - you can define them like this:

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