celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject [2/2] celix git commit: CELIX-77: Remove APR from config_admin, enable build in travis
Date Tue, 15 Dec 2015 05:32:47 GMT
CELIX-77: Remove APR from config_admin, enable build in travis


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

Branch: refs/heads/develop
Commit: db5e6d74023f23a5f62002979551912ee8cbf950
Parents: 8f58678
Author: Bjoern Petri <bpetri@apache.org>
Authored: Tue Dec 15 06:31:29 2015 +0100
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Tue Dec 15 06:31:29 2015 +0100

----------------------------------------------------------------------
 .travis.yml                                     |   4 +-
 CMakeLists.txt                                  |   1 +
 config_admin/CMakeLists.txt                     |  25 +
 config_admin/deploy.cmake                       |  24 +
 config_admin/examples/CMakeLists.txt            |  21 +
 .../examples/example_test/CMakeLists.txt        |  32 +
 .../examples/example_test/META-INF/MANIFEST.MF  |   5 +
 .../include/example_managed_service_impl.h      |  53 ++
 .../example_test/private/src/activator.c        | 188 ++++++
 .../private/src/example_managed_service_impl.c  |  94 +++
 .../examples/example_test2/CMakeLists.txt       |  21 +
 .../bundle_configuring/CMakeLists.txt           |  30 +
 .../bundle_configuring/META-INF/MANIFEST.MF     |   5 +
 .../bundle_configuring/private/src/activator.c  |  94 +++
 .../bundle_managed_service/CMakeLists.txt       |  32 +
 .../bundle_managed_service/META-INF/MANIFEST.MF |   5 +
 .../include/example_managed_service_impl.h      |  55 ++
 .../private/src/activator.c                     | 120 ++++
 .../private/src/example_managed_service_impl.c  |  95 +++
 config_admin/service/CMakeLists.txt             |  41 ++
 config_admin/service/META-INF/MANIFEST.MF       |   6 +
 .../include/configuration_admin_factory.h       |  65 ++
 .../private/include/configuration_admin_impl.h  |  67 +++
 .../private/include/configuration_impl.h        |  66 ++
 .../private/include/configuration_store.h       |  64 ++
 .../service/private/include/framework_patch.h   |  39 ++
 .../private/include/managed_service_tracker.h   |  59 ++
 .../private/include/updated_thread_pool.h       |  52 ++
 config_admin/service/private/src/activator.c    | 127 ++++
 .../private/src/configuration_admin_factory.c   | 203 +++++++
 .../private/src/configuration_admin_impl.c      | 203 +++++++
 .../service/private/src/configuration_impl.c    | 597 +++++++++++++++++++
 .../service/private/src/configuration_store.c   | 428 +++++++++++++
 .../service/private/src/framework_patch.c       |  60 ++
 .../service/private/src/managed_service_impl.c  |  50 ++
 .../private/src/managed_service_tracker.c       | 563 +++++++++++++++++
 .../service/private/src/updated_thread_pool.c   | 157 +++++
 .../service/public/include/configuration.h      |  57 ++
 .../public/include/configuration_admin.h        |  64 ++
 .../public/include/configuration_event.h        |  57 ++
 .../public/include/configuration_listener.h     |  57 ++
 .../public/include/configuration_plugin.h       |  62 ++
 .../service/public/include/managed_service.h    |  54 ++
 43 files changed, 4100 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 8855894..27cc4f6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,8 +31,8 @@ script:
      # RSA_SHM is only working on linux, but both compilers (see CELIX-277)
     - cd build
     - if [ "$CC" = "gcc" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export BUILD_OPTS="${BUILD_OPTS} -DENABLE_CODE_COVERAGE=ON"; fi
-    - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_DEPENDENCY_MANAGER=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=ON -DBUILD_UTILS-TESTS=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi
-    - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_DEPENDENCY_MANAGER=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=ON -DBUILD_UTILS-TESTS=ON -DENABLE_TESTING=ON -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi
+    - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake -DBUILD_CONFIG_ADMIN=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_DEPENDENCY_MANAGER=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=ON -DBUILD_UTILS-TESTS=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi
+    - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_CONFIG_ADMIN=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_DEPENDENCY_MANAGER=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=ON -DBUILD_UTILS-TESTS=ON -DENABLE_TESTING=ON -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi
     - make all && make deploy && make install-all
     - export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework:`pwd`/dfi && make test ARGS="-V" 
 

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 592983c..8e79a3e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,7 @@ set(DEFAULT_VERSION 1.0.0)
 ## New sub project must use a buildoption to be able to enable/disable the project using the CMake Editor
 ## Sub projects depending on another sub project automatically enable these dependencies
 ## For this to work, the order off "add_subdirectory" has to be correct (ie backwards)
+add_subdirectory(config_admin)
 add_subdirectory(examples)
 add_subdirectory(device_access)
 add_subdirectory(deployment_admin)

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/CMakeLists.txt b/config_admin/CMakeLists.txt
new file mode 100644
index 0000000..8075c31
--- /dev/null
+++ b/config_admin/CMakeLists.txt
@@ -0,0 +1,25 @@
+# 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.
+
+
+celix_subproject(CONFIG_ADMIN "Option to enable building the Config Admin Service bundle and its examples" OFF DEPS framework launcher shell_tui log_writer)
+if (CONFIG_ADMIN)
+
+	add_subdirectory(service)
+	add_subdirectory(examples)
+
+endif (CONFIG_ADMIN)

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/deploy.cmake
----------------------------------------------------------------------
diff --git a/config_admin/deploy.cmake b/config_admin/deploy.cmake
new file mode 100644
index 0000000..d1a769d
--- /dev/null
+++ b/config_admin/deploy.cmake
@@ -0,0 +1,24 @@
+
+# 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.
+
+if (CONFIG_ADMIN)
+ 	
+	deploy("config_admin1" BUNDLES config_admin shell shell_tui log_service log_writer example_test)
+	deploy("config_admin2" BUNDLES config_admin shell shell_tui log_service log_writer bundle_managed_service bundle_configuring)
+
+endif (CONFIG_ADMIN)

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/examples/CMakeLists.txt b/config_admin/examples/CMakeLists.txt
new file mode 100644
index 0000000..6c0188d
--- /dev/null
+++ b/config_admin/examples/CMakeLists.txt
@@ -0,0 +1,21 @@
+# 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.
+
+
+add_subdirectory(example_test)	
+add_subdirectory(example_test2)
+	
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test/CMakeLists.txt b/config_admin/examples/example_test/CMakeLists.txt
new file mode 100644
index 0000000..5529d45
--- /dev/null
+++ b/config_admin/examples/example_test/CMakeLists.txt
@@ -0,0 +1,32 @@
+# 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.
+
+
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/framework/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/config_admin/service/public/include")
+include_directories("private/include")
+
+SET(BUNDLE_SYMBOLICNAME "example_test")
+SET(BUNDLE_VERSION "0.1.0")
+
+bundle(example_test SOURCES 
+	private/src/activator
+	private/src/example_managed_service_impl
+)
+
+target_link_libraries(example_test celix_framework celix_utils config_admin ${APR_LIBRARY})

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test/META-INF/MANIFEST.MF b/config_admin/examples/example_test/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..15593d6
--- /dev/null
+++ b/config_admin/examples/example_test/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-SymbolicName: example_test
+Bundle-Version: 1.0.0
+library: example_test
+Import-Service: configuration_admin

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test/private/include/example_managed_service_impl.h
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test/private/include/example_managed_service_impl.h b/config_admin/examples/example_test/private/include/example_managed_service_impl.h
new file mode 100644
index 0000000..de51c6f
--- /dev/null
+++ b/config_admin/examples/example_test/private/include/example_managed_service_impl.h
@@ -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.
+ */
+/*
+ * example_managed_service_impl.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef MANAGED_SERVICE_IMPL_H_
+#define MANAGED_SERVICE_IMPL_H_
+
+
+/* celix.utils*/
+#include "properties.h"
+/* celix.framework */
+#include "celix_errno.h"
+#include "service_registration.h"
+#include "bundle_context.h"
+/* celix.config_admin.ManagedService */
+#include "managed_service.h"
+
+struct managed_service{
+
+	bundle_context_pt 			context;
+
+	service_registration_pt 	registration;
+	properties_pt 				properties;
+
+};
+
+celix_status_t managedServiceImpl_create(bundle_context_pt context, managed_service_pt *instance);
+celix_status_t managedServiceImpl_updated(managed_service_pt instance, properties_pt properties);
+
+#endif /* MANAGED_SERVICE_IMPL_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test/private/src/activator.c
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test/private/src/activator.c b/config_admin/examples/example_test/private/src/activator.c
new file mode 100644
index 0000000..f1d985e
--- /dev/null
+++ b/config_admin/examples/example_test/private/src/activator.c
@@ -0,0 +1,188 @@
+/**
+ *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.
+ */
+/*
+ * activator.c
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* celix.framework */
+#include "bundle_activator.h"
+#include "bundle_context.h"
+#include "constants.h"
+#include "properties.h"
+#include "utils.h"
+/* celix.utils */
+#include "hash_map.h"
+/* celix.configadmin */
+#include "configuration_admin.h"
+#include "configuration.h"
+#include "managed_service.h"
+/* celix.config_admin.examples.private */
+#include "example_managed_service_impl.h"
+
+
+static void test_debugConfiguration(configuration_pt configuration, char* pid);
+
+
+celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
+	*userData = NULL;
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
+
+	service_reference_pt ref = NULL;
+	celix_status_t status = bundleContext_getServiceReference(ctx, (char *) CONFIGURATION_ADMIN_SERVICE_NAME, &ref);
+
+	if (status == CELIX_SUCCESS) {
+
+		if (ref == NULL) {
+
+			printf("[configAdminClient]: ConfigAdminService reference not available\n");
+
+		} else {
+
+			printf("------------------- DEMO ---------------------- \n");
+
+			configuration_admin_service_pt confAdminServ = NULL;
+			bundleContext_getService(ctx, ref, (void *) &confAdminServ);
+
+			if (confAdminServ == NULL){
+
+				printf("[ TEST ]: ConfigAdminService not available\n");
+
+			} else {
+
+				printf("/////////////////// TESTS ///////////////////// \n");
+
+				char *pid = "base.device1";
+
+				/* ------------------ get Configuration -------------------*/
+
+				printf("------------------- TEST01 -------------------- \n");
+				printf("[ TEST ]: getConfiguration(pid=%s) - It's new \n",pid);
+				configuration_pt configuration;
+				(*confAdminServ->getConfiguration)(confAdminServ->configAdmin,pid, &configuration);
+
+				test_debugConfiguration(configuration, pid);
+
+				/* ------------------ get Configuration -------------------*/
+
+				char *pid2 = "base.device1";
+
+				printf("------------------- TEST02--------------------- \n");
+				printf("[ TEST ]: getConfiguration(pid=%s) - Looking for it in Cache \n",pid2);
+				configuration_pt configuration2;
+				(*confAdminServ->getConfiguration)(confAdminServ->configAdmin,pid2, &configuration2);
+
+				test_debugConfiguration(configuration2, pid2);
+
+				/* ------------------ register ManagedService -------------*/
+
+				printf("------------------- TEST03 -------------------- \n");
+				printf("[ TEST ]: register ManagedService(pid=%s) \n",pid);
+
+
+				managed_service_pt instance;
+				status = managedServiceImpl_create(ctx, &instance);
+				if (status != CELIX_SUCCESS){
+					return status;
+				}
+
+				managed_service_service_pt managedService;
+				status = managedService_create(ctx, &managedService);
+				if (status != CELIX_SUCCESS){
+					return status;
+				}
+
+				managedService->managedService = instance;
+				managedService->updated = managedServiceImpl_updated;
+
+				properties_pt dictionary;
+				dictionary = properties_create();
+				properties_set(dictionary, (char *) OSGI_FRAMEWORK_SERVICE_PID, pid);
+
+				status = bundleContext_registerService(ctx, (char *) MANAGED_SERVICE_SERVICE_NAME,
+						managedService, dictionary, &instance->registration);
+				if (status != CELIX_SUCCESS){
+					printf("[ ERROR ]: Managed Service not registered \n");
+					return status;
+				}
+
+				printf("[ TEST ]: ManagedService(pid=%s) registered  \n",pid);
+
+				/* ------------------ update Configuration ----------------*/
+
+				printf("------------------- TEST04 -------------------- \n");
+				printf("[ TEST ]: configuration update NULL \n");
+				configuration_update(configuration , NULL);
+
+				/* ------------------ update Configuration ----------------*/
+
+				printf("------------------- TEST05 -------------------- \n");
+				printf("[ TEST ]: configuration update New Properties \n");
+				char *prop1 = "type";
+				char *value1 = "printer";
+				properties_pt properties = properties_create();
+				properties_set(properties, prop1, value1);
+				configuration_update(configuration , properties);
+
+				/* ------------------ Configuration get Props ----------------*/
+
+				printf("------------------- TEST06 -------------------- \n");
+				printf("[ TEST ]: configuration get properties \n");
+
+				properties_pt propsRx = properties_create();
+				configuration_getProperties(configuration, &propsRx);
+
+				printf("[ TEST ]: PROP=%s - VALUE=%s \n", (char*)OSGI_FRAMEWORK_SERVICE_PID, properties_get(propsRx,(char*)OSGI_FRAMEWORK_SERVICE_PID));
+				printf("[ TEST ]: PROP=%s - VALUE=%s \n", prop1, properties_get(propsRx,prop1));
+
+				printf("/////////////////// END TESTS ///////////////// \n");
+
+			}
+		}
+	}
+	return status;
+}
+
+celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+void test_debugConfiguration(configuration_pt configuration, char* pid){
+
+	if (configuration == NULL){
+		printf("[ TEST ]: Configuration(pid=%s) is NULL \n", pid);
+	} else{
+		printf("[ TEST ]: Configuration(pid=%s) OK \n", pid);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test/private/src/example_managed_service_impl.c
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test/private/src/example_managed_service_impl.c b/config_admin/examples/example_test/private/src/example_managed_service_impl.c
new file mode 100644
index 0000000..c4dab02
--- /dev/null
+++ b/config_admin/examples/example_test/private/src/example_managed_service_impl.c
@@ -0,0 +1,94 @@
+/**
+ *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.
+ */
+/*
+ * example_managed_service_impl.c
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "example_managed_service_impl.h"
+
+/* ------------------------ Constructor -------------------------------------*/
+
+celix_status_t managedServiceImpl_create(bundle_context_pt context, managed_service_pt *instance){
+
+	celix_status_t status = CELIX_SUCCESS;
+
+	managed_service_pt managedService = calloc(1, sizeof(*managedService));
+	if(!managedService){
+		printf("[ ERROR ]: ManagedServiceImpl - Not initialized (ENOMEM) \n");
+		return CELIX_ENOMEM;
+	}
+
+	managedService->context = context;
+	managedService->registration = NULL;
+	managedService->properties = NULL;
+
+	printf("[ ManagedServiceImpl ]: ManagedServiceImpl - Initialized \n");
+	*instance = managedService;
+	return status;
+}
+
+
+/* -------------------- Implementation --------------------------------------*/
+
+celix_status_t managedServiceImpl_updated(managed_service_pt managedService, properties_pt properties){
+
+	if (properties == NULL){
+		printf("[ managedServiceImpl ]: updated - Received NULL properties \n");
+		managedService->properties = NULL;
+	}else{
+		printf("[ managedServiceImpl ]: updated - Received New Properties \n");
+		managedService->properties = properties_create();
+		managedService->properties = properties;
+	}
+
+	return CELIX_SUCCESS;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/CMakeLists.txt b/config_admin/examples/example_test2/CMakeLists.txt
new file mode 100644
index 0000000..4adf560
--- /dev/null
+++ b/config_admin/examples/example_test2/CMakeLists.txt
@@ -0,0 +1,21 @@
+# 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.
+
+
+add_subdirectory(bundle_configuring)	
+add_subdirectory(bundle_managed_service)
+	
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_configuring/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_configuring/CMakeLists.txt b/config_admin/examples/example_test2/bundle_configuring/CMakeLists.txt
new file mode 100644
index 0000000..344ace2
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_configuring/CMakeLists.txt
@@ -0,0 +1,30 @@
+# 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.
+
+
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/framework/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/config_admin/service/public/include")
+
+SET(BUNDLE_SYMBOLICNAME  "bundle_configuraring")
+SET(BUNDLE_VERSION "0.1.0")
+
+bundle(bundle_configuring SOURCES 
+	private/src/activator
+)
+
+target_link_libraries(bundle_configuring celix_framework celix_utils config_admin ${APR_LIBRARY})

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_configuring/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_configuring/META-INF/MANIFEST.MF b/config_admin/examples/example_test2/bundle_configuring/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..e8f0896
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_configuring/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-SymbolicName: bundle_configuring
+Bundle-Version: 1.0.0
+library: bundle_configuring
+Import-Service: configuration_admin

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c b/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c
new file mode 100644
index 0000000..8ba4122
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c
@@ -0,0 +1,94 @@
+/*
+ ============================================================================
+ Name        	: activator.c
+ Developed at	: Thales
+ Supervisor	 	: Pepijn NOLTES
+ Author      	: Jorge SANCHEZ
+ Version     	: 0.1 - Jul 12, 2013
+ Package	 	: celix.config_admin.examples.example_test2
+ Description	: Example
+ Reviews	 	:
+ ============================================================================
+ */
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* celix.framework */
+#include "bundle_activator.h"
+#include "bundle_context.h"
+#include "constants.h"
+#include "properties.h"
+#include "utils.h"
+/* celix.utils */
+#include "hash_map.h"
+/* celix.configadmin */
+#include "configuration_admin.h"
+#include "configuration.h"
+
+
+celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
+	*userData = NULL;
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
+
+	service_reference_pt ref = NULL;
+	celix_status_t status = bundleContext_getServiceReference(ctx, (char *) CONFIGURATION_ADMIN_SERVICE_NAME, &ref);
+
+	if (status == CELIX_SUCCESS) {
+
+		if (ref == NULL) {
+
+			printf("[configAdminClient]: ConfigAdminService reference not available\n");
+
+		} else {
+
+			configuration_admin_service_pt confAdminServ = NULL;
+			bundleContext_getService(ctx, ref, (void *) &confAdminServ);
+
+			if (confAdminServ == NULL){
+
+				printf("[ BUNDLE configuring ]: ConfigAdminService not available\n");
+
+			} else {
+
+				char *pid = "base.device1";
+
+				configuration_pt configuration;
+				char *configurationLocation;
+
+				/* ------------------ get Configuration -------------------*/
+				printf("[ BUNDLE configuring ]: getConfiguration(pid=%s) \n",pid);
+
+				(*confAdminServ->getConfiguration)(confAdminServ->configAdmin,pid, &configuration);
+
+				/* ------------------ Configuration get Props ----------------*/
+				printf("[ BUNDLE configuring ]: configuration getBundleLocation \n");
+
+				configuration_getBundleLocation(configuration, &configurationLocation);
+
+				/* -------------------- Validation ---------------------------*/
+
+				printf("[ BUNDLE configuring ]: I have a Configuration that belongs to: \n ");
+				printf(" %s \n ", configurationLocation);
+
+				printf("[ BUNDLE configuring ]: END \n");
+
+			}
+		}
+	}
+	return status;
+}
+
+celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_managed_service/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_managed_service/CMakeLists.txt b/config_admin/examples/example_test2/bundle_managed_service/CMakeLists.txt
new file mode 100644
index 0000000..3de8d69
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_managed_service/CMakeLists.txt
@@ -0,0 +1,32 @@
+# 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.
+
+
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/framework/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/config_admin/service/public/include")
+include_directories("private/include")
+
+SET(BUNDLE_SYMBOLICNAME "bundle_managed_service")
+SET(BUNDLE_VERSION "0.1.0")
+
+bundle(bundle_managed_service SOURCES 
+	private/src/activator
+	private/src/example_managed_service_impl
+)
+
+target_link_libraries(bundle_managed_service celix_framework celix_utils config_admin ${APR_LIBRARY})

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_managed_service/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_managed_service/META-INF/MANIFEST.MF b/config_admin/examples/example_test2/bundle_managed_service/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..3ed3eab
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_managed_service/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-SymbolicName: bundle_managed_service
+Bundle-Version: 1.0.0
+library: bundle_managed_service
+Import-Service: configuration_admin

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h b/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h
new file mode 100644
index 0000000..6089826
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h
@@ -0,0 +1,55 @@
+/**
+ *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.
+ */
+/*
+ * example_managed_service_impl.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef MANAGED_SERVICE_IMPL_H_
+#define MANAGED_SERVICE_IMPL_H_
+
+
+/* celix.utils*/
+#include "properties.h"
+/* celix.framework */
+#include "celix_errno.h"
+#include "service_registration.h"
+#include "bundle_context.h"
+/* celix.config_admin.ManagedService */
+#include "managed_service.h"
+
+
+struct managed_service{
+
+	bundle_context_pt 			context;
+
+	service_registration_pt 	registration;
+	properties_pt 				properties;
+
+};
+
+
+celix_status_t managedServiceImpl_create(bundle_context_pt context, managed_service_pt *instance);
+celix_status_t managedServiceImpl_updated(managed_service_pt instance, properties_pt properties);
+
+#endif /* MANAGED_SERVICE_IMPL_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c b/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c
new file mode 100644
index 0000000..5f0d961
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c
@@ -0,0 +1,120 @@
+/**
+ *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.
+ */
+/*
+ * activator.c
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* celix.framework */
+#include "bundle_activator.h"
+#include "bundle_context.h"
+#include "constants.h"
+#include "properties.h"
+#include "utils.h"
+/* celix.utils */
+#include "hash_map.h"
+/* celix.configadmin */
+#include "configuration_admin.h"
+#include "configuration.h"
+#include "managed_service.h"
+/* celix.config_admin.examples.private */
+#include "example_managed_service_impl.h"
+
+
+celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
+
+	service_reference_pt ref = NULL;
+	celix_status_t status = bundleContext_getServiceReference(ctx, (char *) CONFIGURATION_ADMIN_SERVICE_NAME, &ref);
+
+	if (status == CELIX_SUCCESS) {
+
+		if (ref == NULL) {
+
+			printf("[configAdminClient]: ConfigAdminService reference not available\n");
+
+		} else {
+
+			printf("------------------- DEMO ---------------------- \n");
+
+			configuration_admin_service_pt confAdminServ = NULL;
+			bundleContext_getService(ctx, ref, (void *) &confAdminServ);
+
+			if (confAdminServ == NULL){
+
+				printf("[ TEST ]: ConfigAdminService not available\n");
+
+			} else {
+
+				char *pid = "base.device1";
+				/* ------------------ register ManagedService -------------*/
+
+				printf("[ BUNDLE example_managed_service ]: register ManagedService(pid=%s) \n",pid);
+
+
+				managed_service_pt instance;
+				status = managedServiceImpl_create(ctx, &instance);
+				if (status != CELIX_SUCCESS){
+					return status;
+				}
+
+				managed_service_service_pt managedService;
+				status = managedService_create(ctx, &managedService);
+				if (status != CELIX_SUCCESS){
+					return status;
+				}
+
+				managedService->managedService = instance;
+				managedService->updated = managedServiceImpl_updated;
+
+				properties_pt dictionary;
+				dictionary = properties_create();
+				properties_set(dictionary, (char *) OSGI_FRAMEWORK_SERVICE_PID, pid);
+
+				status = bundleContext_registerService(ctx, (char *) MANAGED_SERVICE_SERVICE_NAME,
+						managedService, dictionary, &instance->registration);
+				if (status != CELIX_SUCCESS){
+					printf("[ ERROR ]: Managed Service not registered \n");
+					return status;
+				}
+
+				printf("[ BUNDLE example_managed_service ]: ManagedService(pid=%s) registered  \n",pid);
+
+			}
+		}
+	}
+	return status;
+}
+
+celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c
----------------------------------------------------------------------
diff --git a/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c b/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c
new file mode 100644
index 0000000..2812637
--- /dev/null
+++ b/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c
@@ -0,0 +1,95 @@
+/**
+ *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.
+ */
+/*
+ * example_managed_service_impl.c
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "example_managed_service_impl.h"
+
+/* ------------------------ Constructor -------------------------------------*/
+
+celix_status_t managedServiceImpl_create(bundle_context_pt context, managed_service_pt *instance){
+
+	celix_status_t status = CELIX_SUCCESS;
+
+
+	managed_service_pt managedService = calloc(1, sizeof(*managedService));
+	if(!managedService){
+		printf("[ ERROR ]: ManagedServiceImpl - Not initialized (ENOMEM) \n");
+		return CELIX_ENOMEM;
+	}
+
+    managedService->context = context;
+	managedService->registration = NULL;
+	managedService->properties = NULL;
+
+	printf("[ ManagedServiceImpl ]: ManagedServiceImpl - Initialized \n");
+	*instance = managedService;
+	return status;
+}
+
+
+/* -------------------- Implementation --------------------------------------*/
+
+celix_status_t managedServiceImpl_updated(managed_service_pt managedService, properties_pt properties){
+
+	if (properties == NULL){
+		printf("[ managedServiceImpl ]: updated - Received NULL properties \n");
+		managedService->properties = NULL;
+	}else{
+		printf("[ managedServiceImpl ]: updated - Received New Properties \n");
+		managedService->properties = properties_create();
+		managedService->properties = properties;
+	}
+
+	return CELIX_SUCCESS;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/service/CMakeLists.txt b/config_admin/service/CMakeLists.txt
new file mode 100644
index 0000000..14ce4a4
--- /dev/null
+++ b/config_admin/service/CMakeLists.txt
@@ -0,0 +1,41 @@
+# 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.
+
+
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/framework/public/include")
+include_directories("public/include")
+include_directories("private/include")
+
+SET(BUNDLE_SYMBOLICNAME "config_admin")
+SET(BUNDLE_VERSION "0.0.1")
+ 		
+bundle(config_admin SOURCES 
+	private/src/activator 
+	private/src/configuration_admin_factory
+	private/src/configuration_admin_impl
+	private/src/configuration_impl
+	private/src/configuration_store
+	private/src/framework_patch
+	private/src/managed_service_impl.c
+	private/src/managed_service_tracker.c
+	private/src/updated_thread_pool.c
+)
+
+target_link_libraries(config_admin celix_framework celix_utils ${APR_LIBRARY} ${APRUTIL_LIBRARY})
+	
+

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/config_admin/service/META-INF/MANIFEST.MF b/config_admin/service/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..a1b65e2
--- /dev/null
+++ b/config_admin/service/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-SymbolicName: config_admin
+Bundle-Version: 1.0.0
+library: config_admin
+Export-Service: configuration_admin
+Import-Service: configuration_admin

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/include/configuration_admin_factory.h
----------------------------------------------------------------------
diff --git a/config_admin/service/private/include/configuration_admin_factory.h b/config_admin/service/private/include/configuration_admin_factory.h
new file mode 100644
index 0000000..0afed60
--- /dev/null
+++ b/config_admin/service/private/include/configuration_admin_factory.h
@@ -0,0 +1,65 @@
+/**
+ *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.
+ */
+/*
+ * configuration_admin_factory.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef CONFIGURATION_ADMIN_FACTORY_H_
+#define CONFIGURATION_ADMIN_FACTORY_H_
+
+#include <stdbool.h>
+
+/* celix.framework */
+#include "bundle.h"
+#include "bundle_context.h"
+#include "celix_errno.h"
+#include "service_reference.h"
+#include "service_factory.h"
+#include "properties.h"
+/* celix.config_admin.public*/
+#include "configuration_admin.h"
+
+
+typedef struct configuration_admin_factory *configuration_admin_factory_pt;
+
+
+/* METHODS */
+
+celix_status_t configurationAdminFactory_create(bundle_context_pt context, service_factory_pt *factory, configuration_admin_factory_pt *instance);
+
+celix_status_t configurationAdminFactory_start(configuration_admin_factory_pt factory);
+celix_status_t configurationAdminFactory_stop(configuration_admin_factory_pt factory);
+
+// public void bundleChanged(BundleEvent event)
+
+celix_status_t configurationAdminFactory_checkConfigurationPermission(configuration_admin_factory_pt factory);
+
+celix_status_t configurationAdminFactory_dispatchEvent(configuration_admin_factory_pt factory, int type, char *factoryPid, char *pid);
+
+celix_status_t configurationAdminFactory_notifyConfigurationUpdated(configuration_admin_factory_pt factory, configuration_pt configuration, bool isFactory);
+celix_status_t configurationAdminFactory_notifyConfigurationDeleted(configuration_admin_factory_pt factory, configuration_pt configuration, bool isFactory);
+
+celix_status_t configurationAdminFactory_modifyConfiguration(configuration_admin_factory_pt factory, service_reference_pt reference, properties_pt properties);
+
+#endif /* CONFIGURATION_ADMIN_FACTORY_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/include/configuration_admin_impl.h
----------------------------------------------------------------------
diff --git a/config_admin/service/private/include/configuration_admin_impl.h b/config_admin/service/private/include/configuration_admin_impl.h
new file mode 100644
index 0000000..08932ed
--- /dev/null
+++ b/config_admin/service/private/include/configuration_admin_impl.h
@@ -0,0 +1,67 @@
+/**
+ *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.
+ */
+/*
+ * configuration_admin_impl.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef CONFIGURATION_ADMIN_IMP_H_
+#define CONFIGURATION_ADMIN_IMP_H_
+
+
+/* config_admin.ConfigAdmin*/
+#include "configuration_admin.h"
+
+/* celix.framework */
+#include "bundle.h"
+/* celix.config_admin.public */
+#include "configuration.h"
+/* celix.config_admin.private */
+#include "configuration_admin_factory.h"
+#include "configuration_store.h"
+
+
+struct configuration_admin{
+
+	bundle_pt bundle;
+
+	configuration_admin_factory_pt configurationAdminFactory;
+	configuration_store_pt configurationStore;
+};
+
+
+/* METHODS: celix.config_admin.private */
+celix_status_t configurationAdmin_create(configuration_admin_factory_pt factory, configuration_store_pt store, bundle_pt bundle,
+										 configuration_admin_service_pt *service);
+
+/* METHODS: celix.config_admin.public */
+celix_status_t configurationAdmin_createFactoryConfiguration(configuration_admin_pt configAdmin, char *factoryPid, configuration_pt *configuration);
+celix_status_t configurationAdmin_createFactoryConfiguration2(configuration_admin_pt configAdmin, char *factoryPid, char *location, configuration_pt *configuration);
+
+celix_status_t configurationAdmin_getConfiguration(configuration_admin_pt configAdmin, char *pid, configuration_pt *configuration);
+celix_status_t configurationAdmin_getConfiguration2(configuration_admin_pt configAdmin, char *pid, char *location, configuration_pt *configuration);
+
+celix_status_t configurationAdmin_listConfigurations(configuration_admin_pt configAdmin, char *filter, array_list_pt *configurations);
+
+
+#endif /* CONFIGURATION_ADMIN_IMP_H_ */
+

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/include/configuration_impl.h
----------------------------------------------------------------------
diff --git a/config_admin/service/private/include/configuration_impl.h b/config_admin/service/private/include/configuration_impl.h
new file mode 100644
index 0000000..05b9c91
--- /dev/null
+++ b/config_admin/service/private/include/configuration_impl.h
@@ -0,0 +1,66 @@
+/**
+ *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.
+ */
+/*
+ * configuration_impl.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef CONFIGURATION_IMPL_H_
+#define CONFIGURATION_IMPL_H_
+
+/*celix.config_admin.Configuration */
+#include "configuration.h"
+
+/* celix.framework */
+#include "bundle_context.h"
+/* celix.config_admin.private*/
+#include "configuration_admin_factory.h"
+#include "configuration_store.h"
+
+
+celix_status_t configuration_create( configuration_admin_factory_pt factory, configuration_store_pt store,
+									 char *factoryPid, char *pid, char *bundleLocation,
+									 configuration_pt *configuration);
+
+celix_status_t configuration_create2(configuration_admin_factory_pt factory, configuration_store_pt store,
+									 properties_pt dictionary,
+									 configuration_pt *configuration);
+
+celix_status_t configuration_lock(configuration_pt configuration);
+celix_status_t configuration_unlock(configuration_pt configuration);
+celix_status_t configuration_checkLocked(configuration_pt configuration);
+
+celix_status_t configuration_bind(configuration_pt configuration, bundle_pt bundle, bool *isBind);
+celix_status_t configuration_unbind(configuration_pt configuration, bundle_pt bundle);
+
+celix_status_t configuration_checkDeleted(configuration_pt configuration);
+
+celix_status_t configuration_getBundleLocation2(configuration_pt configuration, bool checkPermission, char **location);
+celix_status_t configuration_getFactoryPid2(configuration_pt configuration, bool checkDeleted, char **factoryPid);
+celix_status_t configuration_getPid2(configuration_pt configuration, bool checkDeleted, char **pid);
+celix_status_t configuration_getAllProperties(configuration_pt configuration, properties_pt *properties);
+
+celix_status_t configuration_isDeleted(configuration_pt configuration, bool *isDeleted);
+
+
+#endif /* CONFIGURATION_IMPL_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/include/configuration_store.h
----------------------------------------------------------------------
diff --git a/config_admin/service/private/include/configuration_store.h b/config_admin/service/private/include/configuration_store.h
new file mode 100644
index 0000000..afdb985
--- /dev/null
+++ b/config_admin/service/private/include/configuration_store.h
@@ -0,0 +1,64 @@
+/**
+ *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.
+ */
+/*
+ * configuration_store.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef CONFIGURATION_STORE_H_
+#define CONFIGURATION_STORE_H_
+
+/* celix.utils.public*/
+#include "array_list.h"
+/* celix.framework */
+#include "bundle.h"
+#include "bundle_context.h"
+#include "filter.h"
+/* celix.config_admin.public */
+#include "configuration.h"
+/* celix.config_admin.private */
+#include "configuration_admin_factory.h"
+
+typedef struct configuration_store *configuration_store_pt;
+
+/* METHODS */
+celix_status_t configurationStore_create(bundle_context_pt context, configuration_admin_factory_pt factory, configuration_store_pt *store);
+
+celix_status_t configurationStore_lock(configuration_store_pt store);
+celix_status_t configurationStore_unlock(configuration_store_pt store);
+
+celix_status_t configurationStore_saveConfiguration(configuration_store_pt store, char *pid, configuration_pt configuration);
+celix_status_t configurationStore_removeConfiguration(configuration_store_pt store, char *pid);
+
+celix_status_t configurationStore_getConfiguration(configuration_store_pt store, char *pid, char *location, configuration_pt *configuration);
+celix_status_t configurationStore_createFactoryConfiguration(configuration_store_pt store, char *factoryPid, char *location, configuration_pt *configuration);
+
+celix_status_t configurationStore_findConfiguration(configuration_store_pt store, char *pid, configuration_pt *configuration);
+
+celix_status_t configurationStore_getFactoryConfigurations(configuration_store_pt store, char *factoryPid, configuration_pt *configuration);
+
+celix_status_t configurationStore_listConfigurations(configuration_store_pt store, filter_pt filter, array_list_pt *configurations);
+
+celix_status_t configurationStore_unbindConfigurations(configuration_store_pt store, bundle_pt bundle);
+
+#endif /* CONFIGURATION_STORE_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/include/framework_patch.h
----------------------------------------------------------------------
diff --git a/config_admin/service/private/include/framework_patch.h b/config_admin/service/private/include/framework_patch.h
new file mode 100644
index 0000000..13ffeae
--- /dev/null
+++ b/config_admin/service/private/include/framework_patch.h
@@ -0,0 +1,39 @@
+/**
+ *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.
+ */
+/*
+ * framework_patch.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef BUNDLE_PATCH_H_
+#define BUNDLE_PATCH_H_
+
+
+/* celix.framework.public */
+#include "celix_errno.h"
+#include "bundle.h"
+#include "service_reference.h"
+
+celix_status_t bundle_getBundleLocation(bundle_pt bundle, char **location);
+
+#endif /* BUNDLE_PATCH_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/include/managed_service_tracker.h
----------------------------------------------------------------------
diff --git a/config_admin/service/private/include/managed_service_tracker.h b/config_admin/service/private/include/managed_service_tracker.h
new file mode 100644
index 0000000..774f4a2
--- /dev/null
+++ b/config_admin/service/private/include/managed_service_tracker.h
@@ -0,0 +1,59 @@
+/**
+ *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.
+ */
+/*
+ * managed_service_tracker.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef MANAGED_service_tracker_pt_H_
+#define MANAGED_service_tracker_pt_H_
+
+/* celix.framework */
+#include "bundle_context.h"
+#include "celix_errno.h"
+#include "service_reference.h"
+#include "service_tracker.h"
+/* celix.config_admin.public */
+#include "configuration.h"
+/* celix.config_admin.private */
+#include "configuration_admin_factory.h"
+#include "configuration_store.h"
+
+
+typedef struct managed_service_tracker *managed_service_tracker_t;
+
+
+celix_status_t managedServiceTracker_create(bundle_context_pt context,
+											configuration_admin_factory_pt factory, configuration_store_pt store,
+											managed_service_tracker_t *trackerHandle, service_tracker_pt *tracker);
+
+celix_status_t managedServiceTracker_notifyDeleted(managed_service_tracker_t tracker, configuration_pt configuration);
+celix_status_t managedServiceTracker_notifyUpdated(managed_service_tracker_t tracker, configuration_pt configuration);
+
+celix_status_t managedServiceTracker_addingService(void * handle, service_reference_pt reference, void **service);
+celix_status_t managedServiceTracker_addedService(void * handle, service_reference_pt reference, void * service);
+celix_status_t managedServiceTracker_modifiedService(void * handle, service_reference_pt reference, void * service);
+celix_status_t managedServiceTracker_removedService(void * handle, service_reference_pt reference, void * service);
+
+
+#endif /* MANAGED_service_tracker_pt_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/include/updated_thread_pool.h
----------------------------------------------------------------------
diff --git a/config_admin/service/private/include/updated_thread_pool.h b/config_admin/service/private/include/updated_thread_pool.h
new file mode 100644
index 0000000..3b51db3
--- /dev/null
+++ b/config_admin/service/private/include/updated_thread_pool.h
@@ -0,0 +1,52 @@
+/**
+ *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.
+ */
+/*
+ * updated_thread_pool.h
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#ifndef UPDATED_THREAD_POOL_H_
+#define UPDATED_THREAD_POOL_H_
+
+
+#define INIT_THREADS 0
+#define MAX_THREADS 10
+
+
+typedef struct updated_thread_pool *updated_thread_pool_t;
+
+/* celix.framework.public */
+#include "bundle_context.h"
+#include "celix_errno.h"
+#include "properties.h"
+/* celix.config_admin.public*/
+#include "managed_service.h"
+
+
+
+celix_status_t updatedThreadPool_create( bundle_context_pt context, int maxTreads, updated_thread_pool_t *updatedThreadPool);
+
+celix_status_t updatedThreadPool_push(updated_thread_pool_t updatedThreadPool, managed_service_service_pt service, properties_pt properties);
+
+
+#endif /* UPDATED_THREAD_POOL_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/src/activator.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/activator.c b/config_admin/service/private/src/activator.c
new file mode 100644
index 0000000..8818051
--- /dev/null
+++ b/config_admin/service/private/src/activator.c
@@ -0,0 +1,127 @@
+/**
+ *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.
+ */
+/*
+ * activator.c
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* celix.framework.public */
+#include "bundle_activator.h"
+#include "bundle_context.h"
+#include "celix_errno.h"
+#include "service_factory.h"
+#include "service_registration.h"
+/* celix.config_admin.public */
+#include "configuration_admin.h"
+/* celix.config_admin.private */
+#include "configuration_admin_factory.h"
+
+
+struct config_admin_bundle {
+	bundle_context_pt context;
+	service_registration_pt configAdminFactoryReg;
+};
+
+typedef struct config_admin_bundle *config_admin_bundle_t;
+
+
+/* -------------------- Implements BundleActivator ---------------------------- */
+
+celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
+
+	celix_status_t status = CELIX_SUCCESS;
+
+	config_admin_bundle_t bi = calloc(1, sizeof(struct config_admin_bundle));
+
+	if (bi == NULL) {
+
+		status = CELIX_ENOMEM;
+
+	} else {
+
+		(*userData) = bi;
+		bi->context = context;
+		bi->configAdminFactoryReg = NULL;
+
+		status = CELIX_SUCCESS;
+
+	}
+	return status;
+}
+
+celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) {
+
+	celix_status_t status;
+
+	config_admin_bundle_t bi = (config_admin_bundle_t) userData;
+
+	service_factory_pt configAdminFactory;
+	configuration_admin_factory_pt configAdminFactoryInstance;
+
+	status = configurationAdminFactory_create(bi->context, &configAdminFactory, &configAdminFactoryInstance);
+	if (status != CELIX_SUCCESS){
+		return status;
+	}
+
+	status = bundleContext_registerServiceFactory(bi->context, (char *) CONFIGURATION_ADMIN_SERVICE_NAME, configAdminFactory, NULL, &bi->configAdminFactoryReg);
+	if (status != CELIX_SUCCESS){
+		return status;
+	}
+	printf("[ SUCCESS ]: Activator - ConfigAdminFactory Registered \n");
+
+	status = configurationAdminFactory_start(configAdminFactoryInstance);
+	if (status != CELIX_SUCCESS){
+		return status;
+	}
+
+	return CELIX_SUCCESS;
+
+}
+
+celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) {
+
+	celix_status_t status = CELIX_SUCCESS;
+
+	config_admin_bundle_t bi = (config_admin_bundle_t) userData;
+
+	serviceRegistration_unregister(bi->configAdminFactoryReg);
+
+	bi->configAdminFactoryReg = NULL;
+
+	return status;
+}
+
+celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
+	return CELIX_SUCCESS;
+}
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/src/configuration_admin_factory.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/configuration_admin_factory.c b/config_admin/service/private/src/configuration_admin_factory.c
new file mode 100644
index 0000000..d2eced5
--- /dev/null
+++ b/config_admin/service/private/src/configuration_admin_factory.c
@@ -0,0 +1,203 @@
+/**
+ *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.
+ */
+/*
+ * configuration_admin_factory.c
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#include <celixbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* celix.config_admin.ConfigAdminFactory */
+#include "configuration_admin_factory.h"
+
+/* celix.framework.Patch*/
+#include "framework_patch.h"
+/* celix.config_admin.public*/
+#include "configuration_admin.h"
+/* celix.config_admin.private*/
+#include "configuration_admin_impl.h"
+#include "managed_service_tracker.h"
+#include "configuration_store.h"
+
+
+struct configuration_admin_factory{
+	bundle_context_pt 	context;
+
+//	configuration_permission_t configurationPermission;
+//	event_dispatcher_t eventDispatcher;
+//	plugin_manager_t pluginManager;
+	managed_service_tracker_t managedServiceTrackerHandle;
+	service_tracker_pt managedServiceTracker;
+//	managed_service_factory_ptracker_t managedServiceFactoryTracker;
+	configuration_store_pt configurationStore;
+
+};
+
+
+celix_status_t configurationAdminFactory_getService(void *factory, bundle_pt bundle, service_registration_pt registration, void **service);
+celix_status_t configurationAdminFactory_ungetService(void *factory, bundle_pt bundle, service_registration_pt registration, void **service);
+
+
+/* ========== CONSTRUCTOR =========== */
+
+/* ---------- public ---------- */
+
+celix_status_t configurationAdminFactory_create( bundle_context_pt context, service_factory_pt *factory, configuration_admin_factory_pt *instance){
+
+	celix_status_t status;
+
+	configuration_admin_factory_pt this = calloc(1, sizeof(*this));
+	configuration_store_pt configurationStore;
+	managed_service_tracker_t managedServiceTrackerHandle;
+	service_tracker_pt managedServiceTracker;
+
+	// (1) SERVICE FACTORY
+	*factory = calloc(1, sizeof(**factory));
+    if (!*factory) {
+        return CELIX_ENOMEM;
+    }
+    // (2) FACTORY DATA
+	if (!this){
+		printf("[ ERROR ]: ConfigAdminFactory - Not initialized \n");
+		return CELIX_ENOMEM;
+	}
+	// (2.1) CONFIGURATION STORE
+	status = configurationStore_create(context, this, &configurationStore);
+	if (status != CELIX_SUCCESS){
+		return status;
+	}
+	// (2.2) SERVICE TRACKER
+	status = managedServiceTracker_create(context, this, configurationStore, &managedServiceTrackerHandle, &managedServiceTracker);
+	if (status != CELIX_SUCCESS){
+		return status;
+	}
+	// (3) INITIALIZATION
+	this->context = context;
+
+	this->managedServiceTrackerHandle = managedServiceTrackerHandle;
+	this->managedServiceTracker = managedServiceTracker;
+	this->configurationStore = configurationStore;
+
+	(*factory)->factory = this;
+	(*factory)->getService = configurationAdminFactory_getService;
+	(*factory)->ungetService = configurationAdminFactory_ungetService;
+
+	printf("[ SUCCESS ]: ConfigAdminFactory - Initialized \n");
+	*instance = this;
+	return CELIX_SUCCESS;
+
+}
+
+/* ========== IMPLEMENTS SERVICE FACTORY ========== */
+
+/* ---------- public ---------- */
+
+celix_status_t configurationAdminFactory_getService(void *factory, bundle_pt bundle, service_registration_pt registration, void **service){
+
+	celix_status_t status;
+
+	configuration_admin_factory_pt configAdminFactory = ((service_factory_pt) factory)->factory;
+	configuration_admin_service_pt confAdminService;
+
+	// TODO
+	// (1) reference = registration.getServiceReference
+	// (2) eventDispatcher.setServiceReference(reference);
+
+	// (3) return new ConfigurationAdminImpl(this, configurationStore, bundle);
+	status = configurationAdmin_create(configAdminFactory, configAdminFactory->configurationStore, bundle, &confAdminService);
+	if (status != CELIX_SUCCESS){
+		return status;
+	}
+
+	/* DEBUG CODE */
+		char* location;
+		bundle_getBundleLocation(bundle, &location);
+		printf("[ SUCCESS ]: ConfigAdminFactory - get configAdminService (bundle=%s) \n ",location);
+	/* END DEBUG CODE */
+
+	(*service) = confAdminService;
+	return CELIX_SUCCESS;
+
+}
+
+celix_status_t configurationAdminFactory_ungetService(void *factory, bundle_pt bundle, service_registration_pt registration, void **service){
+	// do nothing
+	return CELIX_SUCCESS;
+}
+
+
+/* ========== IMPLEMENTATION ========== */
+
+/* ---------- public ---------- */
+
+celix_status_t configurationAdminFactory_start(configuration_admin_factory_pt factory){
+
+	celix_status_t status;
+
+	status = serviceTracker_open(factory->managedServiceTracker);
+	if( status!=CELIX_SUCCESS ){
+		printf("[ ERROR ]: ConfigAdminFactory - ManagedServiceTracker not opened \n");
+		return status;
+	}
+
+	printf("[ SUCCESS ]: ConfigAdminFactory - ManagedServiceTracker opened \n");
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdminFactory_stop(configuration_admin_factory_pt factory){
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdminFactory_checkConfigurationPermission(configuration_admin_factory_pt factory){
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdminFactory_dispatchEvent(configuration_admin_factory_pt factory, int type, char *factoryPid, char *pid){
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdminFactory_notifyConfigurationUpdated(configuration_admin_factory_pt factory, configuration_pt configuration, bool isFactory){
+
+	if (isFactory == true){
+
+		printf("[ DEBUG ]: ConfigAdminFactory - notifyConfigUpdated Factory \n");
+		return CELIX_SUCCESS;
+
+	}else{
+
+		printf("[ DEBUG ]: ConfigAdminFactory - notifyConfigUpdated \n");
+		return managedServiceTracker_notifyUpdated(factory->managedServiceTrackerHandle,configuration);
+
+	}
+
+}
+
+celix_status_t configurationAdminFactory_notifyConfigurationDeleted(configuration_admin_factory_pt factory, configuration_pt configuration, bool isFactory){
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdminFactory_modifyConfiguration(configuration_admin_factory_pt factory, service_reference_pt reference, properties_pt properties){
+	return CELIX_SUCCESS;
+}

http://git-wip-us.apache.org/repos/asf/celix/blob/db5e6d74/config_admin/service/private/src/configuration_admin_impl.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/configuration_admin_impl.c b/config_admin/service/private/src/configuration_admin_impl.c
new file mode 100644
index 0000000..5edaba1
--- /dev/null
+++ b/config_admin/service/private/src/configuration_admin_impl.c
@@ -0,0 +1,203 @@
+/**
+ *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.
+ */
+/*
+ * configuration_admin_impl.c
+ *
+ *  \date       Aug 12, 2013
+ *  \author    	<a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/* celix.config_admin.ConfigAdmin */
+#include "configuration_admin_impl.h"
+
+/* celix.framework.public */
+#include "utils.h"
+/* celix.framework_patch*/
+#include "framework_patch.h"
+/* celix.config_admin.private*/
+#include "configuration_impl.h"
+
+
+static celix_status_t configurationAdmin_checkPid(char *pid);
+
+
+/* ========== CONSTRUCTOR ========== */
+
+celix_status_t configurationAdmin_create(configuration_admin_factory_pt factory, configuration_store_pt store, bundle_pt bundle,
+										 configuration_admin_service_pt *service){
+
+	*service = calloc(1, sizeof(**service));
+	if(!*service){
+		printf("[ ERROR ]: ConfigAdmin - Not initialized(ENOMEM) \n");
+		return CELIX_ENOMEM;
+	}
+
+	configuration_admin_pt this = calloc(1, sizeof(*this));
+	if (!this){
+		printf("[ ERROR ]: ConfigAdmin - Not initialized \n");
+		return CELIX_ENOMEM;
+	}
+
+	this->bundle = bundle;
+
+	this->configurationAdminFactory = factory;
+	this->configurationStore = store;
+
+	(*service)->configAdmin = this;
+	(*service)->createFactoryConfiguration = configurationAdmin_createFactoryConfiguration;
+	(*service)->createFactoryConfiguration2 = configurationAdmin_createFactoryConfiguration2;
+	(*service)->getConfiguration = configurationAdmin_getConfiguration;
+	(*service)->getConfiguration2 = configurationAdmin_getConfiguration2;
+	(*service)->listConfigurations = configurationAdmin_listConfigurations;
+
+	printf("[ SUCCESS ]: ConfigAdmin - Initialized \n");
+	return CELIX_SUCCESS;
+
+}
+
+/* ========== IMPLEMENTATION ========== */
+
+/* ---------- public ---------- */
+
+celix_status_t configurationAdmin_createFactoryConfiguration(configuration_admin_pt configAdmin, char *factoryPid, configuration_pt *configuration){
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdmin_createFactoryConfiguration2(configuration_admin_pt configAdmin, char *factoryPid, char *location, configuration_pt *configuration){
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdmin_getConfiguration(configuration_admin_pt configAdmin, char *pid, configuration_pt *configuration){
+	configuration_pt config;
+
+	char *configAdminBundleLocation;
+	char *configBundleLocation;
+
+
+	// (1) configurationAdmin.checkPid
+	if ( configurationAdmin_checkPid(pid) != CELIX_SUCCESS ){
+		*configuration = NULL;
+		return CELIX_ILLEGAL_ARGUMENT;
+	}
+
+	// (2) bundle.getLocation
+	if ( bundle_getBundleLocation(configAdmin->bundle,&configAdminBundleLocation) != CELIX_SUCCESS ){
+		*configuration = NULL;
+		return CELIX_ILLEGAL_ARGUMENT;
+	}
+
+	// (3) delegates to configurationStore.getConfiguration
+	if ( configurationStore_getConfiguration(configAdmin->configurationStore, pid, configAdminBundleLocation, &config) != CELIX_SUCCESS ){
+		*configuration = NULL;
+		return CELIX_ILLEGAL_ARGUMENT;
+	}
+
+	printf("[ DEBUG ]: ConfigAdmin - getBundleLocation \n");
+
+
+	/* ---------- pseudo code ---------- */
+	/*
+
+	(4) is the configuration already bound? / configBundleLocation != NULL ?
+		YES - are the Configuration and the ConfigAdmin bound to the same bundle?
+			NO - check permission
+
+	(5) config.bind(bundle)
+		if the Configuration is not bound, then we bind it up with the ConfigAdmin bundle
+		in case of be bound, the function does not bind it up with ConfigAdmin bundle
+
+	*/
+
+
+	// (4) config.getBundleLocation != NULL ?
+	if ( configuration_getBundleLocation2(config,false,&configBundleLocation) == CELIX_SUCCESS ){
+
+		if ( strcmp(configAdminBundleLocation,configBundleLocation) != 0 ){
+
+			if ( configurationAdminFactory_checkConfigurationPermission(configAdmin->configurationAdminFactory) != CELIX_SUCCESS ){
+				printf("[ ERROR ]: ConfigAdmin - Config. Permission \n");
+				*configuration = NULL;
+				return CELIX_ILLEGAL_STATE; //TODO checkConfigurationPermission not yet implemented, everything is allowed
+			}
+		}
+	}
+
+	// (5) config.bind(bundle)
+	bool dummy;
+	if ( configuration_bind(config, configAdmin->bundle, &dummy) != CELIX_SUCCESS){
+		*configuration = NULL;
+		printf("[ ERROR]: ConfigAdmin - bind Config.");
+		return CELIX_ILLEGAL_STATE;
+	}
+
+	printf("[ SUCCESS ]: ConfigAdmin - get Configuration \n");
+	*configuration = config;
+	return CELIX_SUCCESS;
+
+}
+
+celix_status_t configurationAdmin_getConfiguration2(configuration_admin_pt configAdmin, char *pid, char *location, configuration_pt *configuration){
+
+//	celix_status_t status;
+//
+//	status = configurationAdmin_checkPid(pid);
+//	if (status != CELIX_SUCCESS){
+//		*configuration = NULL;
+//		return status;
+//	}
+//
+//	status = configurationAdminFactory_checkConfigurationPermission(configAdmin->configurationAdminFactory);
+//	if (status != CELIX_SUCCESS){
+//		*configuration = NULL;
+//		return status;
+//	}
+//
+//	configuration_pt config;
+//	status = configurationStore_getConfiguration(configAdmin->configurationStore, pid, location, &config);
+//	if (status != CELIX_SUCCESS){
+//		*configuration = NULL;
+//		return status;
+//	}
+//
+//	printf("SUCCESS get Configuration");
+//	*configuration = config;
+	return CELIX_SUCCESS;
+}
+
+celix_status_t configurationAdmin_listConfigurations(configuration_admin_pt configAdmin, char *filter, array_list_pt *configurations){
+	return CELIX_SUCCESS;
+}
+
+/* ---------- private ---------- */
+
+celix_status_t configurationAdmin_checkPid(char *pid){
+
+	if (pid == NULL){
+		printf("[ ERROR ]: PID cannot be null");
+		return CELIX_ILLEGAL_ARGUMENT;
+	} else {
+		return CELIX_SUCCESS;
+	}
+}


Mime
View raw message