celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ejans...@apache.org
Subject [2/2] celix git commit: [CELIX-256] refactored code
Date Tue, 23 Aug 2016 08:11:57 GMT
[CELIX-256] refactored code


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

Branch: refs/heads/feature/event_admin
Commit: 1db2379c1f52b10362dffc000d9ee18cb4915ca4
Parents: 3b19906
Author: Erik Jansman <ejansman@apache.org>
Authored: Tue Aug 23 09:52:21 2016 +0200
Committer: Erik Jansman <ejansman@apache.org>
Committed: Tue Aug 23 09:52:21 2016 +0200

----------------------------------------------------------------------
 event_admin/event_admin/CMakeLists.txt                        | 2 +-
 event_admin/event_admin/private/include/event_admin_impl.h    | 5 ++---
 event_admin/event_admin/private/src/event_admin_impl.c        | 7 -------
 event_admin/event_admin/public/include/event_admin.h          | 2 +-
 event_admin/event_admin/public/include/event_handler.h        | 3 ++-
 .../event_handler/private/src/event_handler_activator.c       | 2 +-
 event_admin/event_handler/private/src/event_handler_impl.c    | 1 -
 .../event_publisher/private/src/event_publisher_impl.c        | 2 +-
 8 files changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_admin/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/event_admin/event_admin/CMakeLists.txt b/event_admin/event_admin/CMakeLists.txt
index 4fe7ccd..b915c76 100644
--- a/event_admin/event_admin/CMakeLists.txt
+++ b/event_admin/event_admin/CMakeLists.txt
@@ -23,7 +23,7 @@ include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
 include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
 
 add_bundle(event_admin
-    VERSION 0.0.0
+		VERSION 0.0.1
 	SOURCES 
 		private/src/event_admin_activator.c
 		private/src/event_admin_impl.c

http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_admin/private/include/event_admin_impl.h
----------------------------------------------------------------------
diff --git a/event_admin/event_admin/private/include/event_admin_impl.h b/event_admin/event_admin/private/include/event_admin_impl.h
index 65a5919..dbb969d 100644
--- a/event_admin/event_admin/private/include/event_admin_impl.h
+++ b/event_admin/event_admin/private/include/event_admin_impl.h
@@ -47,7 +47,6 @@ struct event_admin {
     hash_map_pt channels;
     array_list_pt event_handlers;
     bundle_context_pt context;
-    log_helper_pt *loghelper;
     linked_list_pt eventList;
     celix_thread_t eventListProcessor;
     celix_thread_mutex_t *eventListLock;
@@ -56,8 +55,8 @@ struct event_admin {
 };
 typedef struct channel *channel_t;
 struct channel {
-        char *topic;
-        hash_map_pt eventHandlers;///array list containing all listeners subscribed to the
channel
+    char *topic;
+    hash_map_pt eventHandlers;///array list containing all listeners subscribed to the channel
     celix_thread_mutex_t *channelLock;
 
 };

http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_admin/private/src/event_admin_impl.c
----------------------------------------------------------------------
diff --git a/event_admin/event_admin/private/src/event_admin_impl.c b/event_admin/event_admin/private/src/event_admin_impl.c
index 6b91f94..37ca79d 100644
--- a/event_admin/event_admin/private/src/event_admin_impl.c
+++ b/event_admin/event_admin/private/src/event_admin_impl.c
@@ -78,12 +78,6 @@ celix_status_t eventAdmin_destroy(event_admin_pt *event_admin) {
     return status;
 }
 
-celix_status_t eventAdmin_getEventHandlersByChannel(bundle_context_pt context, const char
* serviceName, array_list_pt *eventHandlers) {
-	celix_status_t status = CELIX_SUCCESS;
-	//celix_status_t status = bundleContext_getServiceReferences(context, serviceName, NULL,
eventHandlers);
-	return status;
-}
-
 celix_status_t eventAdmin_postEvent(event_admin_pt event_admin, event_pt event) {
     bool added = false;
     while (event_admin->eventAdminRunning && added == false) {
@@ -92,7 +86,6 @@ celix_status_t eventAdmin_postEvent(event_admin_pt event_admin, event_pt
event)
             celixThreadMutex_unlock(event_admin->eventListLock);
             added = true;
         }
-
     }
     return CELIX_SUCCESS;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_admin/public/include/event_admin.h
----------------------------------------------------------------------
diff --git a/event_admin/event_admin/public/include/event_admin.h b/event_admin/event_admin/public/include/event_admin.h
index 4955b54..2cd49cc 100644
--- a/event_admin/event_admin/public/include/event_admin.h
+++ b/event_admin/event_admin/public/include/event_admin.h
@@ -30,7 +30,7 @@
 
 #include "listener_hook_service.h"
 
-#define EVENT_ADMIN_NAME "event_admin"
+static const char *const EVENT_ADMIN_NAME = "org.osgi.service.event.EventAdmin";
 typedef struct event_admin *event_admin_pt;
 typedef struct event_admin_service *event_admin_service_pt;
 

http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_admin/public/include/event_handler.h
----------------------------------------------------------------------
diff --git a/event_admin/event_admin/public/include/event_handler.h b/event_admin/event_admin/public/include/event_handler.h
index 5f76c6d..0325790 100644
--- a/event_admin/event_admin/public/include/event_handler.h
+++ b/event_admin/event_admin/public/include/event_handler.h
@@ -28,7 +28,8 @@
 #define EVENT_HANDLER_H_
 #include "event_admin.h"
 #include "properties.h"
-static const char * const EVENT_HANDLER_SERVICE = "service.event.handler";
+
+static const char *const EVENT_HANDLER_SERVICE = "org.osgi.service.event.EventHandler";
 
 typedef struct event_handler_service *event_handler_service_pt;
 typedef struct event_handler *event_handler_pt; //ADT

http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_handler/private/src/event_handler_activator.c
----------------------------------------------------------------------
diff --git a/event_admin/event_handler/private/src/event_handler_activator.c b/event_admin/event_handler/private/src/event_handler_activator.c
index 9654e95..c4b20b9 100644
--- a/event_admin/event_handler/private/src/event_handler_activator.c
+++ b/event_admin/event_handler/private/src/event_handler_activator.c
@@ -69,7 +69,7 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt
context)
 	properties_pt properties = NULL;
 	properties = properties_create();
     properties_set(properties, (char *) EVENT_HANDLER_SERVICE, (const char *) EVENT_HANDLER_NAME);
-    properties_set(properties, (char *) EVENT_TOPIC, (const char *) "log/error/eventpublishers/event");
+    properties_set(properties, (char *) EVENT_TOPIC, (const char *) "log/error");
 
 	event_handler_service_pt event_handler_service = activator->event_handler_service;
     bundleContext_registerService(context, (char *) EVENT_HANDLER_SERVICE, event_handler_service,
properties,

http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_handler/private/src/event_handler_impl.c
----------------------------------------------------------------------
diff --git a/event_admin/event_handler/private/src/event_handler_impl.c b/event_admin/event_handler/private/src/event_handler_impl.c
index 29b61df..76f2367 100644
--- a/event_admin/event_handler/private/src/event_handler_impl.c
+++ b/event_admin/event_handler/private/src/event_handler_impl.c
@@ -57,7 +57,6 @@ celix_status_t eventHandlerDestroy(event_handler_pt *event_handler)
     logHelper_stop((*event_handler)->loghelper);
     logHelper_destroy(&(*event_handler)->loghelper);
     free(*event_handler);
-    printf("event handler clean\n");
     return status;
 }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/1db2379c/event_admin/event_publisher/private/src/event_publisher_impl.c
----------------------------------------------------------------------
diff --git a/event_admin/event_publisher/private/src/event_publisher_impl.c b/event_admin/event_publisher/private/src/event_publisher_impl.c
index 53c5f7a..66b81d4 100644
--- a/event_admin/event_publisher/private/src/event_publisher_impl.c
+++ b/event_admin/event_publisher/private/src/event_publisher_impl.c
@@ -85,7 +85,7 @@ void *produceEvents(void *handle) {
                     properties_pt props = properties_create();
                     properties_set(props, "Error ", "No Error, Just testing ");
 
-                    (*event_admin_service)->createEvent(event_admin, "log/error/eventpublishers/event",
props, &event);
+                    (*event_admin_service)->createEvent(event_admin, "log/error", props,
&event);
                     (*event_admin_service)->postEvent(event_admin, event);
                     (*event_admin_service)->sendEvent(event_admin, event);
                 }


Mime
View raw message