<p>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 <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/openmbean/CompositeData.html" rel="noreferrer">CompositeData</a> (the data actually comes back as <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/openmbean/CompositeDataSupport.html" rel="noreferrer">CompositeDataSupport</a>). I want to output all the key/value pairs that are associated with this object.</p>

<p>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?</p>

<p>Thanks!</p>

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()