Hi,
Assuming you want to expose a matrix of longs, on JDK 1.5 you would use a
Long[][] array - on JDK 1.6 you can use a primitive long[][] array.
Below is how you could construct the MBeanInfo for the matrix attributes:
OpenMBeanAttributeInfoSupport[] mattrixAttributes = new OpenMBeanAttributeInfoSupport[] {
new OpenMBeanAttributeInfoSupport("Matrix",
"Matrix",
// Java SE 5.0: need to use Long[][]
// new ArrayType(2,SimpleType.LONG),
// Java SE 6: use long[][]
new ArrayType(1,new ArrayType(SimpleType.LONG,true)),
true,
false,
false),
new OpenMBeanAttributeInfoSupport("Xsize",
"Size on X axis",
SimpleType.INTEGER,
true,
false,
false),
new OpenMBeanAttributeInfoSupport("Ysize",
"Size on Y axis",
SimpleType.INTEGER,
true,
false,
false)
};
Note however that jconsole does not know how to display multidimensional
arrays.
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc