geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r436809 - in /geronimo/server/branches/sachin/modules: axis-builder/src/main/java/org/apache/geronimo/axis/builder/ deployment/src/test/java/org/apache/geronimo/deployment/
Date Fri, 25 Aug 2006 14:12:35 GMT
Author: sppatel
Date: Fri Aug 25 07:12:34 2006
New Revision: 436809

URL: http://svn.apache.org/viewvc?rev=436809&view=rev
Log:
fix items that failed to get merged

Modified:
    geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
    geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
    geronimo/server/branches/sachin/modules/deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java

Modified: geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?rev=436809&r1=436808&r2=436809&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
(original)
+++ geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
Fri Aug 25 07:12:34 2006
@@ -18,8 +18,10 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.FileInputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -55,6 +57,7 @@
 import org.apache.geronimo.xbeans.wsdl.TService;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.DeployableModule;
+import org.apache.geronimo.deployment.DefaultDeployableModule;
 import org.apache.xmlbeans.SchemaField;
 import org.apache.xmlbeans.SchemaGlobalElement;
 import org.apache.xmlbeans.SchemaParticle;
@@ -608,6 +611,19 @@
         throw new DeploymentException("No port found with name " + portComponentName + "
expected at " + servletLocation);
     }
 
+    private InputStream getInputStream(URI location, DeployableModule module) throws IOException
{
+        InputStream inputStream = null;
+        if (deployableModule instanceof DefaultDeployableModule) {
+            JarFile jar = ((DefaultDeployableModule) deployableModule).getJarFile();
+            ZipEntry entry = jar.getEntry(location.toString());
+            inputStream = jar.getInputStream(entry);
+        } else {
+            URL url = deployableModule.resolve(location.toString());
+            inputStream = new FileInputStream(url.getFile());
+        }
+        return inputStream;
+    }
+
     private class JarEntityResolver implements EntityResolver {
 
         private final static String PROJECT_URL_PREFIX = "project://local/";
@@ -620,12 +636,11 @@
             URI location = ((URI) uris.peek()).resolve(systemId);
             InputStream wsdlInputStream = null;
             try {
-                ZipEntry entry = deployableModule.getEntry(location.toString());
-                wsdlInputStream = deployableModule.getInputStream(entry);
+                wsdlInputStream = getInputStream(location, deployableModule);
                 XmlObject xmlObject = SchemaDocument.Factory.parse(wsdlInputStream);
                 wsdlMap.put(location, xmlObject);
                 wsdlInputStream.close();
-                wsdlInputStream = deployableModule.getInputStream(entry);
+                wsdlInputStream = getInputStream(location, deployableModule);
             } catch (XmlException e) {
                 throw (IOException) new IOException("Could not parse schema document").initCause(e);
             }
@@ -645,12 +660,11 @@
         public InputSource getBaseInputSource() {
             InputStream wsdlInputStream = null;
             try {
-                ZipEntry entry = deployableModule.getEntry(wsdlURI.toString());
-                wsdlInputStream = deployableModule.getInputStream(entry);
+                wsdlInputStream = getInputStream(wsdlURI, deployableModule);
                 DefinitionsDocument definition = DefinitionsDocument.Factory.parse(wsdlInputStream);
                 wsdlMap.put(wsdlURI, definition);
                 wsdlInputStream.close();
-                wsdlInputStream = deployableModule.getInputStream(entry);
+                wsdlInputStream = getInputStream(wsdlURI, deployableModule);
             } catch (Exception e) {
                 throw new RuntimeException("Could not open stream to wsdl file", e);
             }
@@ -666,8 +680,7 @@
             latestImportURI = parentURI.resolve(relativeLocation);
             InputStream importInputStream = null;
             try {
-                ZipEntry entry = deployableModule.getEntry(latestImportURI.toString());
-                importInputStream = deployableModule.getInputStream(entry);
+                importInputStream = getInputStream(latestImportURI, deployableModule);
                 try {
                     DefinitionsDocument definition = DefinitionsDocument.Factory.parse(importInputStream);
                     importInputStream.close();
@@ -676,7 +689,7 @@
                 } catch (XmlException e) {
                     //probably was a schema rather than wsdl.  If there are real problems
they will show up later.
                 }
-                importInputStream = deployableModule.getInputStream(entry);
+                importInputStream = getInputStream(latestImportURI, deployableModule);
             } catch (Exception e) {
                 throw new RuntimeException("Could not open stream to import file", e);
             }

Modified: geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?rev=436809&r1=436808&r2=436809&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
(original)
+++ geronimo/server/branches/sachin/modules/axis-builder/src/main/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
Fri Aug 25 07:12:34 2006
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.FileInputStream;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -77,6 +78,7 @@
 import org.apache.geronimo.xbeans.j2ee.XsdQNameType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.DeployableModule;
+import org.apache.geronimo.deployment.DefaultDeployableModule;
 import org.apache.xmlbeans.XmlException;
 
 /**
@@ -90,15 +92,32 @@
         return readJaxrpcMapping(deployableModule, jaxrpcMappingPath);
     }
 
+    private static InputStream getInputStream(String path, DeployableModule module) throws
IOException {
+        InputStream inputStream = null;
+        if (module instanceof DefaultDeployableModule) {
+            JarFile jar = ((DefaultDeployableModule) module).getJarFile();
+            ZipEntry entry = jar.getEntry(path);
+            if (entry == null)
+                return null;
+            inputStream = jar.getInputStream(entry);
+        } else {
+            URL url = module.resolve(path);
+            if (url == null)
+                return null;
+            inputStream = new FileInputStream(url.getFile());
+        }
+        return inputStream;
+    }
+
     public static JavaWsdlMappingType readJaxrpcMapping(DeployableModule deployableModule,
String jaxrpcMappingPath) throws DeploymentException {
         JavaWsdlMappingType mapping;
         InputStream jaxrpcInputStream = null;
         try {
-            ZipEntry zipEntry = deployableModule.getEntry(jaxrpcMappingPath);
-            if(zipEntry == null){
-                throw new DeploymentException("The JAX-RPC mapping file "+jaxrpcMappingPath+"
specified in webservices.xml for the ejb module could not be found.");
+            jaxrpcInputStream = getInputStream(jaxrpcMappingPath, deployableModule);
+            if (jaxrpcInputStream == null) {
+                throw new DeploymentException("The JAX-RPC mapping file " + jaxrpcMappingPath
+ " specified in webservices.xml for the ejb module could not be found.");
             }
-            jaxrpcInputStream = deployableModule.getInputStream(zipEntry);
+            jaxrpcInputStream = getInputStream(jaxrpcMappingPath, deployableModule);
         } catch (IOException e) {
             throw new DeploymentException("Could not open stream to jaxrpc mapping document",
e);
         }

Modified: geronimo/server/branches/sachin/modules/deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=436809&r1=436808&r2=436809&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
(original)
+++ geronimo/server/branches/sachin/modules/deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
Fri Aug 25 07:12:34 2006
@@ -257,15 +257,15 @@
     }
 
     private class MockConfigurationBuilder implements ConfigurationBuilder {
-        public Object getDeploymentPlan(File planFile, JarFile module, ModuleIDBuilder idBuilder)
throws DeploymentException {
+        public Object getDeploymentPlan(File planFile, DeployableModule module, ModuleIDBuilder
idBuilder) throws DeploymentException {
             return new Object();
         }
 
-        public Artifact getConfigurationID(Object plan, JarFile module, ModuleIDBuilder idBuilder)
throws IOException, DeploymentException {
+        public Artifact getConfigurationID(Object plan, DeployableModule module, ModuleIDBuilder
idBuilder) throws IOException, DeploymentException {
             return NEW_ID;
         }
 
-        public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId,
Object plan, JarFile module, Collection configurationStores, ArtifactResolver artifactResolver,
ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
+        public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId,
Object plan, DeployableModule module, Collection configurationStores, ArtifactResolver artifactResolver,
ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
             return new DeploymentContext(dir,
                     dir,
                     new Environment(configId),



Mime
View raw message