[jboss-cvs] JBossAS SVN: r86795 - trunk/profileservice/src/main/org/jboss/profileservice/management/templates.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Apr 4 15:53:06 EDT 2009


Author: emuckenhuber
Date: 2009-04-04 15:53:06 -0400 (Sat, 04 Apr 2009)
New Revision: 86795

Modified:
   trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java
Log:
[JBAS-6721] exclude readOnly properties

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java	2009-04-04 19:51:38 UTC (rev 86794)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java	2009-04-04 19:53:06 UTC (rev 86795)
@@ -44,6 +44,7 @@
 import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.managed.api.DeploymentTemplateInfo;
 import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.annotation.ViewUse;
 import org.jboss.metatype.api.types.CompositeMetaType;
 import org.jboss.metatype.api.values.CompositeValue;
 import org.jboss.metatype.api.values.MapCompositeValueSupport;
@@ -177,6 +178,12 @@
       Map<String, ManagedProperty> properties = info.getProperties();
       for(ManagedProperty p : properties.values())
       {
+         if(p.hasViewUse(ViewUse.CONFIGURATION) == false)
+            continue;
+            
+        if(p.isReadOnly())
+           continue;
+         
          MetaValue v = p.getValue();
          if(v == null)
             continue;
@@ -189,30 +196,32 @@
          if(Character.isLowerCase(c))
             name = Character.toUpperCase(c) + name.substring(1);
          
+         JmsAttribute attribute = null;
+         
          if(v.getMetaType().isSimple())
          {
-            JmsAttributeMetaData attributeMD = new JmsAttributeMetaData(name, "" + ((SimpleValue)v).getValue());
-            attributes.add(attributeMD);            
+            attribute = new JmsAttributeMetaData(name, "" + ((SimpleValue)v).getValue());
          }
          else
          {
             if(name.equals("DLQ"))
             {
                ObjectName n = (ObjectName) mvf.unwrap(v);
-               attributes.add(new JmsAttributeMetaData("DLQ", n.getCanonicalName()));
+               attribute = new JmsAttributeMetaData("DLQ", n.getCanonicalName());
             }
             else if(name.equals("ExpiryQueue"))
             {
                ObjectName n = (ObjectName) mvf.unwrap(v);
-               attributes.add(new JmsAttributeMetaData("ExpiryQueue", n.getCanonicalName()));
+               attribute = new JmsAttributeMetaData("ExpiryQueue", n.getCanonicalName());
             }
             else if(name.equals("SecurityConfig"))
             {
                Element e = unwrapMetaValue((MapCompositeValueSupport) v);
-               attributes.add(new JmsElementMetaData("SecurityConfig", e));
+               attribute = new JmsElementMetaData("SecurityConfig", e);
             }
-
          }
+         if(attribute != null)
+            attributes.add(attribute);
       }
       
       // Add dependencies




More information about the jboss-cvs-commits mailing list