incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1245336 - in /incubator/celix/trunk: dependency_manager/service_dependency.c examples/echo_service/client/echo_client.c framework/private/src/service_tracker.c framework/public/include/service_tracker.h
Date Fri, 17 Feb 2012 07:36:20 GMT
Author: abroekhuis
Date: Fri Feb 17 07:36:19 2012
New Revision: 1245336

URL: http://svn.apache.org/viewvc?rev=1245336&view=rev
Log:
Service tracker

Renamed several functions to be conform the code styleguide.

Modified:
    incubator/celix/trunk/dependency_manager/service_dependency.c
    incubator/celix/trunk/examples/echo_service/client/echo_client.c
    incubator/celix/trunk/framework/private/src/service_tracker.c
    incubator/celix/trunk/framework/public/include/service_tracker.h

Modified: incubator/celix/trunk/dependency_manager/service_dependency.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/dependency_manager/service_dependency.c?rev=1245336&r1=1245335&r2=1245336&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/service_dependency.c (original)
+++ incubator/celix/trunk/dependency_manager/service_dependency.c Fri Feb 17 07:36:19 2012
@@ -62,7 +62,7 @@ SERVICE_DEPENDENCY serviceDependency_cre
 void * serviceDependency_getService(SERVICE_DEPENDENCY dependency) {
 	void * service = NULL;
 	if (dependency->started) {
-		service = tracker_getService(dependency->tracker);
+		service = serviceTracker_getService(dependency->tracker);
 	}
 	return service;
 }
@@ -140,7 +140,7 @@ celix_status_t serviceDependency_modifie
 
 celix_status_t serviceDependency_removedService(void * handle, SERVICE_REFERENCE reference,
void * service) {
 	SERVICE_DEPENDENCY dependency = (SERVICE_DEPENDENCY) handle;
-	if (dependency->available && tracker_getService(dependency->tracker) == NULL)
{
+	if (dependency->available && serviceTracker_getService(dependency->tracker)
== NULL) {
 		dependency->available = false;
 		serviceComponent_dependencyUnavailable(dependency->service, dependency);
 	}

Modified: incubator/celix/trunk/examples/echo_service/client/echo_client.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/echo_service/client/echo_client.c?rev=1245336&r1=1245335&r2=1245336&view=diff
==============================================================================
--- incubator/celix/trunk/examples/echo_service/client/echo_client.c (original)
+++ incubator/celix/trunk/examples/echo_service/client/echo_client.c Fri Feb 17 07:36:19 2012
@@ -33,7 +33,7 @@
 void * trk_send(void * handle) {
 	ECHO_CLIENT client = (ECHO_CLIENT) handle;
 	while (client->running) {
-		ECHO_SERVICE service = (ECHO_SERVICE) tracker_getService(client->tracker);
+		ECHO_SERVICE service = (ECHO_SERVICE) serviceTracker_getService(client->tracker);
 		if (service != NULL) {
 			service->echo(service->server, "hi");
 		}

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=1245336&r1=1245335&r2=1245336&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_tracker.c (original)
+++ incubator/celix/trunk/framework/private/src/service_tracker.c Fri Feb 17 07:36:19 2012
@@ -49,7 +49,7 @@ struct tracked {
 typedef struct tracked * TRACKED;
 
 static apr_status_t serviceTracker_destroy(void *trackerP);
-static void * addingService(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference);
+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);
 
@@ -115,7 +115,6 @@ celix_status_t serviceTracker_open(SERVI
 	ARRAY_LIST initial = NULL;
 	celix_status_t status = CELIX_SUCCESS;
 	listener = (SERVICE_LISTENER) apr_palloc(tracker->pool, sizeof(*listener));
-//	FW_SERVICE_TRACKER fwTracker = findFwServiceTracker(tracker);
 	
 	status = bundleContext_getServiceReferences(tracker->context, NULL, tracker->filter,
&initial);
 	if (status == CELIX_SUCCESS) {
@@ -124,7 +123,7 @@ celix_status_t serviceTracker_open(SERVI
 
 		listener->pool = tracker->pool;
 		listener->handle = tracker;
-		listener->serviceChanged = (void *) tracker_serviceChanged;
+		listener->serviceChanged = (void *) serviceTracker_serviceChanged;
 		status = bundleContext_addServiceListener(tracker->context, listener, tracker->filter);
 		if (status == CELIX_SUCCESS) {
 			tracker->listener = listener;
@@ -148,7 +147,7 @@ celix_status_t serviceTracker_close(SERV
 
 	status = bundleContext_removeServiceListener(tracker->context, tracker->listener);
 	if (status == CELIX_SUCCESS) {
-		ARRAY_LIST refs = tracker_getServiceReferences(tracker);
+		ARRAY_LIST refs = serviceTracker_getServiceReferences(tracker);
 		if (refs != NULL) {
 			int i;
 			for (i = 0; i < arrayList_size(refs); i++) {
@@ -162,7 +161,7 @@ celix_status_t serviceTracker_close(SERV
 	return status;
 }
 
-SERVICE_REFERENCE tracker_getServiceReference(SERVICE_TRACKER tracker) {
+SERVICE_REFERENCE serviceTracker_getServiceReference(SERVICE_TRACKER tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	for (i = 0; i < arrayList_size(tracker->tracked); i++) {
@@ -172,7 +171,7 @@ SERVICE_REFERENCE tracker_getServiceRefe
 	return NULL;
 }
 
-ARRAY_LIST tracker_getServiceReferences(SERVICE_TRACKER tracker) {
+ARRAY_LIST serviceTracker_getServiceReferences(SERVICE_TRACKER tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	int size = arrayList_size(tracker->tracked);
@@ -186,7 +185,7 @@ ARRAY_LIST tracker_getServiceReferences(
 	return references;
 }
 
-void * tracker_getService(SERVICE_TRACKER tracker) {
+void *serviceTracker_getService(SERVICE_TRACKER tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	for (i = 0; i < arrayList_size(tracker->tracked); i++) {
@@ -196,7 +195,7 @@ void * tracker_getService(SERVICE_TRACKE
 	return NULL;
 }
 
-ARRAY_LIST tracker_getServices(SERVICE_TRACKER tracker) {
+ARRAY_LIST serviceTracker_getServices(SERVICE_TRACKER tracker) {
 	TRACKED tracked;
 	unsigned int i;
 	int size = arrayList_size(tracker->tracked);
@@ -210,7 +209,7 @@ ARRAY_LIST tracker_getServices(SERVICE_T
 	return references;
 }
 
-void * tracker_getServiceByReference(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference)
{
+void *serviceTracker_getServiceByReference(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference)
{
 	TRACKED tracked;
 	unsigned int i;
 	for (i = 0; i < arrayList_size(tracker->tracked); i++) {
@@ -224,7 +223,7 @@ void * tracker_getServiceByReference(SER
 	return NULL;
 }
 
-void tracker_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event) {
+void serviceTracker_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event) {
 	SERVICE_TRACKER tracker = listener->handle;
 	switch (event->type) {
 		case REGISTERED:
@@ -256,7 +255,7 @@ celix_status_t serviceTracker_track(SERV
 	}
 
 	if (found) {
-		void * service = addingService(tracker, reference);
+		void * service = serviceTracker_addingService(tracker, reference);
 		if (service != NULL) {
 			tracked = (TRACKED) malloc(sizeof(*tracked));
 			tracked->reference = reference;
@@ -276,7 +275,7 @@ celix_status_t serviceTracker_track(SERV
 	return status;
 }
 
-void * addingService(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference) {
+void * serviceTracker_addingService(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference)
{
     void *svc = NULL;
 
     if (tracker->customizer != NULL) {

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=1245336&r1=1245335&r2=1245336&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/service_tracker.h (original)
+++ incubator/celix/trunk/framework/public/include/service_tracker.h Fri Feb 17 07:36:19 2012
@@ -48,13 +48,13 @@ celix_status_t serviceTracker_createWith
 celix_status_t serviceTracker_open(SERVICE_TRACKER tracker);
 celix_status_t serviceTracker_close(SERVICE_TRACKER tracker);
 
-SERVICE_REFERENCE tracker_getServiceReference(SERVICE_TRACKER tracker);
-ARRAY_LIST tracker_getServiceReferences(SERVICE_TRACKER tracker);
+SERVICE_REFERENCE serviceTracker_getServiceReference(SERVICE_TRACKER tracker);
+ARRAY_LIST serviceTracker_getServiceReferences(SERVICE_TRACKER tracker);
 
-void * tracker_getService(SERVICE_TRACKER tracker);
-ARRAY_LIST tracker_getServices(SERVICE_TRACKER tracker);
-void * tracker_getServiceByReference(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference);
+void * serviceTracker_getService(SERVICE_TRACKER tracker);
+ARRAY_LIST serviceTracker_getServices(SERVICE_TRACKER tracker);
+void * serviceTracker_getServiceByReference(SERVICE_TRACKER tracker, SERVICE_REFERENCE reference);
 
-void tracker_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event);
+void serviceTracker_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event);
 
 #endif /* SERVICE_TRACKER_H_ */



Mime
View raw message