celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1647062 - in /celix/trunk/event_admin: event_admin/ event_admin/private/include/ event_admin/private/src/ event_handler/ event_handler/private/src/ event_publisher/ event_publisher/private/src/
Date Sat, 20 Dec 2014 23:26:27 GMT
Author: bpetri
Date: Sat Dec 20 23:26:27 2014
New Revision: 1647062

URL: http://svn.apache.org/r1647062
Log:

CELIX-182: fixed some implementation errors 


Modified:
    celix/trunk/event_admin/event_admin/CMakeLists.txt
    celix/trunk/event_admin/event_admin/private/include/event_admin_impl.h
    celix/trunk/event_admin/event_admin/private/src/event_admin_impl.c
    celix/trunk/event_admin/event_admin/private/src/event_impl.c
    celix/trunk/event_admin/event_handler/CMakeLists.txt
    celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c
    celix/trunk/event_admin/event_publisher/CMakeLists.txt
    celix/trunk/event_admin/event_publisher/private/src/event_publisher_activator.c
    celix/trunk/event_admin/event_publisher/private/src/event_publisher_impl.c

Modified: celix/trunk/event_admin/event_admin/CMakeLists.txt
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_admin/CMakeLists.txt?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_admin/CMakeLists.txt (original)
+++ celix/trunk/event_admin/event_admin/CMakeLists.txt Sat Dec 20 23:26:27 2014
@@ -17,10 +17,10 @@
 
 find_package(APR REQUIRED)
 
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
 include_directories(public/include)
 include_directories(private/include)
-#include_directories(../utils/public/include)
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
 
 SET_HEADER(BUNDLE_SYMBOLICNAME "eventadmin")
 SET(BUNDLE_VERSION "0.0.1")
@@ -35,6 +35,7 @@ bundle(event_admin
 		public/include/event_admin.h
 		public/include/event_handler.h
 		private/include/event_admin_impl.h
+		${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c
 )
 
 install_bundle(event_admin

Modified: celix/trunk/event_admin/event_admin/private/include/event_admin_impl.h
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_admin/private/include/event_admin_impl.h?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_admin/private/include/event_admin_impl.h (original)
+++ celix/trunk/event_admin/event_admin/private/include/event_admin_impl.h Sat Dec 20 23:26:27
2014
@@ -42,6 +42,7 @@
 #include "service_registration.h"
 #include "listener_hook_service.h"
 #include "event_admin.h"
+#include "log_helper.h"
 
 struct event_admin {
         apr_pool_t *pool;
@@ -99,7 +100,7 @@ celix_status_t eventAdmin_removedService
  * @param char *topic, the topic string.
  * @param array_list_pt event_handlers. The array list to contain the interested handlers.
  */
-celix_status_t eventAdmin_findHandlersByTopic(hash_map_pt channels, char *topic , array_list_pt
event_handlers);
+celix_status_t eventAdmin_findHandlersByTopic(event_admin_pt event_admin, char *topic , array_list_pt
event_handlers);
 /**
  * @desc create the needed event channels for an event handler.
  * @desc apr_pool_t *pool. a memory pool pointer.

Modified: celix/trunk/event_admin/event_admin/private/src/event_admin_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_admin/private/src/event_admin_impl.c?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_admin/private/src/event_admin_impl.c (original)
+++ celix/trunk/event_admin/event_admin/private/src/event_admin_impl.c Sat Dec 20 23:26:27
2014
@@ -56,6 +56,7 @@ celix_status_t eventAdmin_postEvent(even
 	celix_status_t status = CELIX_SUCCESS;
 
 	char *topic;
+
     eventAdmin_getTopic(&event, &topic);
 
 	array_list_pt event_handlers;
@@ -66,7 +67,7 @@ celix_status_t eventAdmin_postEvent(even
 	array_list_iterator_pt handlers_iterator = arrayListIterator_create(event_handlers);
 	while (arrayListIterator_hasNext(handlers_iterator)) {
 		event_handler_service_pt event_handler_service = (event_handler_service_pt) arrayListIterator_next(handlers_iterator);
-		logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_INFO, "handler found (POST EVENT)
for %s", topic);
+		logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_INFO, "handler found (POST EVENT)
for %s", topic);
 		event_handler_service->handle_event(&event_handler_service->event_handler, event);
 	}
 	eventAdmin_releaseHandersList(event_admin, topic);
@@ -86,7 +87,7 @@ celix_status_t eventAdmin_sendEvent(even
 	array_list_iterator_pt handlers_iterator = arrayListIterator_create(event_handlers);
 	while (arrayListIterator_hasNext(handlers_iterator)) {
 		event_handler_service_pt event_handler_service = (event_handler_service_pt) arrayListIterator_next(handlers_iterator);
-		logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_INFO, "handler found (SEND EVENT)
for %s", topic);
+		logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_INFO, "handler found (SEND EVENT)
for %s", topic);
 		event_handler_service->handle_event(&event_handler_service->event_handler, event);
 	}
 	eventAdmin_releaseHandersList(event_admin, topic);
@@ -98,7 +99,7 @@ celix_status_t eventAdmin_findHandlersBy
 	hash_map_pt channels = event_admin->channels;
     channel_t channel = hashMap_get(channels, topic);
 	if (channel != NULL) {
-		logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_INFO, "found channel: %s", topic);
+		logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_INFO, "found channel: %s", topic);
 		if (channel->eventHandlers != NULL && !hashMap_isEmpty(channel->eventHandlers))
{
 			// iterate throught the handlers and add them to the array list for result.
 			hash_map_iterator_pt hashmap_iterator =  hashMapIterator_create(channel->eventHandlers);
@@ -107,7 +108,7 @@ celix_status_t eventAdmin_findHandlersBy
 			}
 		}
 	} else {
-		logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_WARNING, "no such channel: %s",
topic);
+		logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_WARNING, "no such channel: %s",
topic);
 	}
 	return status;
 }
@@ -117,7 +118,7 @@ celix_status_t eventAdmin_createEventCha
     channel_t channel = hashMap_get((*event_admin)->channels, topic);
 	if (channel == NULL) {
 		//create channel
-		logHelper_log((*event_admin)->loghelper, OSGI_LOGSERVICE_INFO, "Creating channel: %s",
topic);
+		logHelper_log(*(*event_admin)->loghelper, OSGI_LOGSERVICE_INFO, "Creating channel: %s",
topic);
 
         apr_pool_t *subPool = NULL;
         apr_pool_create(&subPool, (*event_admin)->pool);
@@ -185,7 +186,7 @@ celix_status_t eventAdmin_lockHandlersLi
         do {
             status = apr_thread_mutex_trylock(channel->channelLock);
         } while (status != 0 && !APR_STATUS_IS_EBUSY(status));
-        logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "LOCK: %s!", topic);
+        logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "LOCK: %s!", topic);
     }
 	return status;
 }
@@ -196,7 +197,7 @@ celix_status_t eventAdmin_releaseHanders
 	if (channel != NULL) {
         // TODO check the result value...
         apr_thread_mutex_unlock(channel->channelLock);
-        logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "UNLOCK: %s!", topic);
+        logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "UNLOCK: %s!", topic);
     }
 	return status;
 }
@@ -215,19 +216,19 @@ celix_status_t eventAdmin_addedService(v
 	event_handler_service = (event_handler_service_pt) service;
 	char *topic = NULL;
 	serviceReference_getProperty(ref, (char*)EVENT_TOPIC, &topic);
-	logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "Original TOPIC: %s", topic);
+	logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "Original TOPIC: %s", topic);
 	eventAdmin_createEventChannels(&event_admin,topic,event_handler_service);
 	return status;
 }
 
 celix_status_t eventAdmin_modifiedService(void * handle, service_reference_pt ref, void *
service) {
 	event_admin_pt event_admin = (event_admin_pt) handle;
-	logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "Event admin Modified");
+	logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "Event admin Modified");
 	return CELIX_SUCCESS;
 }
 
 celix_status_t eventAdmin_removedService(void * handle, service_reference_pt ref, void *
service) {
 	event_admin_pt event_admin = (event_admin_pt) handle;
-	logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "Event admin Removed %p",
service);
+	logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "Event admin Removed %p",
service);
 	return CELIX_SUCCESS;
 }

Modified: celix/trunk/event_admin/event_admin/private/src/event_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_admin/private/src/event_impl.c?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_admin/private/src/event_impl.c (original)
+++ celix/trunk/event_admin/event_admin/private/src/event_impl.c Sat Dec 20 23:26:27 2014
@@ -42,15 +42,15 @@ struct event {
 celix_status_t eventAdmin_createEvent(event_admin_pt event_admin, char *topic, properties_pt
properties, event_pt *event){
 	celix_status_t status = CELIX_SUCCESS;
 
-	logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "create event event admin
pointer: %p",event_admin);
-	logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "pool create event: %p",event_admin->pool);
+	logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "create event event admin
pointer: %p",event_admin);
+	logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_DEBUG, "pool create event: %p",event_admin->pool);
 
 	*event = apr_palloc(event_admin->pool,sizeof(**event));
 	if(!*event){
 	       status = CELIX_ENOMEM;
-	       logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_ERROR, "No MEM");
+	       logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_ERROR, "No MEM");
 	}else {
-		logHelper_log(event_admin->loghelper, OSGI_LOGSERVICE_INFO, "Event created : %s", topic);
+		logHelper_log(*event_admin->loghelper, OSGI_LOGSERVICE_INFO, "Event created : %s", topic);
 		(*event)->topic = topic;
 		(*event)->properties = properties;
 		properties_set((*event)->properties, (char *)EVENT_TOPIC, topic);

Modified: celix/trunk/event_admin/event_handler/CMakeLists.txt
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_handler/CMakeLists.txt?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_handler/CMakeLists.txt (original)
+++ celix/trunk/event_admin/event_handler/CMakeLists.txt Sat Dec 20 23:26:27 2014
@@ -20,6 +20,7 @@ find_package(APR REQUIRED)
 include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
 include_directories(private/include)
 include_directories(${PROJECT_SOURCE_DIR}/event_admin/event_admin/public/include)
+include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
 
 SET_HEADER(BUNDLE_SYMBOLICNAME "eventhandler")
 SET(BUNDLE_VERSION "0.0.1")
@@ -30,6 +31,7 @@ bundle(event_handler
 	SOURCES 
 		private/src/event_handler_activator.c
 		private/src/event_handler_impl.c
+		${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c
 )
 
 install_bundle(event_handler)

Modified: celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c (original)
+++ celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c Sat Dec 20
23:26:27 2014
@@ -93,8 +93,6 @@ celix_status_t bundleActivator_start(voi
 		serviceTracker_create(context, (char *) EVENT_ADMIN_NAME, customizer, &tracker);
 		activator->eventAdminTracker = tracker;
 		serviceTracker_open(tracker);
-		properties_pt properties = NULL;
-		properties = properties_create();
 	}
 	return status;
 }

Modified: celix/trunk/event_admin/event_publisher/CMakeLists.txt
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_publisher/CMakeLists.txt?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_publisher/CMakeLists.txt (original)
+++ celix/trunk/event_admin/event_publisher/CMakeLists.txt Sat Dec 20 23:26:27 2014
@@ -20,6 +20,7 @@ find_package(APR REQUIRED)
 include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
 include_directories(private/include)
 include_directories(${PROJECT_SOURCE_DIR}/event_admin/event_admin/public/include)
+include_directories(${PROJECT_SOURCE_DIR}/log_service/public/include)
 
 SET_HEADER(BUNDLE_SYMBOLICNAME "event_publisher")
 SET(BUNDLE_VERSION "0.0.1")
@@ -29,6 +30,7 @@ SET_HEADERS("Bundle-Name: Event Publishe
 bundle(event_publisher SOURCES 
 	private/src/event_publisher_activator.c
 	private/src/event_publisher_impl.c
+	${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c	
 )
 
 install_bundle(event_publisher)

Modified: celix/trunk/event_admin/event_publisher/private/src/event_publisher_activator.c
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_publisher/private/src/event_publisher_activator.c?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_publisher/private/src/event_publisher_activator.c (original)
+++ celix/trunk/event_admin/event_publisher/private/src/event_publisher_activator.c Sat Dec
20 23:26:27 2014
@@ -75,8 +75,6 @@ celix_status_t bundleActivator_start(voi
 		data->tracker = tracker;
 
 		serviceTracker_open(tracker);
-		properties_pt properties = NULL;
-		properties = properties_create();
 	}
 	eventPublisherStart(&data->event_publisher);
 	return status;

Modified: celix/trunk/event_admin/event_publisher/private/src/event_publisher_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/event_admin/event_publisher/private/src/event_publisher_impl.c?rev=1647062&r1=1647061&r2=1647062&view=diff
==============================================================================
--- celix/trunk/event_admin/event_publisher/private/src/event_publisher_impl.c (original)
+++ celix/trunk/event_admin/event_publisher/private/src/event_publisher_impl.c Sat Dec 20
23:26:27 2014
@@ -92,7 +92,7 @@ celix_status_t eventPublisherAddingServi
 
 celix_status_t eventPublisherAddedService(void * handle, service_reference_pt ref, void *
service) {
     event_publisher_pt data = (event_publisher_pt) handle;
-	loghelper_log(data->loghelper, OSGI_LOGSERVICE_DEBUG, "[PUB] Event admin added.");
+	logHelper_log(data->loghelper, OSGI_LOGSERVICE_DEBUG, "[PUB] Event admin added.");
 
     data->event_admin_service = (event_admin_service_pt) service;
     data->eventAdminAdded = true;
@@ -101,13 +101,13 @@ celix_status_t eventPublisherAddedServic
 
 celix_status_t eventPublisherModifiedService(void * handle, service_reference_pt ref, void
* service) {
 	event_publisher_pt data = (event_publisher_pt) handle;
-	loghelper_log(data->loghelper, OSGI_LOGSERVICE_DEBUG, "[PUB] Event admin modified.");
+	logHelper_log(data->loghelper, OSGI_LOGSERVICE_DEBUG, "[PUB] Event admin modified.");
 	return CELIX_SUCCESS;
 }
 
 celix_status_t eventPublisherRemovedService(void * handle, service_reference_pt ref, void
* service) {
 	event_publisher_pt data = (event_publisher_pt) handle;
-	loghelper_log(data->loghelper, OSGI_LOGSERVICE_DEBUG, "[PUB] Event admin removed.");
+	logHelper_log(data->loghelper, OSGI_LOGSERVICE_DEBUG, "[PUB] Event admin removed.");
 
     data->event_admin_service = NULL;
     data->eventAdminAdded = false;



Mime
View raw message