celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1669090 - in /celix/trunk/dependency_manager_2: private/include/dm_component_impl.h private/src/dm_component_impl.c public/include/dm_component.h
Date Wed, 25 Mar 2015 10:39:20 GMT
Author: abroekhuis
Date: Wed Mar 25 10:39:19 2015
New Revision: 1669090

URL: http://svn.apache.org/r1669090
Log:
Updated service registration for DM.

Modified:
    celix/trunk/dependency_manager_2/private/include/dm_component_impl.h
    celix/trunk/dependency_manager_2/private/src/dm_component_impl.c
    celix/trunk/dependency_manager_2/public/include/dm_component.h

Modified: celix/trunk/dependency_manager_2/private/include/dm_component_impl.h
URL: http://svn.apache.org/viewvc/celix/trunk/dependency_manager_2/private/include/dm_component_impl.h?rev=1669090&r1=1669089&r2=1669090&view=diff
==============================================================================
--- celix/trunk/dependency_manager_2/private/include/dm_component_impl.h (original)
+++ celix/trunk/dependency_manager_2/private/include/dm_component_impl.h Wed Mar 25 10:39:19
2015
@@ -47,6 +47,7 @@ struct dm_component {
     dm_dependency_manager_pt manager;
 
     char *serviceName;
+    void *service;
     void *implementation;
     properties_pt properties;
     service_registration_pt registration;

Modified: celix/trunk/dependency_manager_2/private/src/dm_component_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/dependency_manager_2/private/src/dm_component_impl.c?rev=1669090&r1=1669089&r2=1669090&view=diff
==============================================================================
--- celix/trunk/dependency_manager_2/private/src/dm_component_impl.c (original)
+++ celix/trunk/dependency_manager_2/private/src/dm_component_impl.c Wed Mar 25 10:39:19 2015
@@ -102,6 +102,7 @@ celix_status_t component_create(bundle_c
         (*component)->manager = manager;
 
         (*component)->serviceName = NULL;
+        (*component)->service = NULL;
         (*component)->implementation = NULL;
         (*component)->properties = NULL;
         (*component)->registration = NULL;
@@ -167,8 +168,8 @@ celix_status_t component_addServiceDepen
 
     va_end(dependencies);
 
-//	executor_executeTask(component->executor, component, component_addTask, dependenciesList);
-    component_addTask(component, dependenciesList);
+	executor_executeTask(component->executor, component, component_addTask, dependenciesList);
+//    component_addTask(component, dependenciesList);
 
     return status;
 }
@@ -208,8 +209,8 @@ celix_status_t component_addTask(dm_comp
 celix_status_t component_removeServiceDependency(dm_component_pt component, dm_service_dependency_pt
dependency) {
     celix_status_t status = CELIX_SUCCESS;
 
-//    executor_executeTask(component->executor, component, component_removeTask, dependency);
-    component_removeTask(component, dependency);
+    executor_executeTask(component->executor, component, component_removeTask, dependency);
+//    component_removeTask(component, dependency);
 
     return status;
 }
@@ -243,8 +244,8 @@ celix_status_t component_start(dm_compon
     celix_status_t status = CELIX_SUCCESS;
 
     component->active = true;
-//    executor_executeTask(component->executor, component, component_startTask, NULL);
-    component_startTask(component, NULL);
+    executor_executeTask(component->executor, component, component_startTask, NULL);
+//    component_startTask(component, NULL);
 
     return status;
 }
@@ -262,8 +263,8 @@ celix_status_t component_stop(dm_compone
     celix_status_t status = CELIX_SUCCESS;
 
     component->active = false;
-//    executor_executeTask(component->executor, component, component_stopTask, NULL);
-    component_stopTask(component, NULL);
+    executor_executeTask(component->executor, component, component_stopTask, NULL);
+//    component_stopTask(component, NULL);
 
     return status;
 }
@@ -278,13 +279,14 @@ celix_status_t component_stopTask(dm_com
     return status;
 }
 
-celix_status_t component_setInterface(dm_component_pt component, char *serviceName, properties_pt
properties) {
+celix_status_t component_setInterface(dm_component_pt component, char *serviceName, void
*service, properties_pt properties) {
     celix_status_t status = CELIX_SUCCESS;
 
     if (component->active) {
         return CELIX_ILLEGAL_STATE;
     } else {
         component->serviceName = serviceName;
+        component->service = service;
         component->properties = properties;
     }
 
@@ -299,8 +301,8 @@ celix_status_t component_handleEvent(dm_
 	data->event = event;
 	data->newEvent = NULL;
 
-//	status = executor_executeTask(component->executor, component, component_handleEventTask,
data);
-	component_handleEventTask(component, data);
+	status = executor_executeTask(component->executor, component, component_handleEventTask,
data);
+//	component_handleEventTask(component, data);
 
 	return status;
 }
@@ -1070,7 +1072,7 @@ celix_status_t component_registerService
     celix_status_t status = CELIX_SUCCESS;
 
     if (component->context && component->serviceName) {
-        bundleContext_registerService(component->context, component->serviceName, component->implementation,
component->properties, &component->registration);
+        bundleContext_registerService(component->context, component->serviceName, component->service,
component->properties, &component->registration);
     }
 
     return status;

Modified: celix/trunk/dependency_manager_2/public/include/dm_component.h
URL: http://svn.apache.org/viewvc/celix/trunk/dependency_manager_2/public/include/dm_component.h?rev=1669090&r1=1669089&r2=1669090&view=diff
==============================================================================
--- celix/trunk/dependency_manager_2/public/include/dm_component.h (original)
+++ celix/trunk/dependency_manager_2/public/include/dm_component.h Wed Mar 25 10:39:19 2015
@@ -43,7 +43,7 @@ typedef celix_status_t (*destroy_fpt)(vo
 celix_status_t component_create(bundle_context_pt context, dm_dependency_manager_pt manager,
dm_component_pt *component);
 celix_status_t component_destroy(dm_component_pt *component);
 
-celix_status_t component_setInterface(dm_component_pt component, char *serviceName, properties_pt
properties);
+celix_status_t component_setInterface(dm_component_pt component, char *serviceName, void
*service, properties_pt properties);
 celix_status_t component_setImplementation(dm_component_pt component, void *implementation);
 
 celix_status_t component_addServiceDependency(dm_component_pt component, ...);



Mime
View raw message