geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r436812 - in /geronimo/server/branches/sachin/modules: axis-builder/src/test/java/org/apache/geronimo/axis/builder/ jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/ kernel/src/main/java/org/apache/geronimo/kernel/config/ we...
Date Fri, 25 Aug 2006 14:26:40 GMT
Author: sppatel
Date: Fri Aug 25 07:26:39 2006
New Revision: 436812

URL: http://svn.apache.org/viewvc?rev=436812&view=rev
Log:
more stuff that faild to merge

Modified:
    geronimo/server/branches/sachin/modules/axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
    geronimo/server/branches/sachin/modules/jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/server/branches/sachin/modules/kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/branches/sachin/modules/web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/branches/sachin/modules/axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?rev=436812&r1=436811&r2=436812&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
(original)
+++ geronimo/server/branches/sachin/modules/axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
Fri Aug 25 07:26:39 2006
@@ -24,6 +24,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.jar.JarFile;
 import javax.wsdl.Binding;
 import javax.wsdl.BindingInput;
 import javax.wsdl.BindingOperation;
@@ -61,6 +62,8 @@
 import org.apache.geronimo.axis.client.AxisServiceReference;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.DeployableModule;
+import org.apache.geronimo.deployment.DeployableModuleFactory;
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.EJBModule;
@@ -118,7 +121,9 @@
 
         File moduleLocation = new File(tmpbasedir, "ejb");
         moduleLocation.mkdirs();
-        module = new EJBModule(true, moduleName, environment, new UnpackedJarFile(moduleLocation),
"ejb", null, null, null);
+        JarFile unpackedJar = new UnpackedJarFile(moduleLocation);
+        DeployableModule dm = DeployableModuleFactory.createDeployableModule(unpackedJar);
+        module = new EJBModule(true, moduleName, environment, dm, "ejb", null, null, null);
 
         runExternalWSTest = System.getProperty("geronimo.run.external.webservicetest", "false").equals("true");
     }

Modified: geronimo/server/branches/sachin/modules/jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=436812&r1=436811&r2=436812&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/server/branches/sachin/modules/jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Fri Aug 25 07:26:39 2006
@@ -261,11 +261,11 @@
                     if (plan != null) {
                         rawPlan = XmlBeansUtil.parse(((File) plan).toURL(), getClass().getClassLoader());
                     } else {
-                        URL path = DeploymentUtil.createJarURL(deployableModule, "WEB-INF/geronimo-web.xml");
+                        URL path = deployableModule.resolve("WEB-INF/geronimo-web.xml");
                         try {
                             rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                         } catch (FileNotFoundException e) {
-                            path = DeploymentUtil.createJarURL(deployableModule, "WEB-INF/geronimo-jetty.xml");
+                            path = deployableModule.resolve("WEB-INF/geronimo-jetty.xml");
                             try {
                                 rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                             } catch (FileNotFoundException e1) {

Modified: geronimo/server/branches/sachin/modules/kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=436812&r1=436811&r2=436812&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/branches/sachin/modules/kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Fri Aug 25 07:26:39 2006
@@ -505,6 +505,10 @@
         }
     }
 
+    public void addToClassPath(URL url) throws IOException {
+        configurationClassLoader.addURL(url);
+    }
+
     /**
      * Gets the type of the configuration (WAR, RAR et cetera)
      * @return Type of the configuration.

Modified: geronimo/server/branches/sachin/modules/web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java?rev=436812&r1=436811&r2=436812&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/branches/sachin/modules/web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
Fri Aug 25 07:26:39 2006
@@ -48,6 +48,7 @@
 import org.apache.geronimo.deployment.ModuleIDBuilder;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
 import org.apache.geronimo.deployment.DeployableModule;
+import org.apache.geronimo.deployment.DefaultDeployableModule;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.xbeans.ServiceDocument;
 import org.apache.geronimo.gbean.AbstractName;
@@ -226,29 +227,38 @@
 
         try {
             // add the warfile's content to the configuration
-            JarFile warFile = module.getModuleFile();
-            Enumeration entries = warFile.entries();
-            while (entries.hasMoreElements()) {
-                ZipEntry entry = (ZipEntry) entries.nextElement();
-                URI targetPath = new URI(null, entry.getName(), null);
-                if (entry.getName().equals("WEB-INF/web.xml")) {
-                    moduleContext.addFile(targetPath, module.getOriginalSpecDD());
-                } else if (entry.getName().startsWith("WEB-INF/lib") && entry.getName().endsWith(".jar"))
{
-                    moduleContext.addInclude(targetPath, warFile, entry);
-                } else {
-                    moduleContext.addFile(targetPath, warFile, entry);
+            DeployableModule war = module.getModuleFile();
+            if (war instanceof DefaultDeployableModule) {
+                JarFile jar = ((DefaultDeployableModule) war).getJarFile();
+
+                Enumeration entries = jar.entries();
+                while (entries.hasMoreElements()) {
+                    ZipEntry entry = (ZipEntry) entries.nextElement();
+                    URI targetPath = new URI(null, entry.getName(), null);
+                    if (entry.getName().equals("WEB-INF/web.xml")) {
+                        moduleContext.addFile(targetPath, module.getOriginalSpecDD());
+                    } else if (entry.getName().startsWith("WEB-INF/lib") && entry.getName().endsWith(".jar"))
{
+                        moduleContext.addInclude(targetPath, jar, entry);
+                    } else {
+                        moduleContext.addFile(targetPath, jar, entry);
+                    }
                 }
-            }
-
-            //always add WEB-INF/classes to the classpath regardless of whether
-            //any classes exist
-            moduleContext.getConfiguration().addToClassPath("WEB-INF/classes/");
-
-            // add the manifest classpath entries declared in the war to the class loader
-            // we have to explicitly add these since we are unpacking the web module
-            // and the url class loader will not pick up a manifest from an unpacked dir
-            moduleContext.addManifestClassPath(warFile, RELATIVE_MODULE_BASE_URI);
 
+                //always add WEB-INF/classes to the classpath regardless of whether
+                //any classes exist
+                moduleContext.getConfiguration().addToClassPath("WEB-INF/classes/");
+
+                // add the manifest classpath entries declared in the war to the class loader
+                // we have to explicitly add these since we are unpacking the web module
+                // and the url class loader will not pick up a manifest from an unpacked
dir
+                moduleContext.addManifestClassPath(jar, RELATIVE_MODULE_BASE_URI);
+            } else {
+                //TODO GERONIMO-1526
+                File[] classes = war.getClassesFolders();
+                for (int i = 0; i < classes.length; i++) {
+                    moduleContext.getConfiguration().addToClassPath(classes[i].toURL());
+                }
+            }
         } catch (IOException e) {
             throw new DeploymentException("Problem deploying war", e);
         } catch (URISyntaxException e) {



Mime
View raw message