geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r497270 - in /geronimo/server/trunk/modules/geronimo-openejb-builder/src: main/java/org/apache/geronimo/openejb/deployment/ main/java/org/apache/geronimo/openejb/deployment/ejbref/ test/java/org/apache/geronimo/openejb/deployment/
Date Thu, 18 Jan 2007 00:43:23 GMT
Author: dain
Date: Wed Jan 17 16:43:22 2007
New Revision: 497270

URL: http://svn.apache.org/viewvc?view=rev&rev=497270
Log:
Updated for latest openejb changes

Added:
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
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/ejbref/AbstractEjbRefBuilder.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=497270&r1=497269&r2=497270
==============================================================================
--- 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
Wed Jan 17 16:43:22 2007
@@ -53,11 +53,11 @@
 import org.apache.geronimo.openejb.xbeans.ejbjar.OpenejbGeronimoEjbJarType;
 import org.apache.geronimo.openejb.EjbModuleImplGBean;
 import org.apache.geronimo.openejb.OpenEjbSystem;
+import org.apache.geronimo.openejb.EjbDeployment;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerSecurityDocument;
 import org.apache.geronimo.xbeans.javaee.AssemblyDescriptorType;
 import org.apache.geronimo.xbeans.javaee.EjbJarType;
-import org.apache.openejb.EjbDeployment;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.alt.config.ejb.OpenejbJar;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
@@ -223,6 +223,7 @@
             EjbJarInfo ejbJarInfo = openEjbSystem.configureApplication(ejbModule.getEjbModule());
             ejbModule.setEjbJarInfo(ejbJarInfo);
         } catch (OpenEJBException e) {
+            e.printStackTrace();
             throw new DeploymentException(e);
         }
 

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/ejbref/AbstractEjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/ejbref/AbstractEjbRefBuilder.java?view=diff&rev=497270&r1=497269&r2=497270
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/ejbref/AbstractEjbRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/ejbref/AbstractEjbRefBuilder.java
Wed Jan 17 16:43:22 2007
@@ -39,8 +39,8 @@
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.openejb.EjbReference;
+import org.apache.geronimo.openejb.EjbDeployment;
 import org.apache.geronimo.openejb.deployment.EjbInterface;
-import org.apache.openejb.RpcEjbDeployment;
 
 /**
  * @version $Rev: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
@@ -67,7 +67,7 @@
             } else {
                 checkLocalProxyInfo(query, homeInterface, businessInterface, configuration);
             }
-            match = new AbstractNameQuery(query.getArtifact(), query.getName(), RpcEjbDeployment.class.getName());
+            match = new AbstractNameQuery(query.getArtifact(), query.getName(), EjbDeployment.class.getName());
         } else if (name != null) {
             match = getMatch(refName, configuration, name, requiredModule, remote, isSession,
homeInterface, businessInterface);
         } else {
@@ -96,7 +96,7 @@
         } else {
             throw new UnresolvedEJBRefException(refName, !isRemote, isSession, home, remote,
matches.size() > 0);
         }
-        return new AbstractNameQuery(stripVersion(match.getArtifact()), match.getName(),
RpcEjbDeployment.class.getName());
+        return new AbstractNameQuery(stripVersion(match.getArtifact()), match.getName(),
EjbDeployment.class.getName());
     }
 
     private Collection<AbstractName> getMatchesFromName(boolean isSession, Map<String,
String> nameQuery, Configuration context, Artifact id, boolean isRemote, String home, String
remote) {
@@ -126,7 +126,7 @@
 
     @SuppressWarnings({"unchecked"})
     private Collection<GBeanData> findGBeanDatas(Configuration context, Artifact id,
Map<String, String> q) {
-        return context.findGBeanDatas(Collections.singleton(new AbstractNameQuery(id, q,
RpcEjbDeployment.class.getName())));
+        return context.findGBeanDatas(Collections.singleton(new AbstractNameQuery(id, q,
EjbDeployment.class.getName())));
     }
 
     private AbstractNameQuery getImplicitMatch(String refName, Configuration context, String
module, boolean isRemote, boolean isSession, String home, String remote) throws DeploymentException
{

Added: geronimo/server/trunk/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java?view=auto&rev=497270
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
(added)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
Wed Jan 17 16:43:22 2007
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.openejb.deployment;
+
+import java.io.File;
+import java.util.jar.JarFile;
+import java.net.URLClassLoader;
+import java.net.URL;
+
+import javax.transaction.TransactionManager;
+
+import junit.framework.TestCase;
+import org.apache.geronimo.openejb.OpenEjbSystem;
+import org.apache.geronimo.openejb.OpenEjbSystemGBean;
+import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
+import org.apache.openejb.alt.config.EjbModule;
+import org.apache.openejb.alt.config.ejb.OpenejbJar;
+import org.apache.openejb.assembler.classic.EjbJarInfo;
+import org.apache.openejb.jee.EjbJar;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EjbModuleBuilderTest extends TestCase {
+    public void test() throws Exception {
+        // create reference to openejb itests
+        File file = new File(System.getProperty("user.home") + ".m2/repository/org/apache/openejb/openejb-itests-beans/3.0-incubating-SNAPSHOT/openejb-itests-beans-3.0-incubating-SNAPSHOT.jar");
+        if (!file.canRead()) return;
+        JarFile moduleFile = new JarFile(file);
+
+        TransactionManager transactionManager = new GeronimoTransactionManager();
+        OpenEjbSystem openEjbSystem = new OpenEjbSystemGBean(transactionManager);
+
+        // load ejb-jar.xml
+        String ejbJarXml = XmlUtil.loadEjbJarXml(null, moduleFile);
+        assertNotNull(ejbJarXml);
+        EjbJar ejbJar = XmlUtil.unmarshal(EjbJar.class, ejbJarXml);
+
+        // load openejb-jar.xml
+        String openejbJarXml = XmlUtil.loadOpenejbJarXml(null, moduleFile);
+        OpenejbJar openejbJar = XmlUtil.unmarshal(OpenejbJar.class, openejbJarXml);
+
+        // create the module object
+        ClassLoader classLoader = new URLClassLoader(new URL[] {file.toURL()}, getClass().getClassLoader());
+        EjbModule ejbModule = new EjbModule(classLoader, moduleFile.getName(), ejbJar, openejbJar);
+
+        // configure the application
+        EjbJarInfo ejbJarInfo = openEjbSystem.configureApplication(ejbModule);
+
+    }
+}



Mime
View raw message