You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2016/04/11 14:00:21 UTC
[12/50] celix git commit: CELIX-343: Update config_admin examples to
print updated properties.
CELIX-343: Update config_admin examples to print updated properties.
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b815e68f
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b815e68f
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b815e68f
Branch: refs/heads/master
Commit: b815e68fc4ad5a8a7e1a11fb58a482d0b6c993ac
Parents: 4705f77
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 4 16:26:18 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 4 16:26:18 2016 +0100
----------------------------------------------------------------------
config_admin/example/private/src/example.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/b815e68f/config_admin/example/private/src/example.c
----------------------------------------------------------------------
diff --git a/config_admin/example/private/src/example.c b/config_admin/example/private/src/example.c
index 9158943..e58e6ae 100644
--- a/config_admin/example/private/src/example.c
+++ b/config_admin/example/private/src/example.c
@@ -2,6 +2,8 @@
#include <pthread.h>
+#include "hash_map.h"
+
#include "example.h"
struct example {
@@ -42,5 +44,16 @@ celix_status_t example_stop(example_pt component) {
celix_status_t example_updated(example_pt component, properties_pt updatedProperties) {
printf("updated called\n");
+ hash_map_pt map = (hash_map_pt)updatedProperties;
+ if (map != NULL) {
+ hash_map_iterator_pt iter = hashMapIterator_create(map);
+ while(hashMapIterator_hasNext(iter)) {
+ char *key = hashMapIterator_nextKey(iter);
+ char *value = properties_get(updatedProperties, key);
+ printf("got property %s:%s\n", key, value);
+ }
+ } else {
+ printf("updated with NULL properties\n");
+ }
return CELIX_SUCCESS;
}