Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CompositeData has no keys() method?

I'm using JMX to save some diagnostic information from a remote process. Looking at the interface in jconsole shows that the return type is CompositeData (the data actually comes back as CompositeDataSupport). I want to output all the key/value pairs that are associated with this object.

The problem is that the interface just seems to have a "values()" method with no way of getting the keys. Am I missing something here? Is there some other way to approach this task?

Thanks!

like image 365
Luke Quinane Avatar asked Nov 07 '08 04:11

Luke Quinane


1 Answers

If I'm not mistaken you could do

Set< String > keys = cData.getCompositeType().keySet();

(given that cData is a CompositeData object)

http://java.sun.com/j2se/1.5.0/docs/api/javax/management/openmbean/CompositeType.html#keySet()

like image 188
Tyler Levine Avatar answered Oct 04 '22 05:10

Tyler Levine