clojure/java.jmx — pull request #4 by BCcjeris (2012-06-04 16:35:24+00:00)
Title: .getAttribute on Bean does not actually yield an Attribute, causing ClassCastException

When `create-bean` is used according to the documentation, that is, with a ref to a map whose keys are attribute names and whose values are simple attribute values (e.g., `(create-bean (ref {:success 0}))`), the resulting object has a `.getAttribute` method that yields the simple attribute value, rather than a javax.management.Attribute object. This means that trying to add the attributes into an AttributeList causes a ClassCastException.

This commit attempts to fix this bug by wrapping the result of `.getAttribute` in a javax.management.Attribute. However, then `jmx/read` returns the Attribute where you'd expect it to return the simple value, so I added an implementation of `objects->data` for Attributes. The tests pass, and it works for my case, but I do not know whether that is the correct approach in general.