[jboss-cvs] JBossAS SVN: r66658 - branches/JBPAPP_4_2/ejb3/src/resources/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 1 12:23:12 EDT 2007


Author: wolfc
Date: 2007-11-01 12:23:12 -0400 (Thu, 01 Nov 2007)
New Revision: 66658

Modified:
   branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl
Log:
JBPAPP-347: mq2jbm transform handles different mbeans

Modified: branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl	2007-11-01 16:14:31 UTC (rev 66657)
+++ branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl	2007-11-01 16:23:12 UTC (rev 66658)
@@ -11,34 +11,53 @@
    </xsl:template>
    
    <xsl:template match="mbean">
-      <xsl:element name="mbean">
-         <!-- set destionationType to either Topic or Queue -->
-         <xsl:variable name="destinationType" select="substring-after(@code,'jmx.')"/>
-         
-         <!-- TODO: is name always the last part? -->
-         <xsl:variable name="destinationName" select="substring-after(@name,'name=')"/>
-         
-         <xsl:attribute name="code">
-            <xsl:value-of select="concat('org.jboss.jms.server.destination.',$destinationType,'Service')"/>
-         </xsl:attribute>
-         
-         <xsl:attribute name="name">
-            <xsl:value-of select="concat('jboss.messaging.destination:service=',$destinationType,',name=',$destinationName)"/>
-         </xsl:attribute>
-         
-         <xsl:attribute name="xmbean-dd">
-            <xsl:value-of select="concat('xmdesc/',$destinationType,'-xmbean.xml')"/>
-         </xsl:attribute>
-         
-         <xsl:apply-templates/>
+      <xsl:choose>
+         <!-- only transform mq mbeans -->
+         <xsl:when test="starts-with(@code,'org.jboss.mq.server.jmx')">
+            <xsl:element name="mbean">
+               <!-- set destionationType to either Topic or Queue -->
+               <xsl:variable name="destinationType" select="substring-after(@code,'jmx.')"/>
+               
+               <!-- TODO: is name always the last part? -->
+               <xsl:variable name="destinationName" select="substring-after(@name,'name=')"/>
+               
+               <xsl:attribute name="code">
+                  <xsl:value-of select="concat('org.jboss.jms.server.destination.',$destinationType,'Service')"/>
+               </xsl:attribute>
+               
+               <xsl:attribute name="name">
+                  <xsl:value-of select="concat('jboss.messaging.destination:service=',$destinationType,',name=',$destinationName)"/>
+               </xsl:attribute>
+               
+               <xsl:attribute name="xmbean-dd">
+                  <xsl:value-of select="concat('xmdesc/',$destinationType,'-xmbean.xml')"/>
+               </xsl:attribute>
+               
+               <xsl:apply-templates/>
+            </xsl:element>
+         </xsl:when>
+         <!-- copy in any other mbeans -->
+         <xsl:otherwise>
+            <xsl:copy-of select="."/>
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:template>
+   
+   <!-- rename attribute SecurityConf to SecurityConfig -->
+   <xsl:template match="attribute[@name='SecurityConf']">
+      <xsl:element name="attribute">
+         <xsl:attribute name="name">SecurityConfig</xsl:attribute>
+         <xsl:copy-of select="*"/>
       </xsl:element>
    </xsl:template>
    
+   <!-- copy in all attributes specified on the mq mbean -->
    <xsl:template match="attribute">
       <xsl:copy-of select="."/>
    </xsl:template>
    
-   <xsl:template match="depends">
+   <!-- change the destination manager -->
+   <xsl:template match="depends[@optional-attribute-name='DestinationManager']">
       <xsl:element name="depends">
          <xsl:attribute name="optional-attribute-name">
             <xsl:text>ServerPeer</xsl:text>
@@ -51,4 +70,7 @@
          <xsl:text>jboss.messaging:service=PostOffice</xsl:text>
       </xsl:element>
    </xsl:template>
+
+   <!-- ignore any remaining depends -->
+   <xsl:template match="depends"/>
 </xsl:transform>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list