celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [39/50] [abbrv] celix git commit: CELIX-381: Invokeset now called after suspend for dependency in a dm component.
Date Tue, 18 Oct 2016 19:26:41 GMT
CELIX-381: Invokeset now called after suspend for dependency in a dm component.


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

Branch: refs/heads/release/celix-2.0.0
Commit: 210f87c2109bdcbe3450b81ded2af780098900de
Parents: 2489419
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Sat Oct 15 17:14:56 2016 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Sat Oct 15 17:14:56 2016 +0200

----------------------------------------------------------------------
 .../private/src/dm_component_impl.c             | 20 +++++++++++---------
 .../phase2a/private/src/phase2a_cmp.c           |  2 +-
 .../phase2b/private/src/phase2b_cmp.c           |  2 +-
 .../dm_example/phase3/private/src/phase3_cmp.c  |  2 +-
 4 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/210f87c2/dependency_manager/private/src/dm_component_impl.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_component_impl.c b/dependency_manager/private/src/dm_component_impl.c
index 5b5c0ca..27db3a5 100644
--- a/dependency_manager/private/src/dm_component_impl.c
+++ b/dependency_manager/private/src/dm_component_impl.c
@@ -468,9 +468,9 @@ celix_status_t component_handleAdded(dm_component_pt component, dm_service_depen
 
     serviceDependency_setAvailable(dependency, true);
 
-    serviceDependency_invokeSet(dependency, event);
     switch (component->state) {
         case DM_CMP_STATE_WAITING_FOR_REQUIRED: {
+            serviceDependency_invokeSet(dependency, event);
             bool required = false;
             serviceDependency_isRequired(dependency, &required);
             if (required) {
@@ -485,6 +485,7 @@ celix_status_t component_handleAdded(dm_component_pt component, dm_service_depen
             serviceDependency_isRequired(dependency, &required);
             if (!instanceBound) {
                 if (required) {
+                    serviceDependency_invokeSet(dependency, event);
                     serviceDependency_invokeAdd(dependency, event);
                 }
                 dm_event_pt event = NULL;
@@ -498,9 +499,10 @@ celix_status_t component_handleAdded(dm_component_pt component, dm_service_depen
             break;
         }
         case DM_CMP_STATE_TRACKING_OPTIONAL:
-		component_suspend(component,dependency);
+		    component_suspend(component,dependency);
+            serviceDependency_invokeSet(dependency, event);
             serviceDependency_invokeAdd(dependency, event);
-		component_resume(component,dependency);
+		    component_resume(component,dependency);
             dm_event_pt event = NULL;
             component_getDependencyEvent(component, dependency, &event);
             component_updateInstance(component, dependency, event, false, true);
@@ -529,9 +531,9 @@ celix_status_t component_handleChanged(dm_component_pt component, dm_service_dep
         serviceDependency_invokeSet(dependency, event);
         switch (component->state) {
             case DM_CMP_STATE_TRACKING_OPTIONAL:
-			component_suspend(component,dependency);
+			    component_suspend(component,dependency);
                 serviceDependency_invokeChange(dependency, event);
-			component_resume(component,dependency);
+			    component_resume(component,dependency);
                 dm_event_pt hevent = NULL;
                 component_getDependencyEvent(component, dependency, &hevent);
                 component_updateInstance(component, dependency, hevent, true, false);
@@ -598,10 +600,10 @@ celix_status_t component_handleRemoved(dm_component_pt component, dm_service_dep
                 break;
             }
             case DM_CMP_STATE_TRACKING_OPTIONAL:
-			component_suspend(component,dependency);
+			    component_suspend(component,dependency);
                 serviceDependency_invokeSet(dependency, event);
                 serviceDependency_invokeRemove(dependency, event);
-			component_resume(component,dependency);
+			    component_resume(component,dependency);
                 dm_event_pt hevent = NULL;
                 component_getDependencyEvent(component, dependency, &hevent);
                 component_updateInstance(component, dependency, hevent, false, false);
@@ -651,9 +653,9 @@ celix_status_t component_handleSwapped(dm_component_pt component, dm_service_dep
                 break;
             }
             case DM_CMP_STATE_TRACKING_OPTIONAL:
-			component_suspend(component,dependency);
+			    component_suspend(component,dependency);
                 serviceDependency_invokeSwap(dependency, event, newEvent);
-			component_resume(component,dependency);
+			    component_resume(component,dependency);
                 break;
             default:
                 break;

http://git-wip-us.apache.org/repos/asf/celix/blob/210f87c2/examples/dm_example/phase2a/private/src/phase2a_cmp.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2a/private/src/phase2a_cmp.c b/examples/dm_example/phase2a/private/src/phase2a_cmp.c
index 3d04196..e0b1cc8 100644
--- a/examples/dm_example/phase2a/private/src/phase2a_cmp.c
+++ b/examples/dm_example/phase2a/private/src/phase2a_cmp.c
@@ -74,7 +74,7 @@ int phase2a_stop(phase2a_cmp_t *cmp) {
 }
 
 int phase2a_deinit(phase2a_cmp_t *cmp) {
-    printf("deinit phase1\n");
+    printf("deinit phase2a\n");
     return 0;
 }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/210f87c2/examples/dm_example/phase2b/private/src/phase2b_cmp.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2b/private/src/phase2b_cmp.c b/examples/dm_example/phase2b/private/src/phase2b_cmp.c
index 4c86f42..ccaa94d 100644
--- a/examples/dm_example/phase2b/private/src/phase2b_cmp.c
+++ b/examples/dm_example/phase2b/private/src/phase2b_cmp.c
@@ -74,7 +74,7 @@ int phase2b_stop(phase2b_cmp_t *cmp) {
 }
 
 int phase2b_deinit(phase2b_cmp_t *cmp) {
-    printf("deinit phase1\n");
+    printf("deinit phase2b\n");
     return 0;
 }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/210f87c2/examples/dm_example/phase3/private/src/phase3_cmp.c
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase3/private/src/phase3_cmp.c b/examples/dm_example/phase3/private/src/phase3_cmp.c
index 0d421c8..47cb720 100644
--- a/examples/dm_example/phase3/private/src/phase3_cmp.c
+++ b/examples/dm_example/phase3/private/src/phase3_cmp.c
@@ -74,7 +74,7 @@ int phase3_stop(phase3_cmp_t *cmp) {
 }
 
 int phase3_deinit(phase3_cmp_t *cmp) {
-    printf("deinit phase1\n");
+    printf("deinit phase3\n");
     return 0;
 }
 


Mime
View raw message