openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r464275 - in /incubator/openejb/trunk/openejb2/modules/openejb-builder/src: main/java/org/apache/openejb/deployment/ main/java/org/apache/openejb/deployment/ant/ test/java/org/apache/openejb/deployment/entity/cmp/
Date Sun, 15 Oct 2006 20:41:05 GMT
Author: djencks
Date: Sun Oct 15 13:41:04 2006
New Revision: 464275

URL: http://svn.apache.org/viewvc?view=rev&rev=464275
Log:
GERONIMO-2492 first steps, make the WebServiceBuilder a little more flexible

Modified:
    incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/OpenEjbModuleBuilder.java
    incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/ant/DDLExporterTask.java
    incubator/openejb/trunk/openejb2/modules/openejb-builder/src/test/java/org/apache/openejb/deployment/entity/cmp/AbstractCmpTest.java

Modified: incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/OpenEjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/OpenEjbModuleBuilder.java?view=diff&rev=464275&r1=464274&r2=464275
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/OpenEjbModuleBuilder.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/OpenEjbModuleBuilder.java
Sun Oct 15 13:41:04 2006
@@ -292,6 +292,19 @@
             namingBuilders.buildEnvironment(assemblyDescriptor, openejbJar, environment);
         }
 
+        //overridden web service locations
+        Map correctedPortLocations = new HashMap();
+
+        OpenejbSessionBeanType[] openejbSessionBeans = openejbJar.getEnterpriseBeans().getSessionArray();
+        for (int i = 0; i < openejbSessionBeans.length; i++) {
+            OpenejbSessionBeanType sessionBean = openejbSessionBeans[i];
+                if (sessionBean.isSetWebServiceAddress()) {
+                    String location = sessionBean.getWebServiceAddress().trim();
+                    correctedPortLocations.put(sessionBean.getEjbName(), location);
+                }
+        }
+        Map portInfoMap = getWebServiceBuilder().findWebServices(moduleFile, true, correctedPortLocations,
environment);
+
         AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL,
NameFactory.J2EE_APPLICATION);
@@ -300,7 +313,7 @@
             moduleName = naming.createChildName(earName, targetPath, NameFactory.EJB_MODULE);
         }
 
-        return new EJBModule(standAlone, moduleName, environment, moduleFile, targetPath,
ejbJar, openejbJar, specDD);
+        return new EJBModule(standAlone, moduleName, environment, moduleFile, targetPath,
ejbJar, openejbJar, specDD, portInfoMap);
     }
 
     OpenejbOpenejbJarType getOpenejbJar(Object plan, JarFile moduleFile, boolean standAlone,
String targetPath, EjbJarType ejbJar) throws DeploymentException {
@@ -611,18 +624,12 @@
         // create an index of the openejb ejb configurations by ejb-name
         Map openejbBeans = new HashMap();
         List badBeans = new ArrayList();
-        //overridden web service locations
-        Map correctedPortLocations = new HashMap();
 
         OpenejbSessionBeanType[] openejbSessionBeans = openejbEjbJar.getEnterpriseBeans().getSessionArray();
         for (int i = 0; i < openejbSessionBeans.length; i++) {
             OpenejbSessionBeanType sessionBean = openejbSessionBeans[i];
             if (beans.contains(sessionBean.getEjbName())) {
                 openejbBeans.put(sessionBean.getEjbName(), sessionBean);
-                if (sessionBean.isSetWebServiceAddress()) {
-                    String location = sessionBean.getWebServiceAddress().trim();
-                    correctedPortLocations.put(sessionBean.getEjbName(), location);
-                }
             } else {
                 badBeans.add(sessionBean.getEjbName());
             }
@@ -659,8 +666,6 @@
             throw new DeploymentException(buf.toString());
         }
 
-        Map portInfoMap = getWebServiceBuilder().findWebServices(ejbModule.getModuleFile(),
true, correctedPortLocations);
-
         TransactionPolicyHelper transactionPolicyHelper;
         if (ejbJar.isSetAssemblyDescriptor()) {
             transactionPolicyHelper = new TransactionPolicyHelper(ejbJar.getAssemblyDescriptor().getContainerTransactionArray());
@@ -672,6 +677,8 @@
         //TODO go back to the commented version when possible
 //          String contextID = ejbModuleObjectName.getCanonicalName();
         String policyContextID = moduleBaseName.toString().replaceAll("[,: ]", "_");
+
+        Map portInfoMap = ejbModule.getPortMap();
 
         xmlBeansSessionBuilder.buildBeans(earContext, moduleBaseName, cl, ejbModule, componentPermissions,
openejbBeans, transactionPolicyHelper, enterpriseBeans, listener, policyContextID, portInfoMap);
 

Modified: incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/ant/DDLExporterTask.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/ant/DDLExporterTask.java?view=diff&rev=464275&r1=464274&r2=464275
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/ant/DDLExporterTask.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-builder/src/main/java/org/apache/openejb/deployment/ant/DDLExporterTask.java
Sun Oct 15 13:41:04 2006
@@ -24,6 +24,8 @@
 import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.lang.reflect.Constructor;
+import java.util.Collections;
+
 import javax.sql.DataSource;
 
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
@@ -145,9 +147,9 @@
 
             // fake j2ee context
             Naming naming = new Jsr77Naming();
-            AbstractName earName = naming.createRootName(new Artifact("fakeGroup", "fackArtifact",
"1", "fake"), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
+            AbstractName earName = naming.createRootName(new Artifact("fakeGroup", "fakeArtifact",
"1", "fake"), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
             AbstractName moduleName = naming.createChildName(earName, NameFactory.EJB_MODULE,
"module");
-            EJBModule ejbModule = new EJBModule(true, moduleName, new Environment(new Artifact("fakeGroup",
"fackArtifact", "1", "fake")), null, null, ejbJarType, openejbJarType, null);
+            EJBModule ejbModule = new EJBModule(true, moduleName, new Environment(new Artifact("fakeGroup",
"fakeArtifact", "1", "fake")), null, null, ejbJarType, openejbJarType, null, Collections.EMPTY_MAP);
 
             // get the ModuleSchema
             CmpSchemaBuilder cmpSchemaBuilder = new TranqlCmpSchemaBuilder();

Modified: incubator/openejb/trunk/openejb2/modules/openejb-builder/src/test/java/org/apache/openejb/deployment/entity/cmp/AbstractCmpTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-builder/src/test/java/org/apache/openejb/deployment/entity/cmp/AbstractCmpTest.java?view=diff&rev=464275&r1=464274&r2=464275
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-builder/src/test/java/org/apache/openejb/deployment/entity/cmp/AbstractCmpTest.java
(original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-builder/src/test/java/org/apache/openejb/deployment/entity/cmp/AbstractCmpTest.java
Sun Oct 15 13:41:04 2006
@@ -92,7 +92,7 @@
             ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 
             // create module cmp engine GBeanData
-            EJBModule ejbModule = new EJBModule(true, moduleName, TEST_ENVIRONMENT, null,
tempDir.getAbsoluteFile().toURI().toString(), ejbJarType, openejbJarType, "");
+            EJBModule ejbModule = new EJBModule(true, moduleName, TEST_ENVIRONMENT, null,
tempDir.getAbsoluteFile().toURI().toString(), ejbJarType, openejbJarType, "", Collections.EMPTY_MAP);
             CmpSchemaBuilder cmpSchemaBuilder = new TranqlCmpSchemaBuilder();
             cmpSchemaBuilder.initContext(earContext, ejbModule, classLoader);
             cmpSchemaBuilder.addBeans(earContext, ejbModule, classLoader);



Mime
View raw message