[jboss-cvs] JBossAS SVN: r70024 - trunk/system-jmx/src/main/org/jboss/system/deployers/managed.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Feb 22 01:14:58 EST 2008
Author: scott.stark at jboss.org
Date: 2008-02-22 01:14:58 -0500 (Fri, 22 Feb 2008)
New Revision: 70024
Modified:
trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
Log:
Deal with properties without attribute metadata
Modified: trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java 2008-02-22 06:13:10 UTC (rev 70023)
+++ trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java 2008-02-22 06:14:58 UTC (rev 70024)
@@ -172,6 +172,19 @@
break;
}
}
+ // There may not be an attribute value, see if there is a matching property
+ if (attributeValue == null)
+ {
+ String aname = mapAttributeName(md, name);
+ if(aname != null)
+ {
+ ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
+ attr.setName(aname);
+ md.addAttribute(attr);
+ attributeValue = new ServiceTextValueMetaData("");
+ attr.setValue(attributeValue);
+ }
+ }
if (attributeValue != null)
{
PropertyInfo propertyInfo = beanInfo.getProperty(name);
@@ -204,4 +217,37 @@
}
return null;
}
+
+ /**
+ * Try to find a matching mbean attribute
+ * @param name
+ * @return
+ */
+ private String mapAttributeName(ServiceMetaData md, String name)
+ {
+ ObjectName mbean = md.getObjectName();
+ String attrName = null;
+ try
+ {
+ mbeanServer.getAttribute(mbean, name);
+ attrName = name;
+ }
+ catch(Exception e)
+ {
+ char c = name.charAt(0);
+ if(Character.isLowerCase(c))
+ name = Character.toUpperCase(c) + name.substring(1);
+ else
+ name = Character.toLowerCase(c) + name.substring(1);
+ try
+ {
+ mbeanServer.getAttribute(mbean, name);
+ attrName = name;
+ }
+ catch(Exception e2)
+ {
+ }
+ }
+ return attrName;
+ }
}
More information about the jboss-cvs-commits
mailing list