0

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?

Robert Wilson
  • 843
  • 2
  • 10
  • 26

2 Answers2

1

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 .. :-(

Heiko Rupp
  • 30,426
  • 13
  • 82
  • 119
0

Ah - you can define them like this:

<attribute name="Server">192.168.0.1,192.168.0.2,192.168.0.3</attribute>
Robert Wilson
  • 843
  • 2
  • 10
  • 26