geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r880885 - /geronimo/plugins/tuscany/trunk/geronimo-tuscany/src/main/java/org/apache/geronimo/tuscany/TuscanyModuleBuilderExtension.java
Date Mon, 16 Nov 2009 18:17:05 GMT
Author: vamsic007
Date: Mon Nov 16 18:17:04 2009
New Revision: 880885

URL: http://svn.apache.org/viewvc?rev=880885&view=rev
Log:
Eliminated the hack used to model implemntation.web and implementation.ejb components.

Modified:
    geronimo/plugins/tuscany/trunk/geronimo-tuscany/src/main/java/org/apache/geronimo/tuscany/TuscanyModuleBuilderExtension.java

Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany/src/main/java/org/apache/geronimo/tuscany/TuscanyModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/geronimo-tuscany/src/main/java/org/apache/geronimo/tuscany/TuscanyModuleBuilderExtension.java?rev=880885&r1=880884&r2=880885&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/geronimo-tuscany/src/main/java/org/apache/geronimo/tuscany/TuscanyModuleBuilderExtension.java
(original)
+++ geronimo/plugins/tuscany/trunk/geronimo-tuscany/src/main/java/org/apache/geronimo/tuscany/TuscanyModuleBuilderExtension.java
Mon Nov 16 18:17:04 2009
@@ -33,9 +33,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
-import java.util.jar.JarInputStream;
 import java.util.jar.JarOutputStream;
 import java.util.zip.ZipEntry;
 
@@ -217,44 +215,6 @@
         data.setReferencePattern("embeddedSCADomainRef", embeddedSCADomainQuery);
         data.setReferencePattern("Repository", new AbstractNameQuery(Repository.class.getName()));
 
-        // FIXME: Eliminate this hack.
-        // HACK: Create a JAR file with web.composite and web.componentType files
-        // place it as META-INF/application-composite.jar to deploy to the SCA domain
-        File webCompositeFile = new File(earContext.getBaseDir(), (module.isStandAlone()
? "" : module.getName()+"/")+"WEB-INF/web.composite");
-        File webComponentTypeFile = new File(earContext.getBaseDir(), (module.isStandAlone()
? "" : module.getName()+"/")+"WEB-INF/web.componentType");
-        File appCompositeJarFile = new File(earContext.getBaseDir(), "META-INF/"+(module.isStandAlone()
? "" : module.getName()+"/")+"application-composite.jar");
-        JarOutputStream jarOut = null;
-        FileInputStream fin = null;
-        try {
-            appCompositeJarFile.getParentFile().mkdirs();
-            jarOut = new JarOutputStream(new FileOutputStream(appCompositeJarFile));
-            if(webCompositeFile.exists()) {
-                fin = new FileInputStream(webCompositeFile);
-                jarOut.putNextEntry(new ZipEntry("web.composite"));
-                int b;
-                while((b = fin.read()) != -1) {
-                    jarOut.write(b);
-                }
-                jarOut.closeEntry();
-                IOUtil.close(fin);
-            }
-            if(webComponentTypeFile.exists()) {
-                fin = new FileInputStream(webComponentTypeFile);
-                jarOut.putNextEntry(new ZipEntry("web.componentType"));
-                int b;
-                while((b = fin.read()) != -1) {
-                    jarOut.write(b);
-                }
-                jarOut.closeEntry();
-            }
-        } catch (Exception e) {
-            throw new DeploymentException(e);
-        } finally {
-            IOUtil.close(fin);
-            IOUtil.close(jarOut);
-        }
-        
-        //data.setAttribute("jarFileName", "META-INF/"+(module.isStandAlone() ? "" : module.getName()+"/")+"application-composite.jar");
         // Copy the module file to META-INF
         File tempModuleFile = new File(module.getModuleFile().getName());
         File tempModuleFileSave = new File(earContext.getBaseDir(), "META-INF/"+tempModuleFile.getName());
@@ -500,40 +460,6 @@
         // HACK: Create a JAR file with ejb-jar.composite and other componentType files.
         // Place it as META-INF/application-composite.jar to deploy to the SCA domain
         File ejbJarFile = new File(earContext.getBaseDir(), module.isStandAlone() ? "ejb.jar"
: module.getName());
-        File appCompositeJarFile = new File(earContext.getBaseDir(), "META-INF/"+(module.isStandAlone()
? "" : module.getName()+"/")+"application-composite.jar");
-        JarOutputStream jarOut = null;
-        JarInputStream jin = null;
-        try {
-            jin = new JarInputStream(new FileInputStream(ejbJarFile));
-            appCompositeJarFile.getParentFile().mkdirs();
-            jarOut = new JarOutputStream(new FileOutputStream(appCompositeJarFile));
-            JarEntry entry;
-            while((entry = jin.getNextJarEntry()) != null) { 
-                if(entry.getName().equalsIgnoreCase("META-INF/ejb-jar.composite")) {
-                    jarOut.putNextEntry(new ZipEntry("ejb-jar.composite"));
-                    int b;
-                    while((b = jin.read()) != -1) {
-                        jarOut.write(b);
-                    }
-                    jarOut.closeEntry();
-                } else if(entry.getName().toUpperCase().startsWith("META-INF/") &&
entry.getName().toUpperCase().endsWith(".COMPONENTTYPE")) {
-                    jarOut.putNextEntry(new ZipEntry(entry.getName().substring(9)));
-                    int b;
-                    while((b = jin.read()) != -1) {
-                        jarOut.write(b);
-                    }
-                    jarOut.closeEntry();
-                }
-            }
-        } catch (Exception e) {
-            throw new DeploymentException(e);
-        } finally {
-            IOUtil.close(jin);
-            IOUtil.close(jarOut);
-        }
-        
-        // Do not use the hack.  Point to ejb.jar file.
-        //data.setAttribute("jarFileName", "META-INF/"+(module.isStandAlone() ? "" : module.getName()+"/")+"application-composite.jar");
         data.setAttribute("jarFileName", "ejb.jar");
         try {
             earContext.addGBean(data);
@@ -545,7 +471,6 @@
         Map<String, String> ejb2component = new HashMap<String, String>();
         Map<String, Component> name2component = new HashMap<String, Component>();
         ModelResolverImpl modelResolver = new ModelResolverImpl(cl);
-        appCompositeJarFile = ejbJarFile;
         try {
             Contribution contribution = null;
             ClassLoader oldCl = Thread.currentThread().getContextClassLoader();



Mime
View raw message