felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r824250 - /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Date Mon, 12 Oct 2009 07:33:26 GMT
Author: gnodet
Date: Mon Oct 12 07:33:26 2009
New Revision: 824250

URL: http://svn.apache.org/viewvc?rev=824250&view=rev
Log:
FELIX-1736: after a restart, fileinstall does not always properly uninstall bundles

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java?rev=824250&r1=824249&r2=824250&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Mon Oct 12 07:33:26 2009
@@ -699,6 +699,10 @@
         try
         {
             File path = artifact.getPath();
+            // Find a listener for this artifact if needed
+            if (artifact.getListener() == null) {
+                artifact.setListener(findListener(path, FileInstall.getListeners()));
+            }
             // Forget this artifact
             currentManagedArtifacts.remove(path);
             // Delete transformed file
@@ -709,7 +713,7 @@
                 ((ArtifactInstaller) artifact.getListener()).uninstall(path);
             }
             // else we need uninstall the bundle
-            else if (artifact.getListener() instanceof ArtifactTransformer)
+            else if (artifact.getBundleId() != 0)
             {
                 // old can't be null because of the way we calculate deleted list.
                 bundle = context.getBundle(artifact.getBundleId());
@@ -721,6 +725,7 @@
                         + ". The bundle has already been uninstalled", null);
                     return null;
                 }
+                log("Uninstalling bundle " + bundle.getBundleId() + " (" + bundle.getSymbolicName()
+ ")", null);
                 bundle.uninstall();
             }
             log("Uninstalled " + path, null);



Mime
View raw message