geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r498235 - in /geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment: EjbModuleBuilder.java XmlUtil.java
Date Sun, 21 Jan 2007 02:41:57 GMT
Author: dain
Date: Sat Jan 20 18:41:56 2007
New Revision: 498235

URL: http://svn.apache.org/viewvc?view=rev&rev=498235
Log:
Generate CMP2 impl during deployment and save into earContext

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

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?view=diff&rev=498235&r1=498234&r2=498235
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Sat Jan 20 18:41:56 2007
@@ -64,6 +64,8 @@
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.alt.config.ejb.OpenejbJar;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
+import org.apache.openejb.assembler.classic.Cmp2Builder;
+import org.apache.openejb.assembler.classic.AppInfo;
 import org.apache.openejb.jee.EjbJar;
 import org.apache.openejb.jee.EjbLocalRef;
 import org.apache.openejb.jee.EjbRef;
@@ -316,11 +318,31 @@
         // build the config info tree
         // this method fills in the ejbJar jaxb tree based on the annotations
         // (metadata complete) and it run the openejb verifier
+        EjbJarInfo ejbJarInfo;
         try {
-            EjbJarInfo ejbJarInfo = openEjbSystem.configureApplication(ejbModule.getEjbModule());
+            ejbJarInfo = openEjbSystem.configureApplication(ejbModule.getEjbModule());
             ejbModule.setEjbJarInfo(ejbJarInfo);
         } catch (OpenEJBException e) {
             e.printStackTrace();
+            throw new DeploymentException(e);
+        }
+
+        // generate the CMP2 implementation classes
+        // Generate the cmp2 concrete subclasses
+        AppInfo appInfo = new AppInfo();
+        appInfo.ejbJars.add(ejbJarInfo);
+        Cmp2Builder cmp2Builder = new Cmp2Builder(appInfo, classLoader);
+        try {
+            File generatedJar = cmp2Builder.getJarFile();
+            if (generatedJar != null) {
+                String generatedPath = module.getTargetPath();
+                if (generatedPath.endsWith(".jar")) {
+                    generatedPath = generatedPath.substring(0, generatedPath.length() -4);
+                }
+                generatedPath += "-cmp2.jar";
+                earContext.addInclude(URI.create(generatedPath), generatedJar);
+            }
+        } catch (IOException e) {
             throw new DeploymentException(e);
         }
 

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/XmlUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/XmlUtil.java?view=diff&rev=498235&r1=498234&r2=498235
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/XmlUtil.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/XmlUtil.java
Sat Jan 20 18:41:56 2007
@@ -111,6 +111,9 @@
                     openejbJarXml = xmlObject.xmlText();
                 } else {
                     URL path = DeploymentUtil.createJarURL(moduleFile, "META-INF/openejb-jar.xml");
+                    if (path == null) {
+                        return null;
+                    }
                     openejbJarXml = DeploymentUtil.readAll(path);
                 }
             }



Mime
View raw message