[jboss-cvs] JBossAS SVN: r87066 - branches/Branch_5_x/system-jmx/src/main/org/jboss/system/deployers/managed.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 9 08:06:39 EDT 2009


Author: emuckenhuber
Date: 2009-04-09 08:06:39 -0400 (Thu, 09 Apr 2009)
New Revision: 87066

Modified:
   branches/Branch_5_x/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
Log:
[JBAS-6716] better handling of creating new values

Modified: branches/Branch_5_x/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
===================================================================
--- branches/Branch_5_x/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java	2009-04-09 11:17:23 UTC (rev 87065)
+++ branches/Branch_5_x/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java	2009-04-09 12:06:39 UTC (rev 87066)
@@ -287,6 +287,21 @@
          }
          // There may not be an attribute value, see if there is a matching property
          
+         // Unwrap the value before, so that we can recreate empty values
+         Object plainValue = null;
+         // Look for a MetaMapper
+         MetaType propertyType = property.getMetaType();
+         MetaMapper metaMapper = property.getTransientAttachment(MetaMapper.class);
+         if(metaMapper != null)
+         {
+            plainValue = metaMapper.unwrapMetaValue(value);
+         }
+         else
+         {
+            PropertyInfo propertyInfo = beanInfo.getProperty(name);
+            plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
+         }
+         
          if (attributeValue == null)
          {
             String aname = mapAttributeName(md, name);
@@ -295,25 +310,19 @@
                ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
                attr.setName(aname);
                md.addAttribute(attr);
-               attributeValue = new ServiceTextValueMetaData("");
+               if(plainValue instanceof Element)
+               {
+                  attributeValue = new ServiceElementValueMetaData();
+               }
+               else
+               {
+                  attributeValue = new ServiceTextValueMetaData("");
+               }
                attr.setValue(attributeValue);
             }
          }
          if (attributeValue != null)
          {
-            Object plainValue = null;
-            // Look for a MetaMapper
-            MetaType propertyType = property.getMetaType();
-            MetaMapper metaMapper = property.getTransientAttachment(MetaMapper.class);
-            if(metaMapper != null)
-            {
-               plainValue = metaMapper.unwrapMetaValue(value);
-            }
-            else
-            {
-               PropertyInfo propertyInfo = beanInfo.getProperty(name);
-               plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
-            }
             // Unwrap the ServiceValueMetaData types
             if (attributeValue instanceof ServiceTextValueMetaData)
             {




More information about the jboss-cvs-commits mailing list