geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r434520 [1/2] - in /geronimo/server/branches/sachin: ./ modules/axis-builder/src/java/org/apache/geronimo/axis/builder/ modules/client-builder/src/java/org/apache/geronimo/client/builder/ modules/connector-builder/src/java/org/apache/geroni...
Date Thu, 24 Aug 2006 20:43:14 GMT
Author: sppatel
Date: Thu Aug 24 13:43:12 2006
New Revision: 434520

URL: http://svn.apache.org/viewvc?rev=434520&view=rev
Log:
create branch for G-1526

Added:
    geronimo/server/branches/sachin/
      - copied from r434517, geronimo/server/trunk/
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java   (with props)
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java   (with props)
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java   (with props)
Modified:
    geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
    geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
    geronimo/server/branches/sachin/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/branches/sachin/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java
    geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
    geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/NamespaceDrivenBuilderCollection.java
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java
    geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
    geronimo/server/branches/sachin/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableModuleBuilder.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
    geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
    geronimo/server/branches/sachin/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/server/branches/sachin/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/branches/sachin/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/server/branches/sachin/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
    geronimo/server/branches/sachin/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/branches/sachin/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java Thu Aug 24 13:43:12 2006
@@ -58,6 +58,7 @@
 import org.apache.geronimo.axis.server.ServiceInfo;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.DeployableModule;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -84,11 +85,11 @@
 
     //WebServiceBuilder
 
-    public Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
-        return WSDescriptorParser.parseWebServiceDescriptor(wsDDUrl, moduleFile, isEJB, servletLocations);
+    public Map parseWebServiceDescriptor(URL wsDDUrl, DeployableModule deployableModule, boolean isEJB, Map servletLocations) throws DeploymentException {
+        return WSDescriptorParser.parseWebServiceDescriptor(wsDDUrl, deployableModule, isEJB, servletLocations);
     }
 
-    public void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject, String seiClassName, ClassLoader classLoader) throws DeploymentException {
+    public void configurePOJO(GBeanData targetGBean, DeployableModule deployableModule, Object portInfoObject, String seiClassName, ClassLoader classLoader) throws DeploymentException {
         PortInfo portInfo = (PortInfo) portInfoObject;
         ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
         JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
@@ -127,7 +128,7 @@
         targetGBean.setAttribute("webServiceContainer", axisWebServiceContainer);
     }
 
-    public void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject, ClassLoader classLoader) throws DeploymentException {
+    public void configureEJB(GBeanData targetGBean, DeployableModule deployableModule, Object portInfoObject, ClassLoader classLoader) throws DeploymentException {
         PortInfo portInfo = (PortInfo) portInfoObject;
         ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
         targetGBean.setAttribute("serviceInfo", serviceInfo);
@@ -147,13 +148,13 @@
     //ServicereferenceBuilder
     public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
         GerServiceRefType gerServiceRefType = (GerServiceRefType) serviceRefType;
-        JarFile moduleFile = module.getModuleFile();
+        DeployableModule deployableModule = module.getModuleFile();
         SchemaInfoBuilder schemaInfoBuilder = null;
         JavaWsdlMappingType mapping = null;
         if (wsdlURI != null) {
-            schemaInfoBuilder = new SchemaInfoBuilder(moduleFile, wsdlURI);
+            schemaInfoBuilder = new SchemaInfoBuilder(deployableModule, wsdlURI);
 
-            mapping = WSDescriptorParser.readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
+            mapping = WSDescriptorParser.readJaxrpcMapping(deployableModule, jaxrpcMappingURI);
         }
 
         return createService(serviceInterface, schemaInfoBuilder, mapping, serviceQName, SOAP_VERSION, handlerInfos, gerServiceRefType, deploymentContext, module, classLoader);

Modified: geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java Thu Aug 24 13:43:12 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;
@@ -54,6 +56,8 @@
 import org.apache.geronimo.xbeans.wsdl.TPort;
 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;
@@ -112,7 +116,7 @@
         }
     }
 
-    private final JarFile moduleFile;
+    private final DeployableModule deployableModule;
     private final Definition definition;
     private final Stack uris = new Stack();
     private final Map wsdlMap = new HashMap();
@@ -123,24 +127,24 @@
     private final Map portMap;
 
 
-    public SchemaInfoBuilder(JarFile moduleFile, URI wsdlUri) throws DeploymentException {
-        this(moduleFile, wsdlUri, null, null);
+    public SchemaInfoBuilder(DeployableModule deployableModule, URI wsdlUri) throws DeploymentException {
+        this(deployableModule, wsdlUri, null, null);
     }
 
-    public SchemaInfoBuilder(JarFile moduleFile, Definition definition) throws DeploymentException {
-        this(moduleFile, null, definition, null);
+    public SchemaInfoBuilder(DeployableModule deployableModule, Definition definition) throws DeploymentException {
+        this(deployableModule, null, definition, null);
     }
 
-    SchemaInfoBuilder(JarFile moduleFile, URI uri, SchemaTypeSystem schemaTypeSystem) throws DeploymentException {
-        this(moduleFile, uri, null, schemaTypeSystem);
+    SchemaInfoBuilder(DeployableModule deployableModule, URI uri, SchemaTypeSystem schemaTypeSystem) throws DeploymentException {
+        this(deployableModule, uri, null, schemaTypeSystem);
     }
 
-    SchemaInfoBuilder(JarFile moduleFile, URI uri, Definition definition, SchemaTypeSystem schemaTypeSystem) throws DeploymentException {
-        this.moduleFile = moduleFile;
+    SchemaInfoBuilder(DeployableModule deployableModle, URI uri, Definition definition, SchemaTypeSystem schemaTypeSystem) throws DeploymentException {
+        this.deployableModule = deployableModle;
         if (uri != null) {
             uris.push(uri);
             if (definition == null && schemaTypeSystem == null) {
-                definition = readWsdl(moduleFile, uri);
+                definition = readWsdl(deployableModle, uri);
             }
         } else if (definition != null) {
             try {
@@ -513,7 +517,7 @@
     }
 
 
-    public Definition readWsdl(JarFile moduleFile, URI wsdlURI) throws DeploymentException {
+    public Definition readWsdl(DeployableModule deployableModule, URI wsdlURI) throws DeploymentException {
         Definition definition;
         WSDLFactory wsdlFactory = null;
         try {
@@ -607,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/";
@@ -616,17 +633,17 @@
             if (systemId.indexOf(PROJECT_URL_PREFIX) > -1) {
                 systemId = systemId.substring(PROJECT_URL_PREFIX.length());
             }
-            URI location = ((URI) uris.peek()).resolve(systemId);
+            URI location = null;
             InputStream wsdlInputStream = null;
             try {
-                ZipEntry entry = moduleFile.getEntry(location.toString());
-                wsdlInputStream = moduleFile.getInputStream(entry);
+                location = ((URI) uris.peek()).resolve(systemId);
+                wsdlInputStream = getInputStream(location, deployableModule);
                 XmlObject xmlObject = SchemaDocument.Factory.parse(wsdlInputStream);
                 wsdlMap.put(location, xmlObject);
                 wsdlInputStream.close();
-                wsdlInputStream = moduleFile.getInputStream(entry);
+                wsdlInputStream = getInputStream(location, deployableModule);
             } catch (XmlException e) {
-                throw (IOException) new IOException("Could not parse schema document").initCause(e);
+                throw(IOException) new IOException("Could not parse schema document").initCause(e);
             }
             return new InputSource(wsdlInputStream);
         }
@@ -644,12 +661,11 @@
         public InputSource getBaseInputSource() {
             InputStream wsdlInputStream = null;
             try {
-                ZipEntry entry = moduleFile.getEntry(wsdlURI.toString());
-                wsdlInputStream = moduleFile.getInputStream(entry);
+                wsdlInputStream = getInputStream(wsdlURI, deployableModule);
                 DefinitionsDocument definition = DefinitionsDocument.Factory.parse(wsdlInputStream);
                 wsdlMap.put(wsdlURI, definition);
                 wsdlInputStream.close();
-                wsdlInputStream = moduleFile.getInputStream(entry);
+                wsdlInputStream = getInputStream(wsdlURI, deployableModule);
             } catch (Exception e) {
                 throw new RuntimeException("Could not open stream to wsdl file", e);
             }
@@ -665,8 +681,7 @@
             latestImportURI = parentURI.resolve(relativeLocation);
             InputStream importInputStream = null;
             try {
-                ZipEntry entry = moduleFile.getEntry(latestImportURI.toString());
-                importInputStream = moduleFile.getInputStream(entry);
+                importInputStream = getInputStream(latestImportURI, deployableModule);
                 try {
                     DefinitionsDocument definition = DefinitionsDocument.Factory.parse(importInputStream);
                     importInputStream.close();
@@ -675,7 +690,7 @@
                 } catch (XmlException e) {
                     //probably was a schema rather than wsdl.  If there are real problems they will show up later.
                 }
-                importInputStream = moduleFile.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/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java (original)
+++ geronimo/server/branches/sachin/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java Thu Aug 24 13:43:12 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;
@@ -76,6 +77,8 @@
 import org.apache.geronimo.xbeans.j2ee.WebservicesType;
 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;
 
 /**
@@ -84,20 +87,20 @@
 public class WSDescriptorParser {
 
 
-    public static JavaWsdlMappingType readJaxrpcMapping(JarFile moduleFile, URI jaxrpcMappingURI) throws DeploymentException {
+    public static JavaWsdlMappingType readJaxrpcMapping(DeployableModule deployableModule, URI jaxrpcMappingURI) throws DeploymentException {
         String jaxrpcMappingPath = jaxrpcMappingURI.toString();
-        return readJaxrpcMapping(moduleFile, jaxrpcMappingPath);
+        return readJaxrpcMapping(deployableModule, jaxrpcMappingPath);
     }
 
-    public static JavaWsdlMappingType readJaxrpcMapping(JarFile moduleFile, String jaxrpcMappingPath) throws DeploymentException {
+    public static JavaWsdlMappingType readJaxrpcMapping(DeployableModule deployableModule, String jaxrpcMappingPath) throws DeploymentException {
         JavaWsdlMappingType mapping;
         InputStream jaxrpcInputStream = null;
         try {
-            ZipEntry zipEntry = moduleFile.getEntry(jaxrpcMappingPath);
-            if(zipEntry == null){
+            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 = moduleFile.getInputStream(zipEntry);
+            jaxrpcInputStream = getInputStream(jaxrpcMappingPath, deployableModule);
         } catch (IOException e) {
             throw new DeploymentException("Could not open stream to jaxrpc mapping document", e);
         }
@@ -113,6 +116,23 @@
         return mapping;
     }
 
+    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 Map getExceptionMap(JavaWsdlMappingType mapping) {
         Map exceptionMap = new HashMap();
@@ -291,13 +311,13 @@
      * corresponding ejb-link or servlet-link element .
      *
      * @param webservicesType
-     * @param moduleFile
+     * @param deployableModule
      * @param isEJB
      * @param servletLocations
      * @return
      * @throws org.apache.geronimo.common.DeploymentException
      */
-    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
+    public static Map parseWebServiceDescriptor(WebservicesType webservicesType, DeployableModule deployableModule, boolean isEJB, Map servletLocations) throws DeploymentException {
         Map portMap = new HashMap();
         WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray();
         for (int i = 0; i < webserviceDescriptions.length; i++) {
@@ -314,10 +334,10 @@
             } catch (URISyntaxException e) {
                 throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e);
             }
-            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(moduleFile, wsdlURI);
+            SchemaInfoBuilder schemaInfoBuilder =  new SchemaInfoBuilder(deployableModule, wsdlURI);
             Map wsdlPortMap = schemaInfoBuilder.getPortMap();
 
-            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
+            JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(deployableModule, jaxrpcMappingURI);
             HashMap seiMappings = new HashMap();
             ServiceEndpointInterfaceMappingType[] mappings = javaWsdlMapping.getServiceEndpointInterfaceMappingArray();
             for (int j = 0; j < mappings.length; j++) {
@@ -376,12 +396,12 @@
         return portMap;
     }
 
-    public static Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
+    public static Map parseWebServiceDescriptor(URL wsDDUrl, DeployableModule deployableModule, boolean isEJB, Map servletLocations) throws DeploymentException {
         try {
             WebservicesDocument webservicesDocument = WebservicesDocument.Factory.parse(wsDDUrl);
             XmlBeansUtil.validateDD(webservicesDocument);
             WebservicesType webservicesType = webservicesDocument.getWebservices();
-            return parseWebServiceDescriptor(webservicesType, moduleFile, isEJB, servletLocations);
+            return parseWebServiceDescriptor(webservicesType, deployableModule, isEJB, servletLocations);
         } catch (XmlException e) {
             throw new DeploymentException("Could not read descriptor document", e);
         } catch (IOException e) {

Modified: geronimo/server/branches/sachin/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Thu Aug 24 13:43:12 2006
@@ -38,16 +38,11 @@
 import org.apache.geronimo.client.AppClientContainer;
 import org.apache.geronimo.client.StaticJndiContextPlugin;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.deployment.ModuleIDBuilder;
-import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
-import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
+import org.apache.geronimo.deployment.*;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
-import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.util.NestedJarFile;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
-import org.apache.geronimo.deployment.xbeans.GbeanType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -203,15 +198,15 @@
         return (SecurityBuilder) securityBuilder.getElement();
     }
 
-    public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    public Module createModule(File plan, DeployableModule moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, "app-client", null, null, null, naming, idBuilder);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    public Module createModule(Object plan, DeployableModule moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, targetPath, specDDUrl, environment, earName, naming, idBuilder);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    private Module createModule(Object plan, DeployableModule moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -221,7 +216,7 @@
         ApplicationClientType appClient;
         try {
             if (specDDUrl == null) {
-                specDDUrl = DeploymentUtil.createJarURL(moduleFile, "META-INF/application-client.xml");
+                specDDUrl = moduleFile.resolve("META-INF/application-client.xml");
             }
 
             // read in the entire specDD as a string, we need this for getDeploymentDescriptor
@@ -248,12 +243,12 @@
 
         EnvironmentType clientEnvironmentType = gerAppClient.getClientEnvironment();
         Environment clientEnvironment = EnvironmentBuilder.buildEnvironment(clientEnvironmentType, defaultClientEnvironment);
+        String name = moduleFile.getRoot().getName();
         if(standAlone) {
-            String name = new File(moduleFile.getName()).getName();
             idBuilder.resolve(clientEnvironment, name+"_"+name, "jar");
         } else {
             Artifact earConfigId = earEnvironment.getConfigId();
-            idBuilder.resolve(clientEnvironment, earConfigId.getArtifactId() + "_" + new File(moduleFile.getName()).getName(), "jar");
+            idBuilder.resolve(clientEnvironment, earConfigId.getArtifactId() + "_" + name, "jar");
         }
         EnvironmentType serverEnvironmentType = gerAppClient.getServerEnvironment();
         Environment serverEnvironment = EnvironmentBuilder.buildEnvironment(serverEnvironmentType, defaultServerEnvironment);
@@ -264,7 +259,7 @@
                 throw new IllegalStateException("Server environment module ID should be fully resolved (not "+serverEnvironment.getConfigId()+")");
             }
         } else {
-            idBuilder.resolve(serverEnvironment, new File(moduleFile.getName()).getName(), "jar");
+            idBuilder.resolve(serverEnvironment, name, "jar");
         }
 
         AbstractName moduleName;
@@ -278,7 +273,7 @@
         return new AppClientModule(standAlone, moduleName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, gerAppClient, specDD);
     }
 
-    GerApplicationClientType getGeronimoAppClient(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, ApplicationClientType appClient, Environment environment) throws DeploymentException {
+    GerApplicationClientType getGeronimoAppClient(Object plan, DeployableModule moduleFile, boolean standAlone, String targetPath, ApplicationClientType appClient, Environment environment) throws DeploymentException {
         GerApplicationClientType gerAppClient;
         XmlObject rawPlan = null;
         try {
@@ -290,7 +285,7 @@
                     if (plan != null) {
                         rawPlan = XmlBeansUtil.parse((File) plan);
                     } else {
-                        URL path = DeploymentUtil.createJarURL(moduleFile, "META-INF/geronimo-application-client.xml");
+                        URL path = moduleFile.resolve("META-INF/geronimo-application-client.xml");
                         rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                     }
                 }
@@ -305,7 +300,7 @@
                 String path;
                 if (standAlone) {
                     // default configId is based on the moduleFile name
-                    path = new File(moduleFile.getName()).getName();
+                    path = moduleFile.getRoot().getName();
                 } else {
                     // default configId is based on the module uri from the application.xml
                     path = targetPath;
@@ -346,7 +341,7 @@
         return geronimoAppClient;
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repositories) throws DeploymentException {
+    public void installModule(DeployableModule earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repositories) throws DeploymentException {
         // extract the app client jar file into a standalone packed jar file and add the contents to the output
         JarFile moduleFile = module.getModuleFile();
         try {
@@ -355,7 +350,7 @@
             throw new DeploymentException("Unable to copy app client module jar into configuration: " + moduleFile.getName());
         }
         AppClientModule appClientModule = (AppClientModule) module;
-        appClientModule.setEarFile(earFile);
+        appClientModule.setEar(earFile);
         //create the ear context for the app client.
         Environment clientEnvironment = appClientModule.getClientEnvironment();
         if (!appClientModule.isStandAlone() || clientEnvironment.getConfigId() == null) {
@@ -474,7 +469,7 @@
                 }
 
                 // add manifest class path entries to the app client context
-                addManifestClassPath(appClientDeploymentContext, appClientModule.getEarFile(), moduleFile, moduleBase);
+                addManifestClassPath(appClientDeploymentContext, appClientModule.getEar(), moduleFile, moduleBase);
 
                 // get the classloader
                 ClassLoader appClientClassLoader = appClientDeploymentContext.getClassLoader();
@@ -512,7 +507,7 @@
                             } else {
                                 path = resource.getInternalRar();
                                 try {
-                                    connectorFile = new NestedJarFile(appClientModule.getEarFile(), path);
+                                    connectorFile = new NestedJarFile(appClientModule.getEar(), path);
                                 } catch (IOException e) {
                                     throw new DeploymentException("Could not locate connector inside ear", e);
                                 }
@@ -619,7 +614,7 @@
         return GERAPPCLIENT_NAMESPACE;
     }
 
-    public void addManifestClassPath(DeploymentContext deploymentContext, JarFile earFile, JarFile jarFile, URI jarFileLocation) throws DeploymentException {
+    public void addManifestClassPath(DeploymentContext deploymentContext, DeployableModule earFile, DeployableModule jarFile, URI jarFileLocation) throws DeploymentException {
         Manifest manifest;
         try {
             manifest = jarFile.getManifest();

Modified: geronimo/server/branches/sachin/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Thu Aug 24 13:43:12 2006
@@ -64,6 +64,7 @@
 import org.apache.geronimo.deployment.ModuleIDBuilder;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
+import org.apache.geronimo.deployment.DeployableModule;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
@@ -153,15 +154,15 @@
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
     }
 
-    public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    public Module createModule(File plan, DeployableModule moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, "rar", null, null, null, naming, idBuilder);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    public Module createModule(Object plan, DeployableModule moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, targetPath, specDDUrl, environment, earName, naming, idBuilder);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    private Module createModule(Object plan, DeployableModule moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -170,7 +171,7 @@
         XmlObject connector;
         try {
             if (specDDUrl == null) {
-                specDDUrl = DeploymentUtil.createJarURL(moduleFile, "META-INF/ra.xml");
+                specDDUrl = moduleFile.resolve("META-INF/ra.xml");
             }
 
             // read in the entire specDD as a string, we need this for getDeploymentDescriptor
@@ -203,7 +204,7 @@
                     if (plan != null) {
                         gerConnectorDoc = GerConnectorDocument.Factory.parse((File) plan, XmlBeansUtil.createXmlOptions(errors));
                     } else {
-                        URL path = DeploymentUtil.createJarURL(moduleFile, "META-INF/geronimo-ra.xml");
+                        URL path = moduleFile.resolve("META-INF/geronimo-ra.xml");
                         gerConnectorDoc = GerConnectorDocument.Factory.parse(path, XmlBeansUtil.createXmlOptions(errors));
                     }
                     if (errors.size() > 0) {
@@ -244,7 +245,7 @@
                 throw new IllegalStateException("Connector module ID should be fully resolved (not " + environment.getConfigId() + ")");
             }
         } else {
-            idBuilder.resolve(environment, new File(moduleFile.getName()).getName(), "rar");
+            idBuilder.resolve(environment, moduleFile.getRoot().getName(), "rar");
         }
 
         AbstractName moduleName;
@@ -259,7 +260,7 @@
         return new ConnectorModule(standAlone, moduleName, environment, moduleFile, targetPath, connector, gerConnector, specDD);
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws DeploymentException {
+    public void installModule(DeployableModule earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws DeploymentException {
         try {
             JarFile moduleFile = module.getModuleFile();
 

Modified: geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java (original)
+++ geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java Thu Aug 24 13:43:12 2006
@@ -27,6 +27,8 @@
     private String password;
     private boolean inPlace;
 
+    private String deployableModuleImplClass;
+
     public CommandContext(boolean logErrors,
             boolean verbose,
             String username,
@@ -85,5 +87,13 @@
 
     public void setInPlace(boolean inPlace) {
         this.inPlace = inPlace;
+    }
+
+    public String getDeployableModuleImplClass() {
+        return deployableModuleImplClass;
+    }
+
+    public void setDeployableModuleImplClass(String deployableModuleImplClass) {
+        this.deployableModuleImplClass = deployableModuleImplClass;
     }
 }

Modified: geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java (original)
+++ geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java Thu Aug 24 13:43:12 2006
@@ -240,6 +240,14 @@
         return command;
     }
 
+    public void setModuleConfigurationClass(String className) {
+        commandContext.setDeployableModuleImplClass(className);
+    }
+
+    public String getModuleConfigurationClass() {
+        return commandContext.getDeployableModuleImplClass();
+    }
+
     public Locale[] getSupportedLocales() {
         return new Locale[]{getDefaultLocale()};
     }

Modified: geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java (original)
+++ geronimo/server/branches/sachin/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java Thu Aug 24 13:43:12 2006
@@ -30,7 +30,6 @@
 import javax.enterprise.deploy.spi.Target;
 
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.Deployer;
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -41,7 +40,7 @@
  */
 public abstract class AbstractDeployCommand extends CommandSupport {
     protected final Kernel kernel;
-    private static final String[] DEPLOY_SIG = {boolean.class.getName(), File.class.getName(), File.class.getName(), String.class.getName()};
+    private static final String[] DEPLOY_SIG = {boolean.class.getName(), File.class.getName(), File.class.getName(), String.class.getName(), String.class.getName()};
     protected final boolean spool;
     protected File moduleArchive;
     protected File deploymentPlan;
@@ -102,7 +101,7 @@
     protected void doDeploy(Target target, boolean finished) throws Exception {
         File[] args = {moduleArchive, deploymentPlan};
         massageFileNames(args);
-        Object deployParams[] = new Object[] {Boolean.valueOf(commandContext.isInPlace()), args[0], args[1], target.getName()};
+        Object deployParams[] = new Object[] {Boolean.valueOf(commandContext.isInPlace()), args[0], args[1], target.getName(), commandContext.getDeployableModuleImplClass()};
         List objectNames = (List) kernel.invoke(deployer, "deploy", deployParams, DEPLOY_SIG);
         if (objectNames == null || objectNames.isEmpty()) {
             throw new DeploymentException("Server didn't deploy anything");

Modified: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java Thu Aug 24 13:43:12 2006
@@ -43,7 +43,7 @@
      * @return the deployment plan, or null if this builder can not handle the module
      * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
      */
-    Object getDeploymentPlan(File planFile, JarFile module, ModuleIDBuilder idBuilder) throws DeploymentException;
+    Object getDeploymentPlan(File planFile, DeployableModule module, ModuleIDBuilder idBuilder) throws DeploymentException;
 
     /**
      * Checks what configuration URL will be used for the provided module.
@@ -53,7 +53,7 @@
      * @throws IOException if there was a problem reading or writing the files
      * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
      */
-    Artifact getConfigurationID(Object plan, JarFile module, ModuleIDBuilder idBuilder) throws IOException, DeploymentException;
+    Artifact getConfigurationID(Object plan, DeployableModule module, ModuleIDBuilder idBuilder) throws IOException, DeploymentException;
 
     /**
      * Build a configuration from a local file
@@ -68,5 +68,5 @@
      * @throws IOException if there was a problem reading or writing the files
      * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
      */
-    DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, Object plan, JarFile module, Collection configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException;
+    DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, Object plan, DeployableModule module, Collection configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException;
 }

Added: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java?rev=434520&view=auto
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java (added)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java Thu Aug 24 13:43:12 2006
@@ -0,0 +1,67 @@
+package org.apache.geronimo.deployment;
+
+import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.util.NestedJarFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.jar.JarFile;
+import java.net.URL;
+
+/**
+ * @version
+ */
+public class DefaultDeployableModule implements DeployableModule {
+
+    private String uri;
+    private File root;
+    private JarFile jarFile;
+
+    public DefaultDeployableModule(File root, JarFile jarFile) {
+        this.uri = uri;
+        this.root = root;
+        this.jarFile = jarFile;
+    }
+
+    public String getURI() {
+        return uri;
+    }
+
+    public File getRoot() {
+        return root;
+    }
+
+    public File[] getModuleContextResources() {
+        return null;
+    }
+
+    public File[] getClassesFolders() {
+        return null;
+    }
+
+    public boolean isArchived() {
+        return root.isFile();
+    }
+
+    public DeployableModule[] getModules() {
+        return null;
+    }
+
+    public URL resolve(String path) throws IOException {
+        return DeploymentUtil.createJarURL(jarFile, path);
+    }
+
+    public DeployableModule resolveModule(String uri) throws IOException {
+        JarFile nestedJar = new NestedJarFile(jarFile, uri);
+        return DeployableModuleFactory.createDeployableModule(nestedJar);
+    }
+
+    public JarFile getJarFile() {
+        return jarFile;
+    }
+
+    public void cleanup() {
+        DeploymentUtil.close(jarFile);
+    }
+
+}

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DefaultDeployableModule.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java?rev=434520&view=auto
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java (added)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java Thu Aug 24 13:43:12 2006
@@ -0,0 +1,84 @@
+package org.apache.geronimo.deployment;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * @version 
+ */
+public interface DeployableModule {
+
+    /**
+	 * Returns the uri of the module, foo.ear, if a nested module then
+	 * foo.ear/foo.war
+     *
+     * //TODO GERONIMO-1526 Perhaps this should be getName() and use this method instead of getRoot().getName() in builders
+	 *
+	 * @return
+	 */
+	String getURI();
+
+	/**
+	 * Returns the root of the module, if isArchived then it return absolute
+	 * location of the archive, otherwise the root folder of the module.
+	 *
+	 * @return
+	 */
+	File getRoot();
+
+    /**
+	 * Returns the root folders for the resources in this module that should be
+	 * added to the module context. Returns an empty array if this is an
+	 * archived module.
+	 *
+	 * @return a possibly-empty array of resource folders
+	 */
+	File[] getModuleContextResources();
+
+	/**
+	 * returns all the URLs that contain .class files, if isArchive then this
+	 * would return an empty array
+	 *
+	 * @return
+	 */
+	File[] getClassesFolders();
+
+	/**
+	 * Returns true if this is an archived module. The archive can be a JarFile
+	 * or an exploded archive.
+	 *
+	 * @return boolean
+	 */
+	boolean isArchived();
+
+	/**
+	 * Returns all the child modules for this module. For an ear module, this
+	 * would return all of its contained j2ee modules and utility modules. For a
+	 * web module, it would return its WEB-INF/lib entries.
+	 *
+	 * @return a possibly empty array of modules contained within this module
+	 */
+	DeployableModule[] getModules();
+
+    /**
+     *
+     * @param path
+     * @return
+     */
+    URL resolve(String path) throws IOException;
+
+    /**
+     * 
+     * @param uri
+     * @return
+     * @throws IOException
+     */
+    DeployableModule resolveModule(String uri) throws IOException;
+
+    /**
+     * Peforms any cleanup on the instance, for a JarFile, would close it.
+     */
+    void cleanup();
+    
+}

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModule.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java?rev=434520&view=auto
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java (added)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java Thu Aug 24 13:43:12 2006
@@ -0,0 +1,32 @@
+package org.apache.geronimo.deployment;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.jar.JarFile;
+
+/**
+ * @version
+ */
+public class DeployableModuleFactory {
+
+    public static DeployableModule createDeployableModule(JarFile moduleFile) {
+       return new DefaultDeployableModule(null, moduleFile);
+    }
+
+    public static DeployableModule createDeployableModule(File moduleFile, String deployableModuleImplClass) throws DeploymentException {
+        if (deployableModuleImplClass == null) {
+            try {
+                JarFile jar = DeploymentUtil.createJarFile(moduleFile);
+                return new DefaultDeployableModule(moduleFile, jar);
+            } catch (IOException e) {
+                throw new DeploymentException("Cound not open module file: " + moduleFile.getAbsolutePath(), e);
+            }
+        } else {
+            //TODO 
+        }
+        return null;
+    }
+}

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/DeployableModuleFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java (original)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java Thu Aug 24 13:43:12 2006
@@ -30,7 +30,6 @@
 import java.util.Properties;
 import java.util.Set;
 import java.util.jar.Attributes;
-import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
 import javax.management.ObjectName;
@@ -97,10 +96,14 @@
     }
 
     public List deploy(boolean inPlace, File moduleFile, File planFile) throws DeploymentException {
-        return deploy(inPlace, moduleFile, planFile, null);
+        return deploy(inPlace, moduleFile, planFile, null, null);
     }
 
     public List deploy(boolean inPlace, File moduleFile, File planFile, String targetConfigStore) throws DeploymentException {
+        return deploy(inPlace, moduleFile, planFile, targetConfigStore, null);
+    }
+
+    public List deploy(boolean inPlace, File moduleFile, File planFile, String targetConfigStore, String deployableModuleImplClass) throws DeploymentException {
         File originalModuleFile = moduleFile;
         File tmpDir = null;
         if (moduleFile != null && !moduleFile.isDirectory()) {
@@ -121,7 +124,7 @@
         }
 
         try {
-            return deploy(inPlace, planFile, moduleFile, null, true, null, null, null, null, null, null, null, targetConfigStore);
+            return deploy(inPlace, planFile, moduleFile, null, true, null, null, null, null, null, null, null, targetConfigStore, deployableModuleImplClass);
         } catch (DeploymentException e) {
             log.debug("Deployment failed: plan=" + planFile + ", module=" + originalModuleFile, e);
             throw e.cleanse();
@@ -193,7 +196,8 @@
             String mainGBean, String mainMethod, String manifestConfigurations, String classPath,
             String endorsedDirs,
             String extensionDirs,
-            String targetConfigurationStore) throws DeploymentException {
+            String targetConfigurationStore,
+            String deployableModuleImplClass) throws DeploymentException {
         if (planFile == null && moduleFile == null) {
             throw new DeploymentException("No plan or module specified");
         }
@@ -207,7 +211,7 @@
             }
         }
 
-        JarFile module = null;
+        DeployableModule module = null;
         if (moduleFile != null) {
             if (inPlace && !moduleFile.isDirectory()) {
                 throw new DeploymentException("In place deployment is not allowed for packed module");
@@ -215,11 +219,7 @@
             if (!moduleFile.exists()) {
                 throw new DeploymentException("Module file does not exist: " + moduleFile.getAbsolutePath());
             }
-            try {
-                module = DeploymentUtil.createJarFile(moduleFile);
-            } catch (IOException e) {
-                throw new DeploymentException("Cound not open module file: " + moduleFile.getAbsolutePath(), e);
-            }
+            module = DeployableModuleFactory.createDeployableModule(moduleFile, deployableModuleImplClass);
         }
 
 //        File configurationDir = null;
@@ -384,7 +384,7 @@
             }
             throw new Error(e);
         } finally {
-            DeploymentUtil.close(module);
+            module.cleanup();
         }
     }
 

Modified: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/NamespaceDrivenBuilderCollection.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/NamespaceDrivenBuilderCollection.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/NamespaceDrivenBuilderCollection.java (original)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/NamespaceDrivenBuilderCollection.java Thu Aug 24 13:43:12 2006
@@ -30,7 +30,7 @@
 import org.apache.xmlbeans.XmlObject;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class NamespaceDrivenBuilderCollection {
 

Modified: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java (original)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java Thu Aug 24 13:43:12 2006
@@ -24,7 +24,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.LinkedList;
-import java.util.jar.JarFile;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -120,13 +119,7 @@
         }
 
         ModuleIDBuilder idBuilder = new ModuleIDBuilder();
-
-        JarFile module = null;
-        try {
-            module = DeploymentUtil.createJarFile(dir);
-        } catch (IOException e) {
-            throw new DeploymentException("Cound not open module file: " + dir.getAbsolutePath(), e);
-        }
+        DeployableModule module = DeployableModuleFactory.createDeployableModule(dir, null);
 
         try {
             // get the builder and plan
@@ -180,7 +173,7 @@
         } catch (Exception e) {
             throw new DeploymentException("Unable to deploy " + dir, e);
         } finally {
-            DeploymentUtil.close(module);
+            module.cleanup();
         }
 
     }
@@ -220,7 +213,7 @@
         return new Artifact(group, artifactId, version, type);
     }
 
-    private List deployConfiguration(ConfigurationBuilder builder, ConfigurationStore store, Artifact configurationId, Object plan, JarFile module, Collection stores, ArtifactResolver artifactResolver) throws DeploymentException {
+    private List deployConfiguration(ConfigurationBuilder builder, ConfigurationStore store, Artifact configurationId, Object plan, DeployableModule module, Collection stores, ArtifactResolver artifactResolver) throws DeploymentException {
         try {
             // It's our responsibility to close this context, once we're done with it...
             DeploymentContext context = builder.buildConfiguration(true, configurationId, plan, module, stores, artifactResolver, store);
@@ -265,7 +258,7 @@
             }
             throw new Error(e);
         } finally {
-            DeploymentUtil.close(module);
+            module.cleanup();
         }
     }
 

Modified: geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java (original)
+++ geronimo/server/branches/sachin/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java Thu Aug 24 13:43:12 2006
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.deployment.util;
 
+import org.apache.geronimo.deployment.DeployableModule;
+
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -97,8 +99,13 @@
         }
         out.flush();
     }
+
     public static File toTempFile(JarFile jarFile, String path) throws IOException {
         return toTempFile(createJarURL(jarFile, path));
+    }
+
+    public static File toTempFile(DeployableModule module, String path) throws IOException {
+        return toTempFile(module.resolve(path));
     }
 
     public static File toTempFile(URL url) throws IOException {

Modified: geronimo/server/branches/sachin/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original)
+++ geronimo/server/branches/sachin/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Thu Aug 24 13:43:12 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),

Modified: geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java (original)
+++ geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java Thu Aug 24 13:43:12 2006
@@ -23,6 +23,7 @@
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.DeployableModule;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -33,12 +34,12 @@
  */
 public class AppClientModule extends Module {
     private final Environment clientEnvironment;
-    private JarFile earFile;
+    private DeployableModule ear;
     private Collection resourceModules;
 
 
-    public AppClientModule(boolean standAlone, AbstractName moduleName, Environment serverEnvironment, Environment clientEnvironment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
-        super(standAlone, moduleName, serverEnvironment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null);
+    public AppClientModule(boolean standAlone, AbstractName moduleName, Environment serverEnvironment, Environment clientEnvironment, DeployableModule deployableModule, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+        super(standAlone, moduleName, serverEnvironment, deployableModule, targetPath, specDD, vendorDD, originalSpecDD, null);
         this.clientEnvironment = clientEnvironment;
     }
 
@@ -50,12 +51,12 @@
         return clientEnvironment;
     }
 
-    public JarFile getEarFile() {
-        return earFile;
+    public DeployableModule getEar() {
+        return ear;
     }
 
-    public void setEarFile(JarFile earFile) {
-        this.earFile = earFile;
+    public void setEar(DeployableModule ear) {
+        this.ear = ear;
     }
 
     public void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException {

Modified: geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java (original)
+++ geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java Thu Aug 24 13:43:12 2006
@@ -22,6 +22,7 @@
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.DeployableModule;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -31,8 +32,8 @@
  * @version $Rev$ $Date$
  */
 public class ConnectorModule extends Module {
-    public ConnectorModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
-        super(standAlone, moduleName, environment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null);
+    public ConnectorModule(boolean standAlone, AbstractName moduleName, Environment environment, DeployableModule deployableModule, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+        super(standAlone, moduleName, environment, deployableModule, targetPath, specDD, vendorDD, originalSpecDD, null);
     }
 
     public ConfigurationModuleType getType() {

Modified: geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Thu Aug 24 13:43:12 2006
@@ -41,11 +41,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.ConfigurationBuilder;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.deployment.ModuleIDBuilder;
-import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
-import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
+import org.apache.geronimo.deployment.*;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.util.NestedJarFile;
@@ -269,7 +265,7 @@
         return (ServiceReferenceBuilder) serviceReferenceBuilder.getElement();
     }
 
-    public Object getDeploymentPlan(File planFile, JarFile jarFile, ModuleIDBuilder idBuilder) throws DeploymentException {
+    public Object getDeploymentPlan(File planFile, DeployableModule jarFile, ModuleIDBuilder idBuilder) throws DeploymentException {
         if (planFile == null && jarFile == null) {
             return null;
         }
@@ -310,12 +306,12 @@
                 null);
     }
 
-    private ApplicationInfo getEarPlan(File planFile, JarFile earFile, ModuleIDBuilder idBuilder) throws DeploymentException {
+    private ApplicationInfo getEarPlan(File planFile, DeployableModule earFile, ModuleIDBuilder idBuilder) throws DeploymentException {
         String specDD;
         ApplicationType application = null;
         if (earFile != null) {
             try {
-                URL applicationXmlUrl = DeploymentUtil.createJarURL(earFile, "META-INF/application.xml");
+                URL applicationXmlUrl = earFile.resolve("META-INF/application.xml");
                 specDD = DeploymentUtil.readAll(applicationXmlUrl);
             } catch (Exception e) {
                 //no application.xml, not for us
@@ -342,7 +338,7 @@
                         return null;
                     }
                 } else {
-                    URL path = DeploymentUtil.createJarURL(earFile, "META-INF/geronimo-application.xml");
+                    URL path = earFile.resolve("META-INF/geronimo-application.xml");
                     rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                     gerApplication = (GerApplicationType) SchemaConversionUtils.fixGeronimoSchema(rawPlan, APPLICATION_QNAME, GerApplicationType.type);
                 }
@@ -360,7 +356,7 @@
 
         EnvironmentType environmentType = gerApplication.getEnvironment();
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
-        idBuilder.resolve(environment, earFile == null ? planFile.getName() : new File(earFile.getName()).getName(), "ear");
+        idBuilder.resolve(environment, earFile == null ? planFile.getName() : earFile.getRoot().getName(), "ear");
         // Make this EAR's settings the default for child modules
         idBuilder.setDefaultGroup(environment.getConfigId().getGroupId());
         idBuilder.setDefaultVersion(environment.getConfigId().getVersion());
@@ -403,7 +399,7 @@
     }
 
 
-    private GerApplicationType createDefaultPlan(ApplicationType application, JarFile module) {
+    private GerApplicationType createDefaultPlan(ApplicationType application, DeployableModule module) {
         // construct the empty geronimo-application.xml
         GerApplicationType gerApplication = GerApplicationType.Factory.newInstance();
         EnvironmentType environmentType = gerApplication.addNewEnvironment();
@@ -414,8 +410,7 @@
         // set the configId
         String id = application.getId();
         if (id == null) {
-            File fileName = new File(module.getName());
-            id = fileName.getName();
+            id = module.getRoot().getName();
             if (id.endsWith(".ear")) {
                 id = id.substring(0, id.length() - 4);
             }
@@ -430,7 +425,7 @@
         return gerApplication;
     }
 
-    public Artifact getConfigurationID(Object plan, JarFile module, ModuleIDBuilder idBuilder) throws IOException, DeploymentException {
+    public Artifact getConfigurationID(Object plan, DeployableModule module, ModuleIDBuilder idBuilder) throws IOException, DeploymentException {
         ApplicationInfo applicationInfo = (ApplicationInfo) plan;
         Artifact test = applicationInfo.getEnvironment().getConfigId();
         if(!test.isResolved()) {
@@ -439,7 +434,7 @@
         return test;
     }
 
-    public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, Object plan, JarFile earFile, Collection configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
+    public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, Object plan, DeployableModule earFile, Collection configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
         assert plan != null;
         ApplicationInfo applicationInfo = (ApplicationInfo) plan;
 
@@ -460,7 +455,7 @@
         try {
             // Create the output ear context
             earContext = new EARContext(configurationDir,
-                    inPlaceDeployment ? DeploymentUtil.toFile(earFile) : null,
+                    inPlaceDeployment && earFile.getRoot().isDirectory() ? earFile.getRoot() : null,
                     applicationInfo.getEnvironment(),
                     applicationType,
                     naming,
@@ -475,24 +470,29 @@
                     corbaGBeanObjectName,
                     new RefContext(getEjbReferenceBuilder(), getResourceReferenceBuilder(), getServiceReferenceBuilder()));
 
-            // Copy over all files that are _NOT_ modules (e.g. META-INF and APP-INF files)
-            Set moduleLocations = applicationInfo.getModuleLocations();
-            if (ConfigurationModuleType.EAR == applicationType && earFile != null) {
-                for (Enumeration e = earFile.entries(); e.hasMoreElements();) {
-                    ZipEntry entry = (ZipEntry) e.nextElement();
-                    String entryName = entry.getName();
-                    boolean addEntry = true;
-                    for (Iterator iter = moduleLocations.iterator(); iter.hasNext();) {
-                        String location = (String) iter.next();
-                        if (entryName.startsWith(location)) {
-                            addEntry = false;
-                            break;
+            if (earFile instanceof DefaultDeployableModule) {
+                JarFile jar = ((DefaultDeployableModule) earFile).getJarFile();
+                // Copy over all files that are _NOT_ modules (e.g. META-INF and APP-INF files)
+                Set moduleLocations = applicationInfo.getModuleLocations();
+                if (ConfigurationModuleType.EAR == applicationType && earFile != null) {
+                    for (Enumeration e = jar.entries(); e.hasMoreElements();) {
+                        ZipEntry entry = (ZipEntry) e.nextElement();
+                        String entryName = entry.getName();
+                        boolean addEntry = true;
+                        for (Iterator iter = moduleLocations.iterator(); iter.hasNext();) {
+                            String location = (String) iter.next();
+                            if (entryName.startsWith(location)) {
+                                addEntry = false;
+                                break;
+                            }
+                        }
+                        if (addEntry) {
+                            earContext.addFile(URI.create(entry.getName()), jar, entry);
                         }
-                    }
-                    if (addEntry) {
-                        earContext.addFile(URI.create(entry.getName()), earFile, entry);
                     }
                 }
+            } else {
+                //TODO GERONIMO-1526
             }
 
             GerApplicationType geronimoApplication = (GerApplicationType) applicationInfo.getVendorDD();
@@ -630,7 +630,7 @@
         return filter;
     }
 
-    private void addModules(JarFile earFile, ApplicationType application, GerApplicationType gerApplication, Set moduleLocations, LinkedHashSet modules, Environment environment, AbstractName earName, ModuleIDBuilder idBuilder) throws DeploymentException {
+    private void addModules(DeployableModule earFile, ApplicationType application, GerApplicationType gerApplication, Set moduleLocations, LinkedHashSet modules, Environment environment, AbstractName earName, ModuleIDBuilder idBuilder) throws DeploymentException {
         Map altVendorDDs = new HashMap();
         try {
             if (earFile != null) {
@@ -732,21 +732,21 @@
                     URL altSpecDD = null;
                     if (moduleXml.isSetAltDd()) {
                         try {
-                            altSpecDD = DeploymentUtil.createJarURL(earFile, moduleXml.getAltDd().getStringValue());
-                        } catch (MalformedURLException e) {
+                            altSpecDD = earFile.resolve(moduleXml.getAltDd().getStringValue());
+                        } catch (IOException e) {
                             throw new DeploymentException("Invalid alt sped dd url: " + moduleXml.getAltDd().getStringValue(), e);
                         }
                     }
 
-                    NestedJarFile moduleFile;
+                    DeployableModule childModule;
                     try {
-                        moduleFile = new NestedJarFile(earFile, modulePath);
+                        childModule = earFile.resolveModule(modulePath);
                     } catch (IOException e) {
                         throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                     }
 
                     Module module = builder.createModule(altVendorDDs.get(modulePath),
-                            moduleFile,
+                            childModule,
                             modulePath,
                             altSpecDD,
                             environment,
@@ -811,12 +811,11 @@
                 }
                 Object vendorDD = anys[0];
 
-                JarFile moduleFile;
+                DeployableModule deployable;
                 if (gerExtModule.isSetInternalPath()) {
                     String modulePath = gerExtModule.getInternalPath().trim();
-                    moduleLocations.add(modulePath);
                     try {
-                        moduleFile = new NestedJarFile(earFile, modulePath);
+                        deployable = earFile.resolveModule(modulePath);
                     } catch (IOException e) {
                         throw new DeploymentException("Invalid moduleFile: " + modulePath, e);
                     }
@@ -835,7 +834,8 @@
                         throw new DeploymentException(moduleTypeName + " is missing in repositories: " + path);
                     }
                     try {
-                        moduleFile = new JarFile(location);
+                        deployable = DeployableModuleFactory.createDeployableModule(location, null);
+                        new JarFile(location);
                     } catch (IOException e) {
                         throw new DeploymentException("Could not access contents of " + moduleTypeName, e);
                     }
@@ -855,7 +855,7 @@
 
 
                 Module module = builder.createModule(vendorDD,
-                        moduleFile,
+                        deployable,
                         moduleName,
                         altSpecDD,
                         environment,

Modified: geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java (original)
+++ geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java Thu Aug 24 13:43:12 2006
@@ -22,6 +22,7 @@
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.DeployableModule;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -33,8 +34,8 @@
 public class EJBModule extends Module {
     private AbstractName moduleCmpEngineName;
 
-    public EJBModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
-        super(standAlone, moduleName, environment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null);
+    public EJBModule(boolean standAlone, AbstractName moduleName, Environment environment, DeployableModule deployableModule, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+        super(standAlone, moduleName, environment, deployableModule, targetPath, specDD, vendorDD, originalSpecDD, null);
     }
 
     public ConfigurationModuleType getType() {

Modified: geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java Thu Aug 24 13:43:12 2006
@@ -27,6 +27,7 @@
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.DeployableModule;
 import org.apache.geronimo.gbean.AbstractName;
 
 /**
@@ -39,7 +40,7 @@
     private final String name;
     private final Environment environment;
     private final URI moduleURI;
-    private final JarFile moduleFile;
+    private final DeployableModule deployableModule;
     private final String targetPath;
     private final URI targetPathURI;
     private final XmlObject specDD;
@@ -51,14 +52,14 @@
 
     private URI uniqueModuleLocation;
 
-    protected Module(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String namespace) {
+    protected Module(boolean standAlone, AbstractName moduleName, Environment environment, DeployableModule deployableModule, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String namespace) {
         assert targetPath != null: "targetPath is null";
         assert moduleName != null: "moduleName is null";
 
         this.standAlone = standAlone;
         this.moduleName = moduleName;
         this.environment = environment;
-        this.moduleFile = moduleFile;
+        this.deployableModule = deployableModule;
         this.targetPath = targetPath;
         this.specDD = specDD;
         this.vendorDD = vendorDD;
@@ -98,8 +99,8 @@
         return moduleURI;
     }
 
-    public JarFile getModuleFile() {
-        return moduleFile;
+    public DeployableModule getModuleFile() {
+        return deployableModule;
     }
 
     public String getTargetPath() {
@@ -142,7 +143,7 @@
     }
 
     public void close() {
-        DeploymentUtil.close(moduleFile);
+        deployableModule.cleanup();
     }
 
     public void addClass(String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException {

Modified: geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=434520&r1=434517&r2=434520&view=diff
==============================================================================
--- geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java Thu Aug 24 13:43:12 2006
@@ -27,16 +27,17 @@
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.deployment.DeployableModule;
 
 /**
  * @version $Rev:386276 $ $Date$
  */
 public interface ModuleBuilder {
-    Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
+    Module createModule(File plan, DeployableModule moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
 
-    Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
+    Module createModule(Object plan, DeployableModule moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
 
-    void installModule(JarFile earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws DeploymentException;
+    void installModule(DeployableModule earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws DeploymentException;
 
     void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
 



Mime
View raw message