[jboss-cvs] JBossAS SVN: r66648 - 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 09:57:53 EDT 2007


Author: wolfc
Date: 2007-11-01 09:57:53 -0400 (Thu, 01 Nov 2007)
New Revision: 66648

Added:
   branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl
Log:
JBPAPP-347: added mq2jbm transform

Added: branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl	                        (rev 0)
+++ branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl	2007-11-01 13:57:53 UTC (rev 66648)
@@ -0,0 +1,54 @@
+<?xml version='1.0'?>
+<!-- Transform a JBoss MQ deployment descriptor into a JBoss Messaging one -->
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+   
+   <xsl:output method="xml" indent="yes"/>
+   
+   <xsl:template match="/">
+      <xsl:element name="server">
+         <xsl:apply-templates/>
+      </xsl:element>
+   </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:element>
+   </xsl:template>
+   
+   <xsl:template match="attribute">
+      <xsl:copy-of select="."/>
+   </xsl:template>
+   
+   <xsl:template match="depends">
+      <xsl:element name="depends">
+         <xsl:attribute name="optional-attribute-name">
+            <xsl:text>ServerPeer</xsl:text>
+         </xsl:attribute>
+         <xsl:text>jboss.messaging:service=ServerPeer</xsl:text>
+      </xsl:element>
+      <xsl:text>
+      </xsl:text>
+      <xsl:element name="depends">
+         <xsl:text>jboss.messaging:service=PostOffice</xsl:text>
+      </xsl:element>
+   </xsl:template>
+</xsl:transform>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list