using CompositeData

Hello All,I am trying to expose data using Complex Data. I have encountered that JMX consoles do not allow to edit such properties. Has anybody encountered the same thing or I am missing something?Thank you
[227 byte] By [vgena] at [2007-12-23]
# 1

Unfortunately, JConsole in Tiger and Mustang does not have support for editing CompositeData, TabularData and arrays of OpenTypes.

In order to be able to edit these complex attributes you will have to expose each value in a complex data type as a single property with getters/setters in your MBean interface.

Regards,

Luis-Miguel ALVENTOSA

JConsole Development Team

Sun Microsystems, Inc.

lmalventa at 2007-7-14 > top of java,Core,Monitoring & Management...
# 2
Does this also apply to array types of operation parameters?I have an MBean exposing operations with String[] parametes, but they are shown as disabled when I connect to the MBean with JConsole (JDK1.5).Tnx
vincentssna at 2007-7-14 > top of java,Core,Monitoring & Management...
# 3
Yes, an operation with a String[] parameter cannot currently be called from the "MBeans" tab of jconsole.In JDK 6, you can define a custom tab, and you could define a way to call your operation from within that tab. This will require some basic Swing programming.
emcmanusa at 2007-7-14 > top of java,Core,Monitoring & Management...
# 4

Thanks for the quick response.

Just curious,

Was there a particular reason for not supporting arrays in this version of JConsole considering

array types were defined as part of the original JMX.

I was hoping to drop the third-party JMX client I have to bundle with my app now in favour of a client that is alaways present as part of the JDK without me doing any extra work.

regards

vincentssna at 2007-7-14 > top of java,Core,Monitoring & Management...
# 5

I think the reason was basically that the GUI would be substantially more complicated. There would need to be some way for you to build up the array, for example by filling it in as the lines of a JTextArea. This could certainly be considered as an enhancement for a future version.

In the meantime, you always have the option of changing your MBean interface so that it is usable from JConsole. For example, instead of an int[] parameter you could have a String which is a space-separated list of integers. It is a pity to have to do that, but it might not to be too great an impact.

emcmanusa at 2007-7-14 > top of java,Core,Monitoring & Management...