geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1339470 - /geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java
Date Thu, 17 May 2012 03:55:44 GMT
Author: gawor
Date: Thu May 17 03:55:43 2012
New Revision: 1339470

URL: http://svn.apache.org/viewvc?rev=1339470&view=rev
Log:
for ebas, let equinox have its own copy of the bundles to prevent strange ZipErors when eba
is updated

Modified:
    geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java

Modified: geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java?rev=1339470&r1=1339469&r2=1339470&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java
(original)
+++ geronimo/server/branches/3.0-beta/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/GeronimoApplication.java
Thu May 17 03:55:43 2012
@@ -64,13 +64,10 @@ public class GeronimoApplication impleme
 
         bundleInfo = new HashSet<BundleInfo>();
 
-        boolean bundleInfoCollected = false;
         File bundleFile = BundleUtils.toFile(bundle);
         if (bundleFile != null && bundleFile.isDirectory()) {
             collectFileSystemBasedBundleInfos(bundleFile, applicationFactory);
-            bundleInfoCollected = true;
-        }
-        if (!bundleInfoCollected) {
+        } else {
             collectBundleEntryBasedBundleInfos(bundle, applicationFactory);
         }
 
@@ -113,11 +110,18 @@ public class GeronimoApplication impleme
     private void collectFileSystemBasedBundleInfos(File baseDir, ApplicationMetadataFactory
applicationFactory) throws IOException {
         for (File file : baseDir.listFiles()) {
             if (file.isDirectory()) {
+                collectFileSystemBasedBundleInfos(file, applicationFactory);
                 continue;
             }
             BundleManifest bm = BundleManifest.fromBundle(file);
             if (bm != null && bm.isValid()) {
-                bundleInfo.add(new SimpleBundleInfo(applicationFactory, bm, BundleUtils.toReferenceFileLocation(file)));
+                /*
+                 * Pass file:// url instead of reference:file:// as bundle location to make
sure
+                 * Equinox has its own copy of the jar. That is, to prevent strange ZipErrors
when
+                 * application bundles are updated at runtime, specifically, when 
+                 * ApplicationGBean.hotSwapApplicationContent() is called.
+                 */
+                bundleInfo.add(new SimpleBundleInfo(applicationFactory, bm, file.toURI().toString()));
             }
         }
     }



Mime
View raw message