How to tell jmx mbean to render it as a tree in jconsole?

My application has a certain set of keys for which I control the values ​​(min, max, etc.). It looks very similar to the following:

 public class Data implements Serializable{
    int max, min; //etc..
 }

 public interface HelloMBean{
     String [] getKeys();
     Data getDataForKey(String);
     Data [] getDatas();
 }

However, I cannot see the Keys or Datas attribute using jconsole (I always see the value "inaccessible" for these properties).

How do I structure a bean definition so that it appears as a value tree?

HelloMBean
|- attributes
     |---- key1
     |---- key2

I would like to display values ​​(for example: key1.max or key2.min) as a graph. Is it possible? If so, what would be the best way to achieve this?

Thank!

+5
source share
1 answer

Don't you need it javax.management.openmbean.CompositeData?

"", jconsole Data, .

, "" , DynamicMBean, , int. . .

+3

All Articles