[jboss-cvs] JBossAS SVN: r66569 - in branches/JBPAPP_4_2/ejb3: src/main/org/jboss/ejb3 and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 30 11:37:11 EDT 2007


Author: wolfc
Date: 2007-10-30 11:37:11 -0400 (Tue, 30 Oct 2007)
New Revision: 66569

Modified:
   branches/JBPAPP_4_2/ejb3/build.xml
   branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java
   branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java
   branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java
   branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java
   branches/JBPAPP_4_2/ejb3/src/resources/META-INF/jboss-service.xml
Log:
JBPAPP-347: configuring the correct JMSDestinationFactory

Modified: branches/JBPAPP_4_2/ejb3/build.xml
===================================================================
--- branches/JBPAPP_4_2/ejb3/build.xml	2007-10-30 14:31:17 UTC (rev 66568)
+++ branches/JBPAPP_4_2/ejb3/build.xml	2007-10-30 15:37:11 UTC (rev 66569)
@@ -48,6 +48,16 @@
    <!-- ================================================================== -->
 
    <!--
+    Configure the right JMSDestinationFactory, in EAP 4.2 we communicate with JBossMQ,
+    in EAP 4.3 we communicate with JBoss Messaging.
+   -->
+   <condition property="JMSDestinationFactory"
+      value="org.jboss.ejb3.jms.ServerPeerJMSDestinationFactory" 
+      else="org.jboss.ejb3.jms.DestinationManagerJMSDestinationFactory">
+      <isset property="build.soa"/>
+   </condition>
+
+   <!--
       | Initialize the build system.  Must depend on '_buildmagic:init'.
       | Other targets should depend on 'init' or things will mysteriously fail.
     -->
@@ -168,6 +178,7 @@
       <property name="build.lib" value="${module.output}/lib"/>
       <property name="build.api" value="${module.output}/api"/>
       <property name="build.etc" value="${module.output}/etc"/>
+      <property name="build.resources" value="${module.output}/resources"/>
 
       <!-- Install/Release structure -->
       <property name="install.id" value="${module.name}-${module.version}"/>
@@ -384,6 +395,14 @@
          </fileset>
       </jar>
 
+      <!-- set JMSDestinationFactory -->
+      <echo level="warning" message="build.soa = ${build.soa}"/>
+      <mkdir dir="${build.resources}/META-INF"/>
+      <copy todir="${build.resources}/META-INF" file="${resources}/META-INF/jboss-service.xml"/>
+      <replace file="${build.resources}/META-INF/jboss-service.xml" 
+         token="@@JMSDestinationFactory@@"
+         value="${JMSDestinationFactory}"/>
+      
       <mkdir dir="${build.lib}/ejb3.deployer"/>
       <copy todir="${build.lib}/ejb3.deployer">
          <fileset dir="${build.lib}">
@@ -394,9 +413,11 @@
          </fileset>
          <fileset dir="${resources}">
             <!--include name="META-INF/ejb3-deployers-beans.xml"/-->
-            <include name="META-INF/jboss-service.xml"/>
             <include name="META-INF/persistence.properties"/>
          </fileset>
+         <fileset dir="${build.resources}">
+            <include name="META-INF/jboss-service.xml"/>
+         </fileset>
       </copy>
       <copy todir="${build.lib}" file="${resources}/ejb3-interceptors-aop.xml"/>
       <!--copy todir="${build.lib}" file="${resources}/ejb3-clustered-sfsbcache-beans.xml"/>

Modified: branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java	2007-10-30 14:31:17 UTC (rev 66568)
+++ branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java	2007-10-30 15:37:11 UTC (rev 66569)
@@ -47,6 +47,7 @@
 import org.jboss.deployment.DeploymentInfo;
 import org.jboss.deployment.SubDeployer;
 import org.jboss.deployment.SubDeployerSupport;
+import org.jboss.ejb3.jms.JMSDestinationFactory;
 import org.jboss.ejb3.naming.SimpleMultiplexer;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.MetaData;
@@ -295,6 +296,11 @@
       this.deployEjb3ExtensionOnly = deployEjb3ExtensionOnly;
    }
 
+   public void setJMSDestinationFactory(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
+   {
+      JMSDestinationFactory.setJMSDestinationFactory(className);
+   }
+   
    /**
     * Overriden to set the hibernate.bytecode.provider from the
     * 

Modified: branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java	2007-10-30 14:31:17 UTC (rev 66568)
+++ branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java	2007-10-30 15:37:11 UTC (rev 66569)
@@ -45,4 +45,5 @@
    /** Jar files to ignore */
    void setJarsIgnoredForScanning(JarsIgnoredForScanningMBean mbean);
 
+   void setJMSDestinationFactory(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException;
 }

Modified: branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java	2007-10-30 14:31:17 UTC (rev 66568)
+++ branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java	2007-10-30 15:37:11 UTC (rev 66569)
@@ -31,11 +31,18 @@
  */
 public abstract class JMSDestinationFactory
 {
-   private static final JMSDestinationFactory instance = new DestinationManagerJMSDestinationFactory();
+   private static JMSDestinationFactory instance;
    
+   public static void setJMSDestinationFactory(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
+   {
+      Class<?> cls = Class.forName(className);
+      instance = (JMSDestinationFactory) cls.newInstance();
+   }
+   
    public static JMSDestinationFactory getInstance()
    {
-      // TODO: implement proper plugin point
+      if(instance == null)
+         throw new IllegalStateException("JMSDestinationFactory has not been initialized");
       return instance;
    }
    

Modified: branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java	2007-10-30 14:31:17 UTC (rev 66568)
+++ branches/JBPAPP_4_2/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java	2007-10-30 15:37:11 UTC (rev 66569)
@@ -55,12 +55,12 @@
       if (type == Topic.class)
       {
          destinationContext = "topic";
-         methodName = "createTopic";
+         methodName = "deployTopic";
       }
       else if (type == Queue.class)
       {
          destinationContext = "queue";
-         methodName = "createQueue";
+         methodName = "deployQueue";
       }
       else
       {

Modified: branches/JBPAPP_4_2/ejb3/src/resources/META-INF/jboss-service.xml
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/resources/META-INF/jboss-service.xml	2007-10-30 14:31:17 UTC (rev 66568)
+++ branches/JBPAPP_4_2/ejb3/src/resources/META-INF/jboss-service.xml	2007-10-30 15:37:11 UTC (rev 66569)
@@ -193,6 +193,12 @@
             <type>org.jboss.ejb3.JarsIgnoredForScanningMBean</type>
          </attribute>
 
+         <attribute access="write-only" setMethod="setJMSDestinationFactory">
+            <description>The JMSDestinationFactory to use for temporary destinations</description>
+            <name>JMSDestinationFactory</name>
+            <type>java.lang.String</type>
+         </attribute>
+
          <!-- ServiceMBean operations -->
          <operation>
             <description>Standard MBean lifecycle method</description>
@@ -303,7 +309,10 @@
          </operation>
       </xmbean>
       <!-- Inline XMBean Descriptor END -->
-
+      
+      <!-- The right destination factory is put in during the build -->
+      <attribute name="JMSDestinationFactory">@@JMSDestinationFactory@@</attribute>
+      
       <depends>jboss.aop:service=AspectDeployer</depends>
       <depends>jboss.ejb:service=EJBDeployer</depends>
       <depends optional-attribute-name="JarsIgnoredForScanning" proxy-type="org.jboss.ejb3.JarsIgnoredForScanningMBean">jboss.ejb3:service=JarsIgnoredForScanning</depends>




More information about the jboss-cvs-commits mailing list