Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x abb33dc84 -> 9e615f000


[KARAF-4723] Make sure satisfied activators are started synchronously

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

Branch: refs/heads/karaf-4.0.x
Commit: 9e615f0007a29d012d6d35bbf63672d4f053463e
Parents: abb33dc
Author: Guillaume Nodet <gno...@apache.org>
Authored: Thu Sep 22 12:06:52 2016 +0200
Committer: Guillaume Nodet <gno...@apache.org>
Committed: Thu Sep 22 12:11:57 2016 +0200

----------------------------------------------------------------------
 .../org/apache/karaf/util/tracker/BaseActivator.java    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/9e615f00/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java
----------------------------------------------------------------------
diff --git 
a/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java 
b/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java
index 7063e2e..96949e8 100644
--- a/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java
+++ b/util/src/main/java/org/apache/karaf/util/tracker/BaseActivator.java
@@ -71,7 +71,17 @@ public class BaseActivator implements BundleActivator, 
SingleServiceTracker.Sing
         scheduled.set(true);
         doOpen();
         scheduled.set(false);
-        if (managedServiceRegistration == null && trackers.isEmpty()) {
+        boolean doStart = false;
+        if (managedServiceRegistration == null) {
+            doStart = true;
+            for (SingleServiceTracker s : trackers.values()) {
+                if (s.getService() == null) {
+                    doStart = false;
+                    break;
+                }
+            }
+        }
+        if (doStart) {
             try {
                 doStart();
             } catch (Exception e) {

Reply via email to