Add extra dependencies in one shot, using the Service.add(List) signature, in order to calculate state changes atomically

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1021383 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
index d924b2f..e177527 100644
--- a/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
+++ b/dependencymanager/runtime/src/main/java/org/apache/felix/dm/runtime/ServiceLifecycleHandler.java
@@ -212,8 +212,10 @@
                                    dependency, m_srvMeta);
                 Dependency d = depBuilder.build(m_bundle, dm, true);
                 m_namedDeps.add(d);
-                service.add(d);
             }
+            
+            // Add all extra dependencies in one shot, in order to calculate state changes for all dependencies at a time.
+            service.add(m_namedDeps);
         }
     }