users@glassfish.java.net

GlassFish 2.x: What makes getAttribute return javax.management.Attribute?

From: <glassfish_at_javadesktop.org>
Date: Mon, 04 Jan 2010 11:29:33 PST

Hi all,

Working on retrieving values from JMX attributes from the amx:j2eeType=X-MonitoringDottedNames,name=na mbean. Seeing something that looks strange to me.

For attributes like DAS, ObjectName, J2EEType, MBeanAttributeInfo/getType() and mbsc.getAttribute().getClass().getName() match. For example,
for DAS: boolean, java.lang.Boolean
for ObjectName: javax.management.ObjectName, javax.management.ObjectName

But for other attributes with names like server.http-service.__asadmin.request.count2xx-count (., -, \ in the name), the return type from mbeanserverconnection.getAttribute is always javax.management.Attribute. MBeanAttributeInfo/getType() for these attribs returns String, long etc.
Calling getValue() on the Attribute returns the expected value.

Does anybody know why these attributes have an extra layer around them?

Please excuse my fledgling knowledge of JMX, if the cause is "obvious".
[Message sent by forum member 'sysprv' (tex_at_tinspoon.net)]

http://forums.java.net/jive/thread.jspa?messageID=378644