You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/02/21 11:12:39 UTC

[2/2] git commit: [KARAF-2774] Watched bundles are restarted twice

[KARAF-2774] Watched bundles are restarted twice


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/d9b2a27c
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/d9b2a27c
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/d9b2a27c

Branch: refs/heads/master
Commit: d9b2a27cb5b942a0ea9be01e07a8b007bf6f9003
Parents: bf97e9f
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Fri Feb 21 11:11:34 2014 +0100
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Fri Feb 21 11:12:33 2014 +0100

----------------------------------------------------------------------
 .../apache/karaf/bundle/core/internal/BundleWatcherImpl.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/d9b2a27c/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleWatcherImpl.java
----------------------------------------------------------------------
diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleWatcherImpl.java b/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleWatcherImpl.java
index e62a04b..925e3ba 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleWatcherImpl.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/core/internal/BundleWatcherImpl.java
@@ -121,6 +121,13 @@ public class BundleWatcherImpl implements Runnable, BundleListener, BundleWatche
                 } catch (InterruptedException e) {
                     running.set(false);
                 }
+                for (Bundle bundle : updated) {
+                    try {
+                        bundle.start(Bundle.START_TRANSIENT);
+                    } catch (BundleException ex) {
+                        logger.warn("Error starting bundle", ex);
+                    }
+                }
             }
             try {
                 Thread.sleep(interval);
@@ -142,6 +149,7 @@ public class BundleWatcherImpl implements Runnable, BundleListener, BundleWatche
             try {
                 logger.info("[Watch] Updating watched bundle: " + bundle.getSymbolicName() + " ("
                             + bundle.getVersion() + ")");
+                bundle.stop(Bundle.STOP_TRANSIENT);
                 bundle.update(is);
                 updated.add(bundle);
             } finally {