incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1409783 - in /incubator/celix/trunk: dependency_manager/private/src/ dependency_manager/public/include/ device_access/device_access/private/src/ examples/echo_service/client/private/include/ examples/echo_service/client/private/src/ exampl...
Date Thu, 15 Nov 2012 13:54:33 GMT
Author: abroekhuis
Date: Thu Nov 15 13:54:30 2012
New Revision: 1409783

URL: http://svn.apache.org/viewvc?rev=1409783&view=rev
Log:
CELIX-27: added an ADT for the ServiceTrackerCustomizer.

Introduced an ADT for the ServiceTrackerCustomizer. Updated the ServiceTracker to use it correctly.
Also updated all usages of the customizer in the bundles.
Also renamed the types from UPPER_CASE to lower_case_t
* SERVICE_TRACKER now is service_tracker_t
* SERVICE_TRACKER_CUSTOMIZER now is service_tracker_customizer_t

Added:
    incubator/celix/trunk/framework/private/src/service_tracker_customizer.c
    incubator/celix/trunk/framework/public/include/service_tracker_customizer.h
Modified:
    incubator/celix/trunk/dependency_manager/private/src/service_dependency.c
    incubator/celix/trunk/dependency_manager/public/include/service_dependency.h
    incubator/celix/trunk/device_access/device_access/private/src/activator.c
    incubator/celix/trunk/examples/echo_service/client/private/include/echo_client_private.h
    incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c
    incubator/celix/trunk/examples/echo_service/client/private/src/echo_client_activator.c
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
    incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c
    incubator/celix/trunk/framework/private/src/service_tracker.c
    incubator/celix/trunk/framework/public/include/service_tracker.h
    incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c
    incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h
    incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h
    incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c
    incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
    incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c

Modified: incubator/celix/trunk/dependency_manager/private/src/service_dependency.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/dependency_manager/private/src/service_dependency.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/private/src/service_dependency.c (original)
+++ incubator/celix/trunk/dependency_manager/private/src/service_dependency.c Thu Nov 15 13:54:30
2012
@@ -70,19 +70,16 @@ void * serviceDependency_getService(SERV
 
 void serviceDependency_start(SERVICE_DEPENDENCY dependency, SERVICE service) {
 	dependency->service = service;
-
-	SERVICE_TRACKER_CUSTOMIZER cust = (SERVICE_TRACKER_CUSTOMIZER) malloc(sizeof(*cust));
-	cust->handle = dependency;
-	cust->addingService = serviceDependency_addingService;
-	cust->addedService = serviceDependency_addedService;
-	cust->modifiedService = serviceDependency_modifiedService;
-	cust->removedService = serviceDependency_removedService;
-
 	dependency->tracker = NULL;
 
 	apr_pool_t *pool;
 	bundleContext_getMemoryPool(dependency->context, &pool);
 
+	service_tracker_customizer_t cust = NULL;
+	serviceTrackerCustomizer_create(pool, dependency, serviceDependency_addingService,
+			serviceDependency_addedService, serviceDependency_modifiedService,
+			serviceDependency_removedService, &cust);
+
 	if (dependency->trackedServiceFilter != NULL) {
 		serviceTracker_createWithFilter(pool, dependency->context, dependency->trackedServiceFilter,
cust, &dependency->tracker);
 	} else if (dependency->trackedServiceName != NULL) {

Modified: incubator/celix/trunk/dependency_manager/public/include/service_dependency.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/dependency_manager/public/include/service_dependency.h?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/public/include/service_dependency.h (original)
+++ incubator/celix/trunk/dependency_manager/public/include/service_dependency.h Thu Nov 15
13:54:30 2012
@@ -42,7 +42,7 @@ struct serviceDependency {
 	bool started;
 	bool available;
 	bool required;
-	SERVICE_TRACKER tracker;
+	service_tracker_t tracker;
 	SERVICE service;
 	SERVICE_REFERENCE reference;
 	BUNDLE_CONTEXT context;

Modified: incubator/celix/trunk/device_access/device_access/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/private/src/activator.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/private/src/activator.c (original)
+++ incubator/celix/trunk/device_access/device_access/private/src/activator.c Thu Nov 15 13:54:30
2012
@@ -38,9 +38,9 @@ struct device_manager_bundle_instance {
 	BUNDLE_CONTEXT context;
 	apr_pool_t *pool;
 	device_manager_t deviceManager;
-	SERVICE_TRACKER driverLocatorTracker;
-	SERVICE_TRACKER driverTracker;
-	SERVICE_TRACKER deviceTracker;
+	service_tracker_t driverLocatorTracker;
+	service_tracker_t driverTracker;
+	service_tracker_t deviceTracker;
 };
 
 typedef struct device_manager_bundle_instance *device_manager_bundle_instance_t;
@@ -112,15 +112,14 @@ celix_status_t bundleActivator_start(voi
 
 static celix_status_t deviceManagerBundle_createDriverLocatorTracker(device_manager_bundle_instance_t
bundleData) {
 	celix_status_t status = CELIX_SUCCESS;
-	SERVICE_TRACKER_CUSTOMIZER customizer = apr_palloc(bundleData->pool, sizeof(struct serviceTrackerCustomizer));
-	if (customizer != NULL) {
-		customizer->handle=bundleData->deviceManager;
-		customizer->addingService=addingService_dummy_func;
-		customizer->addedService=deviceManager_locatorAdded;
-		customizer->modifiedService=deviceManager_locatorModified;
-		customizer->removedService=deviceManager_locatorRemoved;
 
-		SERVICE_TRACKER tracker = NULL;
+	service_tracker_customizer_t customizer = NULL;
+
+	status = serviceTrackerCustomizer_create(bundleData->pool, bundleData->deviceManager,
addingService_dummy_func,
+			deviceManager_locatorAdded, deviceManager_locatorModified, deviceManager_locatorRemoved,
&customizer);
+
+	if (status == CELIX_SUCCESS) {
+		service_tracker_t tracker = NULL;
 		status = serviceTracker_create(bundleData->pool, bundleData->context, "driver_locator",
customizer, &tracker);
 		if (status == CELIX_SUCCESS) {
 			bundleData->driverLocatorTracker=tracker;
@@ -133,15 +132,14 @@ static celix_status_t deviceManagerBundl
 
 static celix_status_t deviceManagerBundle_createDriverTracker(device_manager_bundle_instance_t
bundleData) {
 	celix_status_t status = CELIX_SUCCESS;
-	SERVICE_TRACKER_CUSTOMIZER customizer = apr_palloc(bundleData->pool, sizeof(struct serviceTrackerCustomizer));
-	if (customizer != NULL) {
-		customizer->handle=bundleData->deviceManager;
-		customizer->addingService=addingService_dummy_func;
-		customizer->addedService=deviceManager_driverAdded;
-		customizer->modifiedService=deviceManager_driverModified;
-		customizer->removedService=deviceManager_driverRemoved;
 
-		SERVICE_TRACKER tracker = NULL;
+	service_tracker_customizer_t customizer = NULL;
+
+	status = serviceTrackerCustomizer_create(bundleData->pool, bundleData->deviceManager,
addingService_dummy_func,
+			deviceManager_locatorAdded, deviceManager_locatorModified, deviceManager_locatorRemoved,
&customizer);
+
+	if (status == CELIX_SUCCESS) {
+		service_tracker_t tracker = NULL;
 		status = serviceTracker_createWithFilter(bundleData->pool, bundleData->context, "(objectClass=driver)",
customizer, &tracker);
 		if (status == CELIX_SUCCESS) {
 			bundleData->driverTracker=tracker;
@@ -154,15 +152,14 @@ static celix_status_t deviceManagerBundl
 
 static celix_status_t deviceManagerBundle_createDeviceTracker(device_manager_bundle_instance_t
bundleData) {
 	celix_status_t status = CELIX_SUCCESS;
-	SERVICE_TRACKER_CUSTOMIZER customizer = apr_palloc(bundleData->pool, sizeof(struct serviceTrackerCustomizer));
-	if (customizer != NULL) {
-		customizer->handle=bundleData->deviceManager;
-		customizer->addingService=addingService_dummy_func;
-		customizer->addedService= deviceManager_deviceAdded;
-		customizer->modifiedService=deviceManager_deviceModified;
-		customizer->removedService=deviceManager_deviceRemoved;
 
-		SERVICE_TRACKER tracker = NULL;
+	service_tracker_customizer_t customizer = NULL;
+
+	status = serviceTrackerCustomizer_create(bundleData->pool, bundleData->deviceManager,
addingService_dummy_func,
+			deviceManager_locatorAdded, deviceManager_locatorModified, deviceManager_locatorRemoved,
&customizer);
+
+	if (status == CELIX_SUCCESS) {
+		service_tracker_t tracker = NULL;
 		status = serviceTracker_createWithFilter(bundleData->pool, bundleData->context, "(|(objectClass=device)(DEVICE_CATEGORY=*))",
customizer, &tracker);
 		if (status == CELIX_SUCCESS) {
 			bundleData->deviceTracker=tracker;

Modified: incubator/celix/trunk/examples/echo_service/client/private/include/echo_client_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/echo_service/client/private/include/echo_client_private.h?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/examples/echo_service/client/private/include/echo_client_private.h
(original)
+++ incubator/celix/trunk/examples/echo_service/client/private/include/echo_client_private.h
Thu Nov 15 13:54:30 2012
@@ -31,7 +31,7 @@
 #include <pthread.h>
 
 struct echoClient {
-	SERVICE_TRACKER tracker;
+	service_tracker_t tracker;
 	bool running;
 
 	pthread_t sender;
@@ -39,7 +39,7 @@ struct echoClient {
 
 typedef struct echoClient * ECHO_CLIENT;
 
-ECHO_CLIENT echoClient_create(SERVICE_TRACKER context);
+ECHO_CLIENT echoClient_create(service_tracker_t context);
 
 void echoClient_start(ECHO_CLIENT client);
 void echoClient_stop(ECHO_CLIENT client);

Modified: incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c (original)
+++ incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c Thu Nov 15
13:54:30 2012
@@ -44,7 +44,7 @@ void * trk_send(void * handle) {
 	return NULL;
 }
 
-ECHO_CLIENT echoClient_create(SERVICE_TRACKER echoServiceTracker) {
+ECHO_CLIENT echoClient_create(service_tracker_t echoServiceTracker) {
 	ECHO_CLIENT client = malloc(sizeof(*client));
 
 	client->tracker = echoServiceTracker;

Modified: incubator/celix/trunk/examples/echo_service/client/private/src/echo_client_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/echo_service/client/private/src/echo_client_activator.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/examples/echo_service/client/private/src/echo_client_activator.c
(original)
+++ incubator/celix/trunk/examples/echo_service/client/private/src/echo_client_activator.c
Thu Nov 15 13:54:30 2012
@@ -34,7 +34,7 @@
 
 struct echoActivator {
 	ECHO_CLIENT client;
-	SERVICE_TRACKER tracker;
+	service_tracker_t tracker;
 };
 
 celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData) {
@@ -51,7 +51,7 @@ celix_status_t bundleActivator_start(voi
 	struct echoActivator * act = (struct echoActivator *) userData;
 
 	apr_pool_t *pool = NULL;
-	SERVICE_TRACKER tracker = NULL;
+	service_tracker_t tracker = NULL;
 
 	bundleContext_getMemoryPool(context, &pool);
 	serviceTracker_create(pool, context, ECHO_SERVICE_NAME, NULL, &tracker);

Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
(original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
Thu Nov 15 13:54:30 2012
@@ -41,7 +41,7 @@
 struct paintFrameActivatorData {
 	SERVICE_REGISTRATION reg;
 	apr_pool_t *pool;
-	SERVICE_TRACKER tracker;
+	service_tracker_t tracker;
 	BUNDLE_CONTEXT context;
 	PAINT_FRAME paint_frame;
 };
@@ -55,7 +55,7 @@ typedef struct paintFrameActivatorData *
 celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData) {
 	apr_pool_t *pool;
 	GREETING_ACTIVATOR activator;
-	SERVICE_TRACKER_CUSTOMIZER cust;
+	service_tracker_customizer_t cust;
 	printf("Paint_frame create\n");
 	celix_status_t status = bundleContext_getMemoryPool(context, &pool);
 	if (status == CELIX_SUCCESS) {
@@ -66,12 +66,10 @@ celix_status_t bundleActivator_create(BU
 		activator->context = context;
 		activator->paint_frame = NULL;
 		status = paintFrame_create(context, pool, &activator->paint_frame);
-        cust = (SERVICE_TRACKER_CUSTOMIZER) apr_palloc(pool, sizeof(*cust));
-        cust->handle = activator;
-        cust->addedService = addedServ;
-        cust->addingService = addingServ;
-        cust->modifiedService = modifiedServ;
-        cust->removedService = removedServ;
+
+		serviceTrackerCustomizer_create(pool, activator, addingServ,
+				addedServ, modifiedServ, removedServ, &cust);
+
         serviceTracker_create(pool, context, SIMPLE_SHAPE_SERVICE_NAME, cust, &activator->tracker);
 		serviceTracker_open(activator->tracker);
 

Modified: incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c Thu Nov 15 13:54:30
2012
@@ -35,7 +35,7 @@
 
 struct data {
 	BUNDLE_CONTEXT context;
-	SERVICE_TRACKER tracker;
+	service_tracker_t tracker;
 	ARRAY_LIST publishers;
 	pthread_t sender;
 	bool running;
@@ -105,13 +105,16 @@ celix_status_t bundleActivator_start(voi
         struct data * data = (struct data *) userData;
         data->context = context;
 
-        SERVICE_TRACKER_CUSTOMIZER cust = (SERVICE_TRACKER_CUSTOMIZER) apr_palloc(pool, sizeof(*cust));
-        cust->handle = data;
-        cust->addedService = addedServ;
-        cust->addingService = addingServ;
-        cust->modifiedService = modifiedServ;
-        cust->removedService = removedServ;
-        SERVICE_TRACKER tracker = NULL;
+//        service_tracker_customizer_t cust = (service_tracker_customizer_t) apr_palloc(pool,
sizeof(*cust));
+//        cust->handle = data;
+//        cust->addedService = addedServ;
+//        cust->addingService = addingServ;
+//        cust->modifiedService = modifiedServ;
+//        cust->removedService = removedServ;
+        service_tracker_customizer_t cust = NULL;
+        serviceTrackerCustomizer_create(pool, data, addingServ, addedServ, modifiedServ,
removedServ, &cust);
+
+        service_tracker_t tracker = NULL;
         serviceTracker_create(pool, context, (char *) PUBLISHER_NAME, cust, &tracker);
         data->tracker = tracker;
 

Modified: incubator/celix/trunk/framework/private/src/service_tracker.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_tracker.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_tracker.c (original)
+++ incubator/celix/trunk/framework/private/src/service_tracker.c Thu Nov 15 13:54:30 2012
@@ -39,8 +39,8 @@ struct serviceTracker {
 	char * filter;
 
 	apr_pool_t *pool;
-	SERVICE_TRACKER tracker;
-	SERVICE_TRACKER_CUSTOMIZER customizer;
+	service_tracker_t tracker;
+	service_tracker_customizer_t customizer;
 	SERVICE_LISTENER listener;
 	ARRAY_LIST tracked;
 };
@@ -53,11 +53,11 @@ struct tracked {
 typedef struct tracked * TRACKED;
 
 static apr_status_t serviceTracker_destroy(void *trackerP);
-static void * serviceTracker_addingService(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference);
-static celix_status_t serviceTracker_track(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference,
SERVICE_EVENT event);
-static celix_status_t serviceTracker_untrack(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference,
SERVICE_EVENT event);
+static void * serviceTracker_addingService(service_tracker_t tracker, SERVICE_REFERENCE reference);
+static celix_status_t serviceTracker_track(service_tracker_t tracker, SERVICE_REFERENCE reference,
SERVICE_EVENT event);
+static celix_status_t serviceTracker_untrack(service_tracker_t tracker, SERVICE_REFERENCE
reference, SERVICE_EVENT event);
 
-celix_status_t serviceTracker_create(apr_pool_t *pool, BUNDLE_CONTEXT context, char * service,
SERVICE_TRACKER_CUSTOMIZER customizer, SERVICE_TRACKER *tracker) {
+celix_status_t serviceTracker_create(apr_pool_t *pool, BUNDLE_CONTEXT context, char * service,
service_tracker_customizer_t customizer, service_tracker_t *tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (service == NULL || *tracker != NULL) {
@@ -78,10 +78,10 @@ celix_status_t serviceTracker_create(apr
 	return status;
 }
 
-celix_status_t serviceTracker_createWithFilter(apr_pool_t *pool, BUNDLE_CONTEXT context,
char * filter, SERVICE_TRACKER_CUSTOMIZER customizer, SERVICE_TRACKER *tracker) {
+celix_status_t serviceTracker_createWithFilter(apr_pool_t *pool, BUNDLE_CONTEXT context,
char * filter, service_tracker_customizer_t customizer, service_tracker_t *tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
-	*tracker = (SERVICE_TRACKER) apr_palloc(pool, sizeof(**tracker));
+	*tracker = (service_tracker_t) apr_palloc(pool, sizeof(**tracker));
 	if (!*tracker) {
 		status = CELIX_ENOMEM;
 	} else {
@@ -102,14 +102,14 @@ celix_status_t serviceTracker_createWith
 }
 
 apr_status_t serviceTracker_destroy(void *trackerP) {
-	SERVICE_TRACKER tracker = trackerP;
+	service_tracker_t tracker = trackerP;
 	bundleContext_removeServiceListener(tracker->context, tracker->listener);
 	arrayList_destroy(tracker->tracked);
 
 	return APR_SUCCESS;
 }
 
-celix_status_t serviceTracker_open(SERVICE_TRACKER tracker) {
+celix_status_t serviceTracker_open(service_tracker_t tracker) {
 	SERVICE_LISTENER listener;
 	ARRAY_LIST initial = NULL;
 	celix_status_t status = CELIX_SUCCESS;
@@ -141,7 +141,7 @@ celix_status_t serviceTracker_open(SERVI
 	return status;
 }
 
-celix_status_t serviceTracker_close(SERVICE_TRACKER tracker) {
+celix_status_t serviceTracker_close(service_tracker_t tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	status = bundleContext_removeServiceListener(tracker->context, tracker->listener);
@@ -160,7 +160,7 @@ celix_status_t serviceTracker_close(SERV
 	return status;
 }
 
-SERVICE_REFERENCE serviceTracker_getServiceReference(SERVICE_TRACKER tracker) {
+SERVICE_REFERENCE serviceTracker_getServiceReference(service_tracker_t tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	for (i = 0; i < arrayList_size(tracker->tracked); i++) {
@@ -170,7 +170,7 @@ SERVICE_REFERENCE serviceTracker_getServ
 	return NULL;
 }
 
-ARRAY_LIST serviceTracker_getServiceReferences(SERVICE_TRACKER tracker) {
+ARRAY_LIST serviceTracker_getServiceReferences(service_tracker_t tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	int size = arrayList_size(tracker->tracked);
@@ -184,7 +184,7 @@ ARRAY_LIST serviceTracker_getServiceRefe
 	return references;
 }
 
-void *serviceTracker_getService(SERVICE_TRACKER tracker) {
+void *serviceTracker_getService(service_tracker_t tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	for (i = 0; i < arrayList_size(tracker->tracked); i++) {
@@ -194,7 +194,7 @@ void *serviceTracker_getService(SERVICE_
 	return NULL;
 }
 
-ARRAY_LIST serviceTracker_getServices(SERVICE_TRACKER tracker) {
+ARRAY_LIST serviceTracker_getServices(service_tracker_t tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	int size = arrayList_size(tracker->tracked);
@@ -208,7 +208,7 @@ ARRAY_LIST serviceTracker_getServices(SE
 	return references;
 }
 
-void *serviceTracker_getServiceByReference(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference)
{
+void *serviceTracker_getServiceByReference(service_tracker_t tracker, SERVICE_REFERENCE reference)
{
 	TRACKED tracked;
 	unsigned int i;
 	for (i = 0; i < arrayList_size(tracker->tracked); i++) {
@@ -223,7 +223,7 @@ void *serviceTracker_getServiceByReferen
 }
 
 void serviceTracker_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event) {
-	SERVICE_TRACKER tracker = listener->handle;
+	service_tracker_t tracker = listener->handle;
 	switch (event->type) {
 		case REGISTERED:
 		case MODIFIED:
@@ -237,7 +237,7 @@ void serviceTracker_serviceChanged(SERVI
 	}
 }
 
-celix_status_t serviceTracker_track(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference,
SERVICE_EVENT event) {
+celix_status_t serviceTracker_track(service_tracker_t tracker, SERVICE_REFERENCE reference,
SERVICE_EVENT event) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	TRACKED tracked = NULL;
@@ -261,24 +261,42 @@ celix_status_t serviceTracker_track(SERV
 			tracked->service = service;
 			arrayList_add(tracker->tracked, tracked);
 			if (tracker->customizer != NULL) {
-				tracker->customizer->addedService(tracker->customizer->handle, reference,
service);
+				void *handle = NULL;
+				addedCallback function = NULL;
+
+				serviceTrackerCustomizer_getHandle(tracker->customizer, &handle);
+				serviceTrackerCustomizer_getAddedFunction(tracker->customizer, &function);
+
+				function(handle, reference, service);
 			}
 		}
 
 	} else {
 		if (tracker->customizer != NULL) {
-			tracker->customizer->modifiedService(tracker->customizer->handle, reference,
tracked->service);
+			void *handle = NULL;
+			modifiedCallback function = NULL;
+
+			serviceTrackerCustomizer_getHandle(tracker->customizer, &handle);
+			serviceTrackerCustomizer_getModifiedFunction(tracker->customizer, &function);
+
+			function(handle, reference, tracked->service);
 		}
 	}
 
 	return status;
 }
 
-void * serviceTracker_addingService(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference)
{
+void * serviceTracker_addingService(service_tracker_t tracker, SERVICE_REFERENCE reference)
{
     void *svc = NULL;
 
     if (tracker->customizer != NULL) {
-    	tracker->customizer->addingService(tracker->customizer->handle, reference,
&svc);
+    	void *handle = NULL;
+		addingCallback function = NULL;
+
+		serviceTrackerCustomizer_getHandle(tracker->customizer, &handle);
+		serviceTrackerCustomizer_getAddingFunction(tracker->customizer, &function);
+
+		function(handle, reference, &svc);
 	} else {
 		bundleContext_getService(tracker->context, reference, &svc);
 	}
@@ -286,7 +304,7 @@ void * serviceTracker_addingService(SERV
     return svc;
 }
 
-celix_status_t serviceTracker_untrack(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference,
SERVICE_EVENT event) {
+celix_status_t serviceTracker_untrack(service_tracker_t tracker, SERVICE_REFERENCE reference,
SERVICE_EVENT event) {
 	celix_status_t status = CELIX_SUCCESS;
 	TRACKED tracked = NULL;
 	unsigned int i;
@@ -303,7 +321,13 @@ celix_status_t serviceTracker_untrack(SE
 			}
 			if (status == CELIX_SUCCESS) {
 				if (tracker->customizer != NULL) {
-					tracker->customizer->removedService(tracker->customizer->handle, reference,
tracked->service);
+					void *handle = NULL;
+					removedCallback function = NULL;
+
+					serviceTrackerCustomizer_getHandle(tracker->customizer, &handle);
+					serviceTrackerCustomizer_getRemovedFunction(tracker->customizer, &function);
+
+					function(handle, reference, tracked->service);
 				} else {
 					status = bundleContext_ungetService(tracker->tracker->context, reference, &result);
 				}

Added: incubator/celix/trunk/framework/private/src/service_tracker_customizer.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_tracker_customizer.c?rev=1409783&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_tracker_customizer.c (added)
+++ incubator/celix/trunk/framework/private/src/service_tracker_customizer.c Thu Nov 15 13:54:30
2012
@@ -0,0 +1,118 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/*
+ * service_tracker_customizer.c
+ *
+ *  \date       Nov 15, 2012
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project
Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+
+#include <stdlib.h>
+
+#include "service_reference.h"
+
+#include "service_tracker_customizer.h"
+
+static apr_status_t serviceTrackerCustomizer_destroy(void *customizerPointer);
+
+struct serviceTrackerCustomizer {
+	void * handle;
+	celix_status_t (*addingService)(void * handle, SERVICE_REFERENCE reference, void **service);
+	celix_status_t (*addedService)(void * handle, SERVICE_REFERENCE reference, void * service);
+	celix_status_t (*modifiedService)(void * handle, SERVICE_REFERENCE reference, void * service);
+	celix_status_t (*removedService)(void * handle, SERVICE_REFERENCE reference, void * service);
+};
+
+celix_status_t serviceTrackerCustomizer_create(apr_pool_t *pool, void *handle,
+		addingCallback addingFunction, addedCallback addedFunction,
+		modifiedCallback modifiedFunction, removedCallback removedFunction, service_tracker_customizer_t
*customizer) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	if (pool == NULL || handle == NULL || *customizer != NULL) {
+		status = CELIX_ILLEGAL_ARGUMENT;
+	} else {
+		*customizer = apr_palloc(pool, sizeof(**customizer));
+		if (!*customizer) {
+			status = CELIX_ENOMEM;
+		} else {
+			apr_pool_pre_cleanup_register(pool, *customizer, serviceTrackerCustomizer_destroy);
+
+			(*customizer)->handle = handle;
+			(*customizer)->addingService = addingFunction;
+			(*customizer)->addedService = addedFunction;
+			(*customizer)->modifiedService = modifiedFunction;
+			(*customizer)->removedService = removedFunction;
+		}
+	}
+
+	return status;
+}
+
+static apr_status_t serviceTrackerCustomizer_destroy(void *customizerPointer) {
+	service_tracker_customizer_t customizer = (service_tracker_customizer_t) customizerPointer;
+
+	customizer->handle = NULL;
+	customizer->addingService = NULL;
+	customizer->addedService = NULL;
+	customizer->modifiedService = NULL;
+	customizer->removedService = NULL;
+
+	return APR_SUCCESS;
+}
+
+celix_status_t serviceTrackerCustomizer_getHandle(service_tracker_customizer_t customizer,
void **handle) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	*handle = customizer->handle;
+
+	return status;
+}
+
+celix_status_t serviceTrackerCustomizer_getAddingFunction(service_tracker_customizer_t customizer,
addingCallback *function) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	*function = customizer->addingService;
+
+	return status;
+}
+
+celix_status_t serviceTrackerCustomizer_getAddedFunction(service_tracker_customizer_t customizer,
addedCallback *function) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	*function = customizer->addedService;
+
+	return status;
+}
+
+celix_status_t serviceTrackerCustomizer_getModifiedFunction(service_tracker_customizer_t
customizer, modifiedCallback *function) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	*function = customizer->modifiedService;
+
+	return status;
+}
+
+celix_status_t serviceTrackerCustomizer_getRemovedFunction(service_tracker_customizer_t customizer,
removedCallback *function) {
+	celix_status_t status = CELIX_SUCCESS;
+
+	*function = customizer->removedService;
+
+	return status;
+}

Modified: incubator/celix/trunk/framework/public/include/service_tracker.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_tracker.h?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/service_tracker.h (original)
+++ incubator/celix/trunk/framework/public/include/service_tracker.h Thu Nov 15 13:54:30 2012
@@ -30,31 +30,22 @@
 #include "service_listener.h"
 #include "array_list.h"
 #include "bundle_context.h"
+#include "service_tracker_customizer.h"
 
-struct serviceTrackerCustomizer {
-	void * handle;
-	celix_status_t (*addingService)(void * handle, SERVICE_REFERENCE reference, void **service);
-	celix_status_t (*addedService)(void * handle, SERVICE_REFERENCE reference, void * service);
-	celix_status_t (*modifiedService)(void * handle, SERVICE_REFERENCE reference, void * service);
-	celix_status_t (*removedService)(void * handle, SERVICE_REFERENCE reference, void * service);
-};
-
-typedef struct serviceTrackerCustomizer * SERVICE_TRACKER_CUSTOMIZER;
-
-typedef struct serviceTracker * SERVICE_TRACKER;
-
-celix_status_t serviceTracker_create(apr_pool_t *pool, BUNDLE_CONTEXT context, char * service,
SERVICE_TRACKER_CUSTOMIZER customizer, SERVICE_TRACKER *tracker);
-celix_status_t serviceTracker_createWithFilter(apr_pool_t *pool, BUNDLE_CONTEXT context,
char * filter, SERVICE_TRACKER_CUSTOMIZER customizer, SERVICE_TRACKER *tracker);
-
-celix_status_t serviceTracker_open(SERVICE_TRACKER tracker);
-celix_status_t serviceTracker_close(SERVICE_TRACKER tracker);
-
-SERVICE_REFERENCE serviceTracker_getServiceReference(SERVICE_TRACKER tracker);
-ARRAY_LIST serviceTracker_getServiceReferences(SERVICE_TRACKER tracker);
-
-void * serviceTracker_getService(SERVICE_TRACKER tracker);
-ARRAY_LIST serviceTracker_getServices(SERVICE_TRACKER tracker);
-void * serviceTracker_getServiceByReference(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference);
+typedef struct serviceTracker * service_tracker_t;
+
+celix_status_t serviceTracker_create(apr_pool_t *pool, BUNDLE_CONTEXT context, char * service,
service_tracker_customizer_t customizer, service_tracker_t *tracker);
+celix_status_t serviceTracker_createWithFilter(apr_pool_t *pool, BUNDLE_CONTEXT context,
char * filter, service_tracker_customizer_t customizer, service_tracker_t *tracker);
+
+celix_status_t serviceTracker_open(service_tracker_t tracker);
+celix_status_t serviceTracker_close(service_tracker_t tracker);
+
+SERVICE_REFERENCE serviceTracker_getServiceReference(service_tracker_t tracker);
+ARRAY_LIST serviceTracker_getServiceReferences(service_tracker_t tracker);
+
+void * serviceTracker_getService(service_tracker_t tracker);
+ARRAY_LIST serviceTracker_getServices(service_tracker_t tracker);
+void * serviceTracker_getServiceByReference(service_tracker_t tracker, SERVICE_REFERENCE
reference);
 
 void serviceTracker_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event);
 

Added: incubator/celix/trunk/framework/public/include/service_tracker_customizer.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/service_tracker_customizer.h?rev=1409783&view=auto
==============================================================================
--- incubator/celix/trunk/framework/public/include/service_tracker_customizer.h (added)
+++ incubator/celix/trunk/framework/public/include/service_tracker_customizer.h Thu Nov 15
13:54:30 2012
@@ -0,0 +1,53 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/*
+ * service_tracker_customizer.h
+ *
+ *  \date       Nov 15, 2012
+ *  \author     <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project
Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
+
+
+#ifndef service_tracker_customizer_t_H_
+#define service_tracker_customizer_t_H_
+
+#include <apr_general.h>
+
+#include "celix_errno.h"
+
+typedef celix_status_t (*addingCallback)(void *handle, SERVICE_REFERENCE reference, void
**service);
+typedef celix_status_t (*addedCallback)(void * handle, SERVICE_REFERENCE reference, void
* service);
+typedef celix_status_t (*modifiedCallback)(void * handle, SERVICE_REFERENCE reference, void
* service);
+typedef celix_status_t (*removedCallback)(void * handle, SERVICE_REFERENCE reference, void
* service);
+
+typedef struct serviceTrackerCustomizer *service_tracker_customizer_t;
+
+celix_status_t serviceTrackerCustomizer_create(apr_pool_t *pool, void *handle,
+		addingCallback addingFunction, addedCallback addedFunction,
+		modifiedCallback modifiedFunction, removedCallback removedFunction,
+		service_tracker_customizer_t *customizer);
+
+celix_status_t serviceTrackerCustomizer_getHandle(service_tracker_customizer_t customizer,
void **handle);
+celix_status_t serviceTrackerCustomizer_getAddingFunction(service_tracker_customizer_t customizer,
addingCallback *function);
+celix_status_t serviceTrackerCustomizer_getAddedFunction(service_tracker_customizer_t customizer,
addedCallback *function);
+celix_status_t serviceTrackerCustomizer_getModifiedFunction(service_tracker_customizer_t
customizer, modifiedCallback *function);
+celix_status_t serviceTrackerCustomizer_getRemovedFunction(service_tracker_customizer_t customizer,
removedCallback *function);
+
+#endif /* service_tracker_customizer_t_H_ */

Modified: incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c (original)
+++ incubator/celix/trunk/remote_services/discovery/private/src/discovery_activator.c Thu
Nov 15 13:54:30 2012
@@ -45,11 +45,11 @@ struct activator {
 
 	discovery_t discovery;
 
-	SERVICE_TRACKER endpointListenerTracker;
+	service_tracker_t endpointListenerTracker;
 	SERVICE_REGISTRATION endpointListenerService;
 };
 
-celix_status_t discoveryActivator_createEPLTracker(struct activator *activator, SERVICE_TRACKER
*tracker);
+celix_status_t discoveryActivator_createEPLTracker(struct activator *activator, service_tracker_t
*tracker);
 celix_status_t discoveryActivator_getUUID(struct activator *activator, char **uuidStr);
 
 celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData) {
@@ -78,20 +78,16 @@ celix_status_t bundleActivator_create(BU
 	return status;
 }
 
-celix_status_t discoveryActivator_createEPLTracker(struct activator *activator, SERVICE_TRACKER
*tracker) {
+celix_status_t discoveryActivator_createEPLTracker(struct activator *activator,  service_tracker_t
*tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
-	SERVICE_TRACKER_CUSTOMIZER custumizer = (SERVICE_TRACKER_CUSTOMIZER) apr_palloc(activator->pool,
sizeof(*custumizer));
-	if (!custumizer) {
-		status = CELIX_ENOMEM;
-	} else {
-		custumizer->handle = activator->discovery;
-		custumizer->addingService = discovery_endpointListenerAdding;
-		custumizer->addedService = discovery_endpointListenerAdded;
-		custumizer->modifiedService = discovery_endpointListenerModified;
-		custumizer->removedService = discovery_endpointListenerRemoved;
+	service_tracker_customizer_t customizer = NULL;
 
-		status = serviceTracker_create(activator->pool, activator->context, "endpoint_listener",
custumizer, tracker);
+	status = serviceTrackerCustomizer_create(activator->pool, activator->discovery, discovery_endpointListenerAdding,
+			discovery_endpointListenerAdded, discovery_endpointListenerModified, discovery_endpointListenerRemoved,
&customizer);
+
+	if (status == CELIX_SUCCESS) {
+		status = serviceTracker_create(activator->pool, activator->context, "endpoint_listener",
customizer, tracker);
 
 		serviceTracker_open(activator->endpointListenerTracker);
 	}

Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h
(original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h
Thu Nov 15 13:54:30 2012
@@ -38,8 +38,8 @@ struct export_registration {
 	endpoint_description_t endpointDescription;
 	SERVICE_REFERENCE reference;
 
-	SERVICE_TRACKER tracker;
-	SERVICE_TRACKER endpointTracker;
+	service_tracker_t tracker;
+	service_tracker_t endpointTracker;
 
 	remote_endpoint_service_t endpoint;
 

Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h
(original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h
Thu Nov 15 13:54:30 2012
@@ -37,7 +37,7 @@ struct import_registration {
 	remote_service_admin_t rsa;
 	endpoint_description_t endpointDescription;
 
-	SERVICE_TRACKER proxyTracker;
+	service_tracker_t proxyTracker;
 
 	SERVICE_REFERENCE reference;
 	remote_proxy_service_t proxy;

Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c
(original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c
Thu Nov 15 13:54:30 2012
@@ -42,7 +42,7 @@ celix_status_t exportRegistration_endpoi
 celix_status_t exportRegistration_endpointModified(void * handle, SERVICE_REFERENCE reference,
void *service);
 celix_status_t exportRegistration_endpointRemoved(void * handle, SERVICE_REFERENCE reference,
void *service);
 
-celix_status_t exportRegistration_createEndpointTracker(export_registration_t registration,
SERVICE_TRACKER *tracker);
+celix_status_t exportRegistration_createEndpointTracker(export_registration_t registration,
service_tracker_t *tracker);
 
 celix_status_t exportRegistration_create(apr_pool_t *pool, SERVICE_REFERENCE reference, endpoint_description_t
endpoint, remote_service_admin_t rsa, BUNDLE_CONTEXT context, export_registration_t *registration)
{
 	celix_status_t status = CELIX_SUCCESS;
@@ -101,20 +101,16 @@ celix_status_t exportRegistration_stopTr
 	return status;
 }
 
-celix_status_t exportRegistration_createEndpointTracker(export_registration_t registration,
SERVICE_TRACKER *tracker) {
+celix_status_t exportRegistration_createEndpointTracker(export_registration_t registration,
service_tracker_t *tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
-	SERVICE_TRACKER_CUSTOMIZER custumizer = (SERVICE_TRACKER_CUSTOMIZER) apr_palloc(registration->pool,
sizeof(*custumizer));
-	if (!custumizer) {
-		status = CELIX_ENOMEM;
-	} else {
-		custumizer->handle = registration;
-		custumizer->addingService = exportRegistration_endpointAdding;
-		custumizer->addedService = exportRegistration_endpointAdded;
-		custumizer->modifiedService = exportRegistration_endpointModified;
-		custumizer->removedService = exportRegistration_endpointRemoved;
+	service_tracker_customizer_t customizer = NULL;
 
-		status = serviceTracker_create(registration->pool, registration->context, REMOTE_ENDPOINT,
custumizer, tracker);
+	status = serviceTrackerCustomizer_create(registration->pool, registration, exportRegistration_endpointAdding,
+			exportRegistration_endpointAdded, exportRegistration_endpointModified, exportRegistration_endpointRemoved,
&customizer);
+
+	if (status == CELIX_SUCCESS) {
+		status = serviceTracker_create(registration->pool, registration->context, REMOTE_ENDPOINT,
customizer, tracker);
 	}
 
 	return status;

Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
(original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/src/import_registration_impl.c
Thu Nov 15 13:54:30 2012
@@ -44,7 +44,7 @@ celix_status_t importRegistration_proxyA
 celix_status_t importRegistration_proxyModified(void * handle, SERVICE_REFERENCE reference,
void *service);
 celix_status_t importRegistration_proxyRemoved(void * handle, SERVICE_REFERENCE reference,
void *service);
 
-celix_status_t importRegistration_createProxyTracker(import_registration_t registration,
SERVICE_TRACKER *tracker);
+celix_status_t importRegistration_createProxyTracker(import_registration_t registration,
service_tracker_t *tracker);
 
 celix_status_t importRegistration_create(apr_pool_t *pool, endpoint_description_t endpoint,
remote_service_admin_t rsa, BUNDLE_CONTEXT context, import_registration_t *registration) {
 	celix_status_t status = CELIX_SUCCESS;
@@ -91,22 +91,18 @@ celix_status_t importRegistration_stopTr
 	return status;
 }
 
-celix_status_t importRegistration_createProxyTracker(import_registration_t registration,
SERVICE_TRACKER *tracker) {
+celix_status_t importRegistration_createProxyTracker(import_registration_t registration,
service_tracker_t *tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
-	SERVICE_TRACKER_CUSTOMIZER custumizer = (SERVICE_TRACKER_CUSTOMIZER) apr_palloc(registration->pool,
sizeof(*custumizer));
-	if (!custumizer) {
-		status = CELIX_ENOMEM;
-	} else {
-		custumizer->handle = registration;
-		custumizer->addingService = importRegistration_proxyAdding;
-		custumizer->addedService = importRegistration_proxyAdded;
-		custumizer->modifiedService = importRegistration_proxyModified;
-		custumizer->removedService = importRegistration_proxyRemoved;
+	service_tracker_customizer_t customizer = NULL;
 
+	status = serviceTrackerCustomizer_create(registration->pool, registration, importRegistration_proxyAdding,
+			importRegistration_proxyAdded, importRegistration_proxyModified, importRegistration_proxyRemoved,
&customizer);
+
+	if (status == CELIX_SUCCESS) {
 		char *filter = apr_pstrcat(registration->pool, "(&(", OBJECTCLASS, "=", REMOTE_PROXY,
 				")(proxy.interface=", registration->endpointDescription->service, "))", NULL);
-		status = serviceTracker_createWithFilter(registration->pool, registration->context,
filter, custumizer, tracker);
+		status = serviceTracker_createWithFilter(registration->pool, registration->context,
filter, customizer, tracker);
 	}
 
 	return status;

Modified: incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c?rev=1409783&r1=1409782&r2=1409783&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c (original)
+++ incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c Thu Nov
15 13:54:30 2012
@@ -47,14 +47,14 @@ struct activator {
 
 	topology_manager_t manager;
 
-	SERVICE_TRACKER remoteServiceAdminTracker;
+	service_tracker_t remoteServiceAdminTracker;
 	SERVICE_LISTENER serviceListener;
 
 	SERVICE_REGISTRATION endpointListenerService;
 	SERVICE_REGISTRATION hook;
 };
 
-static celix_status_t bundleActivator_createRSATracker(struct activator *activator, SERVICE_TRACKER
*tracker);
+static celix_status_t bundleActivator_createRSATracker(struct activator *activator, service_tracker_t
*tracker);
 static celix_status_t bundleActivator_createServiceListener(struct activator *activator,
SERVICE_LISTENER *listener);
 
 celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData) {
@@ -95,20 +95,16 @@ celix_status_t bundleActivator_create(BU
 	return status;
 }
 
-static celix_status_t bundleActivator_createRSATracker(struct activator *activator, SERVICE_TRACKER
*tracker) {
+static celix_status_t bundleActivator_createRSATracker(struct activator *activator, service_tracker_t
*tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
-	SERVICE_TRACKER_CUSTOMIZER custumizer = (SERVICE_TRACKER_CUSTOMIZER) apr_palloc(activator->pool,
sizeof(*custumizer));
-	if (!custumizer) {
-		status = CELIX_ENOMEM;
-	} else {
-		custumizer->handle = activator->manager;
-		custumizer->addingService = topologyManager_rsaAdding;
-		custumizer->addedService = topologyManager_rsaAdded;
-		custumizer->modifiedService = topologyManager_rsaModified;
-		custumizer->removedService = topologyManager_rsaRemoved;
+	service_tracker_customizer_t customizer = NULL;
+
+	status = serviceTrackerCustomizer_create(activator->pool, activator->manager, topologyManager_rsaAdding,
+			topologyManager_rsaAdded, topologyManager_rsaModified, topologyManager_rsaRemoved, &customizer);
 
-		status = serviceTracker_create(activator->pool, activator->context, "remote_service_admin",
custumizer, tracker);
+	if (status == CELIX_SUCCESS) {
+		status = serviceTracker_create(activator->pool, activator->context, "remote_service_admin",
customizer, tracker);
 	}
 
 	return status;



Mime
View raw message