[jboss-cvs] JBossAS SVN: r62022 - in trunk/ejb3: src/main/org/jboss/ejb3/metamodel and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 3 07:34:21 EDT 2007


Author: wolfc
Date: 2007-04-03 07:34:21 -0400 (Tue, 03 Apr 2007)
New Revision: 62022

Added:
   trunk/ejb3/src/main/org/jboss/ejb3/metamodel/GenericBean.java
   trunk/ejb3/src/resources/test/ejbthree936/
   trunk/ejb3/src/resources/test/ejbthree936/META-INF/
   trunk/ejb3/src/resources/test/ejbthree936/META-INF/jboss.xml
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStateless.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStatelessBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/unit/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/unit/UnknownBeanTypeTestCase.java
Modified:
   trunk/ejb3/build-test.xml
   trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java
   trunk/ejb3/src/resources/schema/jboss_5_0.xsd
Log:
EJBTHREE-936: allow ejb in jboss xml

Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml	2007-04-03 11:33:10 UTC (rev 62021)
+++ trunk/ejb3/build-test.xml	2007-04-03 11:34:21 UTC (rev 62022)
@@ -1860,6 +1860,20 @@
       </jar>
    </target>
 
+   <target name="ejbthree936"
+      description="Builds all jar files."
+      depends="compile-classes">
+
+      <mkdir dir="${build.lib}"/>
+
+      <jar jarfile="${build.lib}/ejbthree936.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/ejbthree936/*.class"/>
+         </fileset>
+         <fileset dir="${resources}/test/ejbthree936"/>
+      </jar>
+   </target>
+   
    <target name="jaxws"
       description="Builds a simple jar."
       depends="compile-classes">
@@ -3174,7 +3188,7 @@
    
    <target name="jars" depends="appclient, tck5sec, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
       circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440, 
-      ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree751, ejbthree921,
+      ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree751, ejbthree921, ejbthree936,
       aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, 
       securitydomain, enventry, 
       jms/managed, naming, bmt, jca/inflowmdb, pool, jms, security, reference21_30, factory, dd/web, txexceptions, 

Added: trunk/ejb3/src/main/org/jboss/ejb3/metamodel/GenericBean.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/metamodel/GenericBean.java	                        (rev 0)
+++ trunk/ejb3/src/main/org/jboss/ejb3/metamodel/GenericBean.java	2007-04-03 11:34:21 UTC (rev 62022)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.metamodel;
+
+/**
+ * Bean deployment descriptors found in jboss.xml for an unknown (/ annotated)
+ * Enterprise Java Bean.
+ * 
+ * TODO: maybe instantiate EnterpriseBean instead
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class GenericBean extends EnterpriseBean
+{
+
+}

Modified: trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java	2007-04-03 11:33:10 UTC (rev 62021)
+++ trunk/ejb3/src/main/org/jboss/ejb3/metamodel/JBossDDObjectFactory.java	2007-04-03 11:34:21 UTC (rev 62022)
@@ -324,6 +324,12 @@
       {
          child = new Consumer();
       }
+      else if (localName.equals("ejb"))
+      {
+         log.trace("found ejb");
+         ejbClass = GenericBean.class;
+         child = ejbs;
+      }
       else if (localName.equals("method-attributes"))
       {
          child = new MethodAttributes();
@@ -360,9 +366,9 @@
       {
          child = new Ejb3PortComponent();
       }
-
+      
       return child;
-   }   
+   }
 
    public Object newChild(ActivationConfig parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
@@ -724,7 +730,7 @@
       {
          targetRef.merge(sref);
       }
-   }   
+   }
 
    /**
     * Called when parsing character is complete.

Modified: trunk/ejb3/src/resources/schema/jboss_5_0.xsd
===================================================================
(Binary files differ)

Added: trunk/ejb3/src/resources/test/ejbthree936/META-INF/jboss.xml
===================================================================
--- trunk/ejb3/src/resources/test/ejbthree936/META-INF/jboss.xml	                        (rev 0)
+++ trunk/ejb3/src/resources/test/ejbthree936/META-INF/jboss.xml	2007-04-03 11:34:21 UTC (rev 62022)
@@ -0,0 +1,16 @@
+<jboss
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+        version="3.0">
+   <enterprise-beans>
+      <ejb>
+         <ejb-name>MyStatelessBean</ejb-name>
+         <resource-ref>
+         	<res-ref-name>qFactory</res-ref-name>
+         	<jndi-name>ConnectionFactory</jndi-name>
+         </resource-ref>
+      </ejb>
+   </enterprise-beans>
+</jboss>

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStateless.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStateless.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStateless.java	2007-04-03 11:34:21 UTC (rev 62022)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree936;
+
+import javax.ejb.Remote;
+
+ at Remote
+public interface MyStateless
+{
+
+   void check() throws IllegalStateException;
+
+}
\ No newline at end of file

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStatelessBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/MyStatelessBean.java	2007-04-03 11:34:21 UTC (rev 62022)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree936;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.jms.QueueConnectionFactory;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class MyStatelessBean implements MyStateless
+{
+   @Resource(name="qFactory")
+   private QueueConnectionFactory qFactory = null;
+   
+   /* (non-Javadoc)
+    * @see org.jboss.ejb3.test.wolfc.MyStateless#getMessage()
+    */
+   public void check()
+   {
+      if(qFactory == null)
+         throw new IllegalStateException("Not injected");
+   }
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/unit/UnknownBeanTypeTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/unit/UnknownBeanTypeTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree936/unit/UnknownBeanTypeTestCase.java	2007-04-03 11:34:21 UTC (rev 62022)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree936.unit;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree936.MyStateless;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Use a jboss deployment descriptor which doesn't know the bean type.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class UnknownBeanTypeTestCase extends JBossTestCase
+{
+
+   public UnknownBeanTypeTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void test1() throws Exception
+   {
+      MyStateless test = (MyStateless) this.getInitialContext().lookup("MyStatelessBean/remote");
+      test.check();
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(UnknownBeanTypeTestCase.class, "ejbthree936.jar");
+   }
+
+}




More information about the jboss-cvs-commits mailing list