geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r516560 - /geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
Date Fri, 09 Mar 2007 21:37:43 GMT
Author: dblevins
Date: Fri Mar  9 13:37:42 2007
New Revision: 516560

URL: http://svn.apache.org/viewvc?view=rev&rev=516560
Log:
This should do it for getting the ejb classes searched for annotations

Modified:
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java?view=diff&rev=516560&r1=516559&r2=516560
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
Fri Mar  9 13:37:42 2007
@@ -296,17 +296,23 @@
 
     private ClassFinder createEjbJarClassFinder( EjbJarType ejbJarType, EjbModule ejbModule)
throws DeploymentException {
 
-        //----------------------------------------------------------------------------------------
-        // Find the list of classes from the ejb-jar.xml we want to search for annotations
in
-        //----------------------------------------------------------------------------------------
-        List<Class> classes = new ArrayList<Class>();
+        try {
+            // Get the classloader from the module's EARContext
+            ClassLoader classLoader = ejbModule.getEarContext().getClassLoader();
 
-        // Get the classloader from the module's EARContext
-        ClassLoader classLoader = ejbModule.getEarContext().getClassLoader();
+            //----------------------------------------------------------------------------------------
+            // Find the list of classes from the ejb-jar.xml we want to search for annotations
in
+            //----------------------------------------------------------------------------------------
+            List<Class> classes = new ArrayList<Class>();
 
-        // TODO Openejb has the classfinder we need, we just have to get it from them.
+            for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
+                classes.add(classLoader.loadClass(bean.getEjbClass()));
+            }
 
-        return new ClassFinder(classes);
+            return new ClassFinder(classes);
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException("Unable to load bean class.", e);
+        }
     }
 
     private GBeanData getEjbGBean(String ejbName) throws DeploymentException {



Mime
View raw message