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 12:54:28 UTC

[01/50] celix git commit: CELIX-335: Change make install-all -> make install for travis config

Repository: celix
Updated Branches:
  refs/heads/release/celix-2.0.0 63c776221 -> 720b64b86


CELIX-335: Change make install-all -> make install for travis config


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

Branch: refs/heads/release/celix-2.0.0
Commit: da78d305a734708da4890b5ecfb176d57babdaf0
Parents: a43d78b
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jan 26 09:09:59 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jan 26 09:09:59 2016 +0100

----------------------------------------------------------------------
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/da78d305/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 5ff6b65..905c714 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -83,7 +83,7 @@ script:
     - if [ "$CC" = "gcc" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export BUILD_OPTS="${BUILD_OPTS} -DENABLE_CODE_COVERAGE=ON"; fi
     - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ -z "$ANDROID" ]; then cmake ${BUILD_OPTIONS} ${BUILD_OPTIONS_LINUX} -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 ${BUILD_OPTIONS} ${BUILD_OPTIONS_OSX} -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 [ -z "$ANDROID" ]; then make all && make deploy && make install-all; else cd .. && docker build -t celixandroid - < Dockerfile.Android ; fi
+    - if [ -z "$ANDROID" ]; then make all && make deploy && make install; else cd .. && docker build -t celixandroid - < Dockerfile.Android ; fi
     - if [ -z "$ANDROID" ]; then export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework:`pwd`/dfi && make test ARGS="-V"; else docker run celixandroid; fi 
 
 after_success:


[42/50] celix git commit: CELIX-352: Fix issue in dfi_utils

Posted by pn...@apache.org.
CELIX-352: Fix issue in dfi_utils


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

Branch: refs/heads/release/celix-2.0.0
Commit: b26889c13d0a9ccf447fff1f55456fbbc655322b
Parents: 2e763f3
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Sat Feb 13 10:23:49 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Sat Feb 13 10:23:49 2016 +0100

----------------------------------------------------------------------
 .../remote_service_admin_dfi/rsa/private/src/dfi_utils.c     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b26889c1/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c b/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
index 503c931..ba66e52 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
@@ -24,15 +24,17 @@
 static celix_status_t dfi_findFileForFramework(bundle_context_pt context, const char *fileName, FILE **out) {
     celix_status_t  status;
 
-    char pwd[1024]
+    char pwd[1024];
     char path[1024];
+    char *extPath = NULL;
    
     status = bundleContext_getProperty(context, "CELIX_FRAMEWORK_EXTENDER_PATH", &extPath);
-    if (status != CELIX_SUCCESS) {
+    if (status != CELIX_SUCCESS || extPath == NULL) {
         getcwd(pwd, sizeof(pwd));
+        extPath = pwd;
     }
 
-    snprintf(path, sizeof(path), "%s/%s", pwd, fileName);
+    snprintf(path, sizeof(path), "%s/%s", extPath, fileName);
 
     if (status == CELIX_SUCCESS) {
         FILE *df = fopen(path, "r");


[06/50] celix git commit: CELIX-236: remove sample code from cmake deploy

Posted by pn...@apache.org.
CELIX-236: remove sample code from cmake deploy


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

Branch: refs/heads/release/celix-2.0.0
Commit: 4228b99710a62667f82dc541fd5dd1b22d3e19cc
Parents: 0113609
Author: Bjoern Petri <bp...@apache.org>
Authored: Wed Jan 27 16:06:28 2016 +0100
Committer: Bjoern Petri <bp...@apache.org>
Committed: Wed Jan 27 16:06:28 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake | 7 +------
 .../celix/bootstrap/templates/project/deploy.cmake            | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/4228b997/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake b/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
index 2dbf2cc..f654771 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
@@ -8,11 +8,6 @@
 #cog.outl("\t${CELIX_BUNDLES_DIR}/shell_tui.zip")
 #cog.outl("\t${CELIX_BUNDLES_DIR}/log_service.zip")
 #cog.outl("\t%s" % bundle['name'])
+#cog.outl(")")
 #}}
-deploy( "mybundle" BUNDLES #do not edit, generated code
-	${CELIX_BUNDLES_DIR}/shell.zip #do not edit, generated code
-	${CELIX_BUNDLES_DIR}/shell_tui.zip #do not edit, generated code
-	${CELIX_BUNDLES_DIR}/log_service.zip #do not edit, generated code
-	mybundle #do not edit, generated code
 #{{end}}
-)

http://git-wip-us.apache.org/repos/asf/celix/blob/4228b997/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake b/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
index 899c83b..84c3ffb 100644
--- a/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
+++ b/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
@@ -22,11 +22,6 @@
 #			bundle = yaml.load(input)
 #			cog.outl("\t%s" % bundle['name'])
 #
+#cog.outl(")");
 #}}
-deploy( "mybundle" BUNDLES #do not edit, generated code
-	${CELIX_BUNDLES_DIR}/shell.zip #do not edit, generated code
-	${CELIX_BUNDLES_DIR}/shell_tui.zip #do not edit, generated code
-	${CELIX_BUNDLES_DIR}/log_service.zip #do not edit, generated code
-	mybundle #do not edit, generated code
 #{{end}}
-)


[05/50] celix git commit: Merge branch 'feature/CELIX-236_celix-boostrap' into develop

Posted by pn...@apache.org.
Merge branch 'feature/CELIX-236_celix-boostrap' into develop


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

Branch: refs/heads/release/celix-2.0.0
Commit: 01136093e0cac8532340025996188217458ea0f7
Parents: d5666c5 15b41d2
Author: Bjoern Petri <bp...@apache.org>
Authored: Wed Jan 27 15:33:58 2016 +0100
Committer: Bjoern Petri <bp...@apache.org>
Committed: Wed Jan 27 15:33:58 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/README.md                       |  64 +++
 celix-bootstrap/celix/__init__.py               |   2 +
 celix-bootstrap/celix/bootstrap/__init__.py     |   0
 celix-bootstrap/celix/bootstrap/__main__.py     |   4 +
 .../celix/bootstrap/argument_parser.py          |  77 +++
 celix-bootstrap/celix/bootstrap/celix_utils.py  | 138 ++++++
 celix-bootstrap/celix/bootstrap/generators.py   | 160 ++++++
 .../bootstrap/templates/bundle/CMakeLists.txt   |  71 +++
 .../bootstrap/templates/bundle/bundle.yaml      |  66 +++
 .../templates/bundle/bundle_activator.c         | 483 +++++++++++++++++++
 .../bootstrap/templates/bundle/component.c      | 190 ++++++++
 .../bootstrap/templates/bundle/component.h      |  80 +++
 .../bootstrap/templates/bundle/deploy.cmake     |  18 +
 .../celix/bootstrap/templates/bundle/service.h  |  58 +++
 .../bootstrap/templates/project/CMakeLists.txt  |  37 ++
 .../bootstrap/templates/project/deploy.cmake    |  32 ++
 .../bootstrap/templates/project/project.yaml    |  19 +
 celix-bootstrap/scripts/celix-bootstrap         |   5 +
 celix-bootstrap/setup.py                        |  31 ++
 19 files changed, 1535 insertions(+)
----------------------------------------------------------------------



[20/50] celix git commit: CELIX-335: Fix run.sh generated. Generation now also works for celix based projects.

Posted by pn...@apache.org.
CELIX-335: Fix run.sh generated. Generation now also works for celix based projects.


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

Branch: refs/heads/release/celix-2.0.0
Commit: b19a8f6beda1054bf0fac831124b8ff6519762f2
Parents: da797a0
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 11:30:46 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 11:30:46 2016 +0100

----------------------------------------------------------------------
 cmake/FindCELIX.cmake             | 23 +++++++++++++++++------
 cmake/cmake_celix/Packaging.cmake | 33 +++++++++++++++++++--------------
 2 files changed, 36 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b19a8f6b/cmake/FindCELIX.cmake
----------------------------------------------------------------------
diff --git a/cmake/FindCELIX.cmake b/cmake/FindCELIX.cmake
index 9f91e5a..b2789df 100644
--- a/cmake/FindCELIX.cmake
+++ b/cmake/FindCELIX.cmake
@@ -31,28 +31,39 @@ set(CELIX_DIR_FROM_FINDCELIX "${CMAKE_CURRENT_LIST_DIR}/../../../..")
 
 find_path(CELIX_INCLUDE_DIR celix_errno.h
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-          	PATH_SUFFIXES include include/celix)
+          	PATH_SUFFIXES include include/celix
+)
 
 find_library(CELIX_FRAMEWORK_LIBRARY NAMES celix_framework
              	PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-             	PATH_SUFFIXES lib lib64)
+             	PATH_SUFFIXES lib lib64
+)
              
 find_library(CELIX_UTILS_LIBRARY NAMES celix_utils
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-		PATH_SUFFIXES lib lib64)
+		PATH_SUFFIXES lib lib64
+)
+
+find_library(CELIX_DFI_LIBRARY NAMES celix_dfi
+		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
+		PATH_SUFFIXES lib lib64
+)
 
 find_program(CELIX_LAUNCHER NAMES celix
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-		PATH_SUFFIXES bin)
+		PATH_SUFFIXES bin
+)
 
 find_file(CELIX_CMAKECELIX_FILE CMakeCelix.cmake
              	PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-             	PATH_SUFFIXES share/celix/cmake/modules)
+             	PATH_SUFFIXES share/celix/cmake/modules
+)
 
 #NOTE assuming shell.zip is always installed.
 find_path(CELIX_BUNDLES_DIR shell.zip
 		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-          	PATH_SUFFIXES share/celix/bundles)
+          	PATH_SUFFIXES share/celix/bundles
+)
 	
 
 

http://git-wip-us.apache.org/repos/asf/celix/blob/b19a8f6b/cmake/cmake_celix/Packaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Packaging.cmake b/cmake/cmake_celix/Packaging.cmake
index ccdc33c..0521261 100644
--- a/cmake/cmake_celix/Packaging.cmake
+++ b/cmake/cmake_celix/Packaging.cmake
@@ -496,23 +496,28 @@ $<JOIN:$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_PROPERTIES>,
     set(PATHS "${CMAKE_BIN_DIRECTORY}/framework:${CMAKE_BIN_DIRECTORY}/utils:${CMAKE_BIN_DIRECTORY}/dfi")
     configure_file("${CELIX_CMAKE_DIRECTORY}/cmake_celix/RunConfig.in"  "${DEPLOY_LOCATION}/${DEPLOY_NAME}")
 
+    if(APPLE)
+        set(LIB_PATH_NAME "DYLD_LIBRARY_PATH")
+    else()
+        set(LIB_PATH_NAME "LD_LIBRARY_PATH")
+    endif()
 
-    if(APPLE) 
-        file(GENERATE
-            OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export DYLD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${DYLD_LIBRARY_PATH}
-$<TARGET_FILE:celix> $@
-"
-    )
-    else() 
-        file(GENERATE
-            OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export LD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${LD_LIBRARY_PATH}
-$<TARGET_FILE:celix> $@
-"
-    )
+    if (EXISTS ${CELIX_FRAMEWORK_LIBRARY}) 
+        #Celix Based Project
+        get_filename_component(CELIX_LIB_DIR ${CELIX_FRAMEWORK_LIBRARY} DIRECTORY) #Note assuming all celix libs are in the same dir
+        set(RUN_CONTENT "export ${LIB_PATH_NAME}=${CELIX_LIB_DIR}:\${${LIB_PATH_NAME}}
+${CELIX_LAUNCHER} $@")
+    else()
+        #Celix Main Project
+        set(RUN_CONTENT "export ${LIB_PATH_NAME}=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${${LIB_PATH_NAME}}
+$<TARGET_FILE:celix> $@")
     endif()
 
+    file(GENERATE
+        OUTPUT ${DEPLOY_LOCATION}/run.sh
+        CONTENT ${RUN_CONTENT}
+    )
+
     #TODO eclipse launcher file
     #####
 


[36/50] celix git commit: CELIX-352: Added support for an framework extender path to load descriptors from the framework bundle.

Posted by pn...@apache.org.
CELIX-352: Added support for an framework extender path to load descriptors from the framework bundle.


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

Branch: refs/heads/release/celix-2.0.0
Commit: 58f521f6a10973d3dd84c99538e165bcb2ec11ac
Parents: 91ba2a1
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 11 16:40:20 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 11 16:40:20 2016 +0100

----------------------------------------------------------------------
 dependency_manager/CMakeLists.txt               |  18 ++--
 remote_services/remote_service_admin/README.md  |   1 +
 .../remote_service_admin_dfi/rsa/CMakeLists.txt |   1 +
 .../rsa/private/include/dfi_utils.h             |  30 ++++++
 .../private/include/import_registration_dfi.h   |   1 +
 .../rsa/private/src/dfi_utils.c                 | 100 +++++++++++++++++++
 .../rsa/private/src/export_registration_dfi.c   |  47 ++++-----
 .../rsa/private/src/import_registration_dfi.c   |  29 ++----
 8 files changed, 170 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/dependency_manager/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/dependency_manager/CMakeLists.txt b/dependency_manager/CMakeLists.txt
index 7a2761b..8c1f74f 100644
--- a/dependency_manager/CMakeLists.txt
+++ b/dependency_manager/CMakeLists.txt
@@ -49,15 +49,15 @@ if (DEPENDENCY_MANAGER)
     	private/src/dm_dependency_manager_impl
     )
 
-    #add_library(dependency_manager SHARED 
-    #	private/src/dm_activator_base 
-    #	private/src/dm_component_impl 
-    #	private/src/dm_service_dependency
-    # 	private/src/dm_event
-    #   private/src/dm_dependency_manager_impl
-    #)
-    #set_target_properties(dependency_manager PROPERTIES SOVERSION 1)
-    #target_link_libraries(dependency_manager celix_framework -undefined dynamic_load)
+    add_library(dependency_manager_so SHARED 
+    	private/src/dm_activator_base 
+    	private/src/dm_component_impl 
+    	private/src/dm_service_dependency
+    	private/src/dm_event
+        private/src/dm_dependency_manager_impl
+    )
+    set_target_properties(dependency_manager_so PROPERTIES SOVERSION 1)
+    target_link_libraries(dependency_manager_so celix_framework)
 
    	include_directories("public/include")
    	include_directories("private/include")

http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/remote_services/remote_service_admin/README.md
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin/README.md b/remote_services/remote_service_admin/README.md
index a2ee5cd..c4bdebd 100644
--- a/remote_services/remote_service_admin/README.md
+++ b/remote_services/remote_service_admin/README.md
@@ -8,3 +8,4 @@ Note that this folder contains code commonly used by the RSA implementations and
 
 ###### Properties
     ENDPOINTS				 defines the relative directory where endpoints and proxys can be found (default: endpoints)
+    CELIX_FRAMEWORK_EXTENDER_PATH  Used in RSA_DFI only. Can be used to define a path to use as an extender path point for the framework bundle. For normal bundles the bundle cache is used. 

http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/remote_services/remote_service_admin_dfi/rsa/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/CMakeLists.txt b/remote_services/remote_service_admin_dfi/rsa/CMakeLists.txt
index 17a0c02..c1a2150 100644
--- a/remote_services/remote_service_admin_dfi/rsa/CMakeLists.txt
+++ b/remote_services/remote_service_admin_dfi/rsa/CMakeLists.txt
@@ -36,6 +36,7 @@ add_bundle(remote_service_admin_dfi
     private/src/remote_service_admin_activator.c
     private/src/export_registration_dfi.c
     private/src/import_registration_dfi.c
+    private/src/dfi_utils.c
 
     ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/endpoint_description.c
 

http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/remote_services/remote_service_admin_dfi/rsa/private/include/dfi_utils.h
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/include/dfi_utils.h b/remote_services/remote_service_admin_dfi/rsa/private/include/dfi_utils.h
new file mode 100644
index 0000000..cec8aa1
--- /dev/null
+++ b/remote_services/remote_service_admin_dfi/rsa/private/include/dfi_utils.h
@@ -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.
+ */
+#ifndef DFI_UTILS_H_
+#define DFI_UTILS_H_
+
+#include "bundle.h"
+#include "bundle_context.h"
+#include <stdio.h>
+#include "celix_errno.h"
+
+
+celix_status_t dfi_findDescriptor(bundle_context_pt context, bundle_pt bundle, const char *name, FILE **out);
+
+#endif

http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/remote_services/remote_service_admin_dfi/rsa/private/include/import_registration_dfi.h
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/include/import_registration_dfi.h b/remote_services/remote_service_admin_dfi/rsa/private/include/import_registration_dfi.h
index 53eb604..aac4bc7 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/include/import_registration_dfi.h
+++ b/remote_services/remote_service_admin_dfi/rsa/private/include/import_registration_dfi.h
@@ -21,6 +21,7 @@
 #define CELIX_IMPORT_REGISTRATION_DFI_H
 
 #include "import_registration.h"
+#include "dfi_utils.h"
 
 #include <celix_errno.h>
 

http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c b/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
new file mode 100644
index 0000000..e9888f9
--- /dev/null
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
@@ -0,0 +1,100 @@
+/**
+ *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 "dfi_utils.h"
+#include <stdlib.h>
+#include <unistd.h>
+
+static celix_status_t dfi_findFileForFramework(bundle_context_pt context, const char *fileName, FILE **out) {
+    celix_status_t  status;
+
+    char cwd[1024];
+    char *extPath = NULL;
+    char path[1024];
+   
+    status = bundleContext_getProperty(context, "CELIX_FRAMEWORK_EXTENDER_PATH", &extPath);
+    if (status != CELIX_SUCCESS || extPath == NULL) {
+        getcwd(cwd, sizeof(cwd));
+        extPath = cwd;
+        if (extPath == NULL) {
+            status = CELIX_FILE_IO_EXCEPTION;
+        }
+    }
+
+    snprintf(path, sizeof(path), "%s/%s", extPath, fileName);
+
+    if (status == CELIX_SUCCESS) {
+        FILE *df = fopen(path, "r");
+        if (df == NULL) {
+            status = CELIX_FILE_IO_EXCEPTION;
+        } else {
+            *out = df;
+        }
+    }
+
+    return status;
+}
+
+static celix_status_t dfi_findFileForBundle(bundle_pt bundle, const char *fileName, FILE **out) {
+    celix_status_t  status;
+
+    char *path = NULL;
+    char metaInfFileName[128];
+    snprintf(metaInfFileName, sizeof(metaInfFileName), "META-INF/descriptors/%s", fileName);
+
+    status = bundle_getEntry(bundle, (char *)fileName, &path);
+    
+    if (status != CELIX_SUCCESS || path == NULL) {
+        status = bundle_getEntry(bundle, metaInfFileName, &path);
+    }
+
+    if (status == CELIX_SUCCESS && path != NULL) {
+        FILE *df = fopen(path, "r");
+        if (df == NULL) {
+            status = CELIX_FILE_IO_EXCEPTION;
+        } else {
+            *out = df;
+        }
+
+        free(path);
+    }
+    return status;
+}
+
+celix_status_t dfi_findDescriptor(bundle_context_pt context, bundle_pt bundle, const char *name, FILE **out) {
+    celix_status_t  status;
+    char fileName[128];
+
+    snprintf(fileName, 128, "%s.descriptor", name);
+
+    long id;
+    status = bundle_getBundleId(bundle, &id);
+    
+    if (status == CELIX_SUCCESS) {
+        if (id == 0) {
+            //framework bundle
+            status = dfi_findFileForFramework(context, fileName, out);
+        } else {
+            //normal bundle
+            status = dfi_findFileForBundle(bundle, fileName, out);
+        }
+    }
+
+    return status;
+}

http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
index 6eb4b86..a8d61ff 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/export_registration_dfi.c
@@ -27,6 +27,7 @@
 #include <json_rpc.h>
 #include "constants.h"
 #include "export_registration_dfi.h"
+#include "dfi_utils.h"
 
 struct export_reference {
     endpoint_description_pt endpoint; //owner
@@ -83,44 +84,30 @@ celix_status_t exportRegistration_create(log_helper_pt helper, service_reference
     bundle_pt bundle = NULL;
     CELIX_DO_IF(status, serviceReference_getBundle(reference, &bundle));
 
-
-    char *descriptorFile = NULL;
+    FILE *descriptor = NULL;
     if (status == CELIX_SUCCESS) {
-        char name[128];
-        snprintf(name, 128, "%s.descriptor", exports);
-        status = bundle_getEntry(bundle, name, &descriptorFile);
-        logHelper_log(helper, OSGI_LOGSERVICE_DEBUG, "RSA: Found descriptor '%s' for %'s'.", descriptorFile, exports);
+        status = dfi_findDescriptor(context, bundle, exports, &descriptor);
     }
 
-    if (descriptorFile == NULL) {
-        logHelper_log(helper, OSGI_LOGSERVICE_ERROR, "RSA: Cannot find descrriptor in bundle for service '%s'", exports);
-        status = CELIX_ILLEGAL_ARGUMENT;
+    if (status != CELIX_SUCCESS || descriptor == NULL) {
+        status = CELIX_BUNDLE_EXCEPTION;
+        logHelper_log(helper, OSGI_LOGSERVICE_ERROR, "Cannot find/open descriptor for '%s'", exports);
     }
 
     if (status == CELIX_SUCCESS) {
-        FILE *df = fopen(descriptorFile, "r");
-        if (df != NULL) {
-            int rc = dynInterface_parse(df, &reg->intf);
-            fclose(df);
-            if (rc != 0) {
-                status = CELIX_BUNDLE_EXCEPTION;
-                logHelper_log(helper, OSGI_LOGSERVICE_WARNING, "RSA: Error parsing service descriptor.");
-            }
-            else{
-                /* Add the interface version as a property in the properties_map */
-                char* intfVersion = NULL;
-                dynInterface_getVersionString(reg->intf, &intfVersion);
-                properties_set(endpoint->properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION, intfVersion);
-            }
-        } else {
+        int rc = dynInterface_parse(descriptor, &reg->intf);
+        fclose(descriptor);
+        if (rc != 0) {
             status = CELIX_BUNDLE_EXCEPTION;
-            logHelper_log(helper, OSGI_LOGSERVICE_ERROR, "Cannot open descriptor '%s'", descriptorFile);
+            logHelper_log(helper, OSGI_LOGSERVICE_WARNING, "RSA: Error parsing service descriptor.");
         }
-
-        free(descriptorFile);
-    }
-
-
+        else{
+            /* Add the interface version as a property in the properties_map */
+            char* intfVersion = NULL;
+            dynInterface_getVersionString(reg->intf, &intfVersion);
+            properties_set(endpoint->properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION, intfVersion);
+        }
+    } 
 
     if (status == CELIX_SUCCESS) {
         service_tracker_customizer_pt cust = NULL;

http://git-wip-us.apache.org/repos/asf/celix/blob/58f521f6/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
index 16e27a5..ee1dbbf 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
@@ -196,29 +196,22 @@ celix_status_t importRegistration_getService(import_registration_pt import, bund
 static celix_status_t importRegistration_createProxy(import_registration_pt import, bundle_pt bundle, struct service_proxy **out) {
     celix_status_t  status;
     dyn_interface_type* intf = NULL;
-    char *descriptorFile = NULL;
-    char name[128];
+    FILE *descriptor = NULL;
 
-    snprintf(name, 128, "%s.descriptor", import->classObject);
-    status = bundle_getEntry(bundle, name, &descriptorFile);
-    if (descriptorFile == NULL) {
-        printf("Cannot find entry '%s'\n", name);
-        status = CELIX_ILLEGAL_ARGUMENT;
-    } else {
-        printf("Found descriptor at '%s'\n", descriptorFile);
+    status = dfi_findDescriptor(import->context, bundle, import->classObject, &descriptor);
+
+    if (status != CELIX_SUCCESS || descriptor == NULL) {
+        status = CELIX_BUNDLE_EXCEPTION;
+        //TODO use log helper logHelper_log(helper, OSGI_LOGSERVICE_ERROR, "Cannot find/open descriptor for '%s'", import->classObject);
+        fprintf(stderr, "RSA_DFI: Cannot find/open descriptor for '%s'", import->classObject);
     }
 
     if (status == CELIX_SUCCESS) {
-        FILE *df = fopen(descriptorFile, "r");
-        if (df != NULL) {
-            int rc = dynInterface_parse(df, &intf);
-            fclose(df);
-            if (rc != 0) {
-                status = CELIX_BUNDLE_EXCEPTION;
-            }
+        int rc = dynInterface_parse(descriptor, &intf);
+        fclose(descriptor);
+        if (rc != 0) {
+            status = CELIX_BUNDLE_EXCEPTION;
         }
-
-        free(descriptorFile);
     }
 
     /* Check if the imported service version is compatible with the one in the consumer descriptor */


[18/50] celix git commit: CELIX-335: Fix in bundle CMakeLists.txt generation. Added bundle_target to add_bundle command.

Posted by pn...@apache.org.
CELIX-335: Fix in bundle CMakeLists.txt generation. Added bundle_target to add_bundle command.


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

Branch: refs/heads/release/celix-2.0.0
Commit: b2b8505a27c6215c7772dd322aab1f2f3fae92b9
Parents: a733db4
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 10:51:42 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 10:51:42 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b2b8505a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
index d96c422..c5d280f 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
@@ -30,6 +30,7 @@ include_directories(
 
 add_bundle(
 #{{ 
+#cog.outl("\t%s" % bundle['name'])
 #cog.outl("\tNAME \"%s\"" % bundle['name'])
 #cog.outl("\tSYMBOLIC_NAME \"%s\"" % bundle['symbolicName']) 
 #cog.outl("\tVERSION \"0.0.1\"")


[50/50] celix git commit: CELIX-353: Moved component_getBundleContext from private include to public. Fixed typo in bundle name dm_shell

Posted by pn...@apache.org.
CELIX-353: Moved component_getBundleContext from private include to public. Fixed typo in bundle name dm_shell


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

Branch: refs/heads/release/celix-2.0.0
Commit: 720b64b8663f4df9384f94e1a3dc5ae1ad99753a
Parents: f741eb4
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Apr 5 17:21:12 2016 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Apr 5 17:21:12 2016 +0200

----------------------------------------------------------------------
 dependency_manager/CMakeLists.txt                      | 2 +-
 dependency_manager/private/include/dm_component_impl.h | 2 --
 dependency_manager/public/include/dm_component.h       | 2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/720b64b8/dependency_manager/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/dependency_manager/CMakeLists.txt b/dependency_manager/CMakeLists.txt
index 4f85e3c..4c7c3f8 100644
--- a/dependency_manager/CMakeLists.txt
+++ b/dependency_manager/CMakeLists.txt
@@ -31,7 +31,7 @@ if (DEPENDENCY_MANAGER)
     endif(UNIX AND NOT WIN32)
 
     add_bundle(dm_shell
-        SYMBOLIC_NAME "apche_celix_dm_shell"
+        SYMBOLIC_NAME "apache_celix_dm_shell"
         VERSION "0.0.1"
         NAME "Apache Celix DM Shell Commands"
         SOURCES

http://git-wip-us.apache.org/repos/asf/celix/blob/720b64b8/dependency_manager/private/include/dm_component_impl.h
----------------------------------------------------------------------
diff --git a/dependency_manager/private/include/dm_component_impl.h b/dependency_manager/private/include/dm_component_impl.h
index 418b022..bb093ff 100644
--- a/dependency_manager/private/include/dm_component_impl.h
+++ b/dependency_manager/private/include/dm_component_impl.h
@@ -36,8 +36,6 @@
 celix_status_t component_start(dm_component_pt component);
 celix_status_t component_stop(dm_component_pt component);
 
-celix_status_t component_getBundleContext(dm_component_pt component, bundle_context_pt *context);
-
 celix_status_t component_handleEvent(dm_component_pt component, dm_service_dependency_pt dependency, dm_event_pt event);
 
 #endif /* COMPONENT_IMPL_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/720b64b8/dependency_manager/public/include/dm_component.h
----------------------------------------------------------------------
diff --git a/dependency_manager/public/include/dm_component.h b/dependency_manager/public/include/dm_component.h
index 5e2b277..65c4609 100644
--- a/dependency_manager/public/include/dm_component.h
+++ b/dependency_manager/public/include/dm_component.h
@@ -67,6 +67,8 @@ dm_component_state_t component_currentState(dm_component_pt cmp);
 void * component_getImplementation(dm_component_pt cmp);
 const char * component_getName(dm_component_pt cmp);
 
+celix_status_t component_getBundleContext(dm_component_pt component, bundle_context_pt *out);
+
 #define component_setCallbacksSafe(dmCmp, type, init, start, stop, deinit) \
     do {  \
         int (*tmp_init)(type)   = (init); \


[44/50] celix git commit: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/celix into develop

Posted by pn...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/celix into develop


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

Branch: refs/heads/release/celix-2.0.0
Commit: b13a5f8df4984950344cf8385540300d2f7c4645
Parents: 0251da2 b26889c
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Feb 16 14:57:12 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Feb 16 14:57:12 2016 +0100

----------------------------------------------------------------------
 .../remote_service_admin_dfi/rsa/private/src/dfi_utils.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[24/50] celix git commit: CELIX-269: Fixes issue in dependency manager when providing NULL as properties for a provided services

Posted by pn...@apache.org.
CELIX-269: Fixes issue in dependency manager when providing NULL as properties for a provided services


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

Branch: refs/heads/release/celix-2.0.0
Commit: 6bf16bd8c983cf3fe83c1ccd19334edf0944b8a9
Parents: ea9a5a8
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Mon Feb 8 20:14:41 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Mon Feb 8 20:14:41 2016 +0100

----------------------------------------------------------------------
 dependency_manager/private/src/dm_component_impl.c | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/6bf16bd8/dependency_manager/private/src/dm_component_impl.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_component_impl.c b/dependency_manager/private/src/dm_component_impl.c
index 9b5cdbe..0d9745e 100644
--- a/dependency_manager/private/src/dm_component_impl.c
+++ b/dependency_manager/private/src/dm_component_impl.c
@@ -335,6 +335,10 @@ celix_status_t component_addInterface(dm_component_pt component, char *serviceNa
         dm_interface_t *interface = (dm_interface_t *) calloc(1, sizeof(*interface));
         char *name = strdup(serviceName);
 
+        if (properties == NULL) {
+            properties = properties_create();
+        }
+
         if ((properties_get(properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION) == NULL) && (serviceVersion != NULL)) {
             properties_set(properties, (char*) CELIX_FRAMEWORK_SERVICE_VERSION, serviceVersion);
         }


[08/50] celix git commit: CELIX-335: Move deploy timestamp file to CMAKE_CURRENT_BINARY_DIR. Update run.sh to reuse existing (DY)LD_LIBRARY_PATH

Posted by pn...@apache.org.
CELIX-335: Move deploy timestamp file to CMAKE_CURRENT_BINARY_DIR. Update run.sh to reuse existing (DY)LD_LIBRARY_PATH


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

Branch: refs/heads/release/celix-2.0.0
Commit: 89eaab3239545f22c66ded58af8f176a686f0246
Parents: edf549c
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 3 09:40:00 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 3 09:40:00 2016 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/Packaging.cmake | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/89eaab32/cmake/cmake_celix/Packaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Packaging.cmake b/cmake/cmake_celix/Packaging.cmake
index bde696b..3fcf070 100644
--- a/cmake/cmake_celix/Packaging.cmake
+++ b/cmake/cmake_celix/Packaging.cmake
@@ -464,13 +464,15 @@ function(add_deploy)
 
 
     ###### Setup deploy custom target and config.properties file
+    set(TIMESTAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${DEPLOY_TARGET}-timestamp")
+
     add_custom_target(${DEPLOY_TARGET}
-        DEPENDS  "${DEPLOY_LOCATION}/timestamp"
+        DEPENDS ${TIMESTAMP_FILE}
     )
     add_dependencies(deploy ${DEPLOY_TARGET})
 
-    add_custom_command(OUTPUT ${DEPLOY_LOCATION}/timestamp
-        COMMAND ${CMAKE_COMMAND} -E touch ${DEPLOY_LOCATION}/timestamp
+    add_custom_command(OUTPUT "${TIMESTAMP_FILE}"
+        COMMAND ${CMAKE_COMMAND} -E touch ${TIMESTAMP_FILE}
         DEPENDS  "$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_TARGET_DEPS>" "${DEPLOY_LOCATION}/config.properties" "${DEPLOY_LOCATION}/run.sh" 
         WORKING_DIRECTORY "${DEPLOY_LOCATION}"
         COMMENT "Deploying ${DEPLOY_PRINT_NAME}" VERBATIM
@@ -501,14 +503,14 @@ $<JOIN:$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_PROPERTIES>,
     if(APPLE) 
         file(GENERATE
             OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export DYLD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>
+            CONTENT "export DYLD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${DYLD_LIBRARY_PATH}
 $<TARGET_FILE:celix> $@
 "
     )
     else() 
         file(GENERATE
             OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export LD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>
+            CONTENT "export LD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${LD_LIBRARY_PATH}
 $<TARGET_FILE:celix> $@
 "
     )


[45/50] celix git commit: CELIX-347: Using build options for ADDRESS SANTIZE

Posted by pn...@apache.org.
CELIX-347: Using build options for ADDRESS SANTIZE


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

Branch: refs/heads/release/celix-2.0.0
Commit: e0ab154b7e189537bd6ec395300b678bd9e5bf5c
Parents: b13a5f8
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Feb 16 15:53:46 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Feb 16 15:53:46 2016 +0100

----------------------------------------------------------------------
 .travis.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e0ab154b/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 3e8b170..8f8042a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -74,9 +74,11 @@ before_script:
     - export BUILD_OPTIONS_OSX=" \
         -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF \
         -DBUILD_RSA_DISCOVERY_SHM=OFF "
+    - export BUILD_OPTIONS_SANITIZE=" -DENABLE_ADDRESS_SANITIZER=ON"
 
 script:
-    - if [ "$SANITIZE" == 1 ]; then export CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 CFLAGS="-lasan -fsanitize=address"  CXXFLAGS="-lasan -fsanitize=address" ASAN_OPTIONS="symbolize=1" ASAN_SYMBOLIZER_PATH="/usr/local/clang-3.4/bin/llvm-symbolizer"; fi
+    #- if [ "$SANITIZE" == 1 ]; then export CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 CFLAGS="-lasan -fsanitize=address"  CXXFLAGS="-lasan -fsanitize=address" ASAN_OPTIONS="symbolize=1" ASAN_SYMBOLIZER_PATH="/usr/local/clang-3.4/bin/llvm-symbolizer"; fi
+    - if [ "$SANITIZE" == 1 ]; then export BUILD_OPTIONS="${BUILD_OPTIONS} ${BUILD_OPTIONS_SANITIZE}"; fi
      # the following setup is broken:
      # RSA_DISCOVERY_SHM is only working on linux, but both compilers (see CELIX-277)
      # RSA_SHM is only working on linux, but both compilers (see CELIX-277)


[39/50] celix git commit: CELIX-351: Fix issue in service_registry incorrectly handling service references when service listeners are removed and some small issue concerning serv ref handling.

Posted by pn...@apache.org.
CELIX-351: Fix issue in service_registry incorrectly handling service references when service listeners are removed and some small issue concerning serv ref handling.


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

Branch: refs/heads/release/celix-2.0.0
Commit: e0812b00df02655f9e3994c4b48e07f82c434e4a
Parents: b990dde
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 12 14:01:08 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 12 14:01:08 2016 +0100

----------------------------------------------------------------------
 dependency_manager/private/src/dm_service_dependency.c | 1 +
 framework/private/src/framework.c                      | 6 ++----
 framework/private/src/service_reference.c              | 4 +---
 framework/private/src/service_tracker.c                | 1 +
 4 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e0812b00/dependency_manager/private/src/dm_service_dependency.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_service_dependency.c b/dependency_manager/private/src/dm_service_dependency.c
index 11ea28b..4e77175 100644
--- a/dependency_manager/private/src/dm_service_dependency.c
+++ b/dependency_manager/private/src/dm_service_dependency.c
@@ -456,6 +456,7 @@ celix_status_t serviceDependency_invokeSet(dm_service_dependency_pt dependency,
         } else {
             return status;
         }
+
     }
 
     arrayList_destroy(serviceReferences);

http://git-wip-us.apache.org/repos/asf/celix/blob/e0812b00/framework/private/src/framework.c
----------------------------------------------------------------------
diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c
index 56b02cd..6190121 100644
--- a/framework/private/src/framework.c
+++ b/framework/private/src/framework.c
@@ -1454,12 +1454,10 @@ void fw_removeServiceListener(framework_pt framework, bundle_pt bundle, service_
             int k;
             int rSize = arrayList_size(element->retainedReferences);
             for (k = 0; k < rSize; k += 1) {
-                service_reference_pt ref = arrayList_get(element->retainedReferences, i);
+                service_reference_pt ref = arrayList_get(element->retainedReferences, k);
                 if (ref != NULL) {
                     serviceRegistry_ungetServiceReference(framework->registry, element->bundle, ref); // decrease retain counter                                       
-                } else {
-                    //TODO,FIXME ref is sometimes NULL. This should not happen, investigate why
-                }
+                } 
             }
 
 			element->bundle = NULL;

http://git-wip-us.apache.org/repos/asf/celix/blob/e0812b00/framework/private/src/service_reference.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_reference.c b/framework/private/src/service_reference.c
index 3f1adff..c40d3c2 100644
--- a/framework/private/src/service_reference.c
+++ b/framework/private/src/service_reference.c
@@ -191,9 +191,7 @@ celix_status_t serviceReference_getOwner(service_reference_pt ref, bundle_pt *ow
 
 celix_status_t serviceReference_getServiceRegistration(service_reference_pt ref, service_registration_pt *out) {
     celixThreadRwlock_readLock(&ref->lock);
-    if (ref != NULL) {
-        *out = ref->registration;
-    }
+    *out = ref->registration;
     celixThreadRwlock_unlock(&ref->lock);
     return CELIX_SUCCESS;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/e0812b00/framework/private/src/service_tracker.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_tracker.c b/framework/private/src/service_tracker.c
index 546ee5d..1fb9b37 100644
--- a/framework/private/src/service_tracker.c
+++ b/framework/private/src/service_tracker.c
@@ -132,6 +132,7 @@ celix_status_t serviceTracker_open(service_tracker_pt tracker) {
 			for (i = 0; i < arrayList_size(initial); i++) {
 				initial_reference = (service_reference_pt) arrayList_get(initial, i);
 				serviceTracker_track(tracker, initial_reference, NULL);
+                bundleContext_ungetServiceReference(tracker->context, initial_reference);
 			}
 			arrayList_clear(initial);
 			arrayList_destroy(initial);


[22/50] celix git commit: CELIX-335: Disable config_admin, issue for osx. Disable Android.

Posted by pn...@apache.org.
CELIX-335: Disable config_admin, issue for osx. Disable Android.

Android currently does not build because CMake 2.8 is used. A upgrade in the DockerFile is needed.


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

Branch: refs/heads/release/celix-2.0.0
Commit: 3a45281872bac1f0b5ef539e509ed17977b5a2de
Parents: 2e31fdd
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 14:52:26 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 14:52:26 2016 +0100

----------------------------------------------------------------------
 .travis.yml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/3a452818/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 7448d72..c0d2075 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,9 +31,9 @@ matrix:
        - os: linux
          compiler: gcc
          env: SANITIZE=1
-       - os: linux
-         compiler: clang
-         env: ANDROID=1
+#       - os: linux
+#         compiler: clang
+#         env: ANDROID=1
 
 
 before_install:
@@ -53,7 +53,7 @@ before_script:
     - cd -
     - mkdir build install
     - export BUILD_OPTIONS=" \
-        -DBUILD_CONFIG_ADMIN=ON \
+        -DBUILD_CONFIG_ADMIN=OFF \
         -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON \
         -DBUILD_DEPLOYMENT_ADMIN=ON \
         -DBUILD_DEPENDENCY_MANAGER=ON \


[04/50] celix git commit: CELIX-66: Added initial code for config admin example.

Posted by pn...@apache.org.
CELIX-66: Added initial code for config admin example.


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

Branch: refs/heads/release/celix-2.0.0
Commit: d5666c57106dacc9a5bfb81e18ebc11806d7afa7
Parents: 2eac60e
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jan 26 15:49:59 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jan 26 15:49:59 2016 +0100

----------------------------------------------------------------------
 config_admin/CMakeLists.txt                     |  2 +-
 config_admin/deploy.cmake                       |  7 +-
 config_admin/example/CMakeLists.txt             | 28 ++++++++
 config_admin/example/private/include/example.h  | 18 +++++
 .../example/private/src/bundle_activator.c      | 75 ++++++++++++++++++++
 config_admin/example/private/src/example.c      | 46 ++++++++++++
 6 files changed, 171 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/d5666c57/config_admin/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/CMakeLists.txt b/config_admin/CMakeLists.txt
index 3801e6e..ff2ad15 100644
--- a/config_admin/CMakeLists.txt
+++ b/config_admin/CMakeLists.txt
@@ -20,7 +20,7 @@ celix_subproject(CONFIG_ADMIN "Option to enable building the Config Admin Servic
 if (CONFIG_ADMIN)
 
 	add_subdirectory(service)
-#	add_subdirectory(examples)
+    add_subdirectory(example)
 	
 	if (ENABLE_TESTING)
 		find_package(CppUTest REQUIRED)

http://git-wip-us.apache.org/repos/asf/celix/blob/d5666c57/config_admin/deploy.cmake
----------------------------------------------------------------------
diff --git a/config_admin/deploy.cmake b/config_admin/deploy.cmake
index d1a769d..53bdfd7 100644
--- a/config_admin/deploy.cmake
+++ b/config_admin/deploy.cmake
@@ -16,9 +16,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
-if (CONFIG_ADMIN)
+if (BUILD_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)
+    deploy("config_admin" BUNDLES config_admin shell shell_tui log_service log_writer config_admin_example)
 
-endif (CONFIG_ADMIN)
+endif (BUILD_CONFIG_ADMIN)

http://git-wip-us.apache.org/repos/asf/celix/blob/d5666c57/config_admin/example/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/example/CMakeLists.txt b/config_admin/example/CMakeLists.txt
new file mode 100644
index 0000000..b19c73b
--- /dev/null
+++ b/config_admin/example/CMakeLists.txt
@@ -0,0 +1,28 @@
+
+
+SET(
+	BUNDLE_NAME 
+"config_admin_example"
+)
+
+SET(
+	BUNDLE_SYMBOLICNAME 
+"org.apache.celix.config_admin.example"
+)
+
+SET(BUNDLE_VERSION "0.0.1")
+
+include_directories(
+	"private/include"
+	"public/include"
+    ${PROJECT_SOURCE_DIR}/utils/public/include
+    ../service/public/include
+)
+
+bundle(
+config_admin_example SOURCES
+	private/src/bundle_activator
+	private/src/example
+)
+
+target_link_libraries(config_admin_example ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})

http://git-wip-us.apache.org/repos/asf/celix/blob/d5666c57/config_admin/example/private/include/example.h
----------------------------------------------------------------------
diff --git a/config_admin/example/private/include/example.h b/config_admin/example/private/include/example.h
new file mode 100644
index 0000000..7239ea5
--- /dev/null
+++ b/config_admin/example/private/include/example.h
@@ -0,0 +1,18 @@
+#ifndef __EXAMPLE_H_
+#define __EXAMPLE_H_
+
+
+
+#include <celix_errno.h>
+#include <array_list.h>
+#include <properties.h>
+
+typedef struct example *example_pt;
+
+celix_status_t example_create(example_pt *component);
+celix_status_t example_start(example_pt component);
+celix_status_t example_stop(example_pt component);
+celix_status_t example_destroy(example_pt component);
+celix_status_t example_updated(example_pt component, properties_pt updatedProperties);
+
+#endif //__EXAMPLE_H_

http://git-wip-us.apache.org/repos/asf/celix/blob/d5666c57/config_admin/example/private/src/bundle_activator.c
----------------------------------------------------------------------
diff --git a/config_admin/example/private/src/bundle_activator.c b/config_admin/example/private/src/bundle_activator.c
new file mode 100644
index 0000000..55bc11e
--- /dev/null
+++ b/config_admin/example/private/src/bundle_activator.c
@@ -0,0 +1,75 @@
+#include <stdlib.h>
+#include <pthread.h>
+
+#include <constants.h>
+#include <bundle_context.h>
+#include <service_tracker.h>
+
+#include "example.h"
+#include "managed_service.h"
+
+struct activator {
+	bundle_context_pt context;
+	example_pt example;
+	managed_service_service_pt managed;
+	service_registration_pt managedServiceRegistry;
+};
+
+celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
+	celix_status_t status = CELIX_SUCCESS;
+	struct activator *activator = calloc(1, sizeof(struct activator));
+	if (activator != NULL) {
+		(*userData) = activator;
+		activator->example = NULL;
+		example_create(&activator->example);
+		activator->managed = NULL;
+		activator->managedServiceRegistry = NULL;
+
+	} else {
+		status = CELIX_ENOMEM;
+	}
+	return status;
+}
+
+celix_status_t bundleActivator_start(void *userData, bundle_context_pt context) {
+	celix_status_t status = CELIX_SUCCESS;
+	struct activator *activator = userData;
+
+	example_start(activator->example);
+    
+    activator->managed = calloc(1, sizeof(*activator->managed));
+    properties_pt props = properties_create();
+
+	if (activator->managed != NULL && props != NULL) {
+        properties_set(props, "service.pid", "org.example.config.admin"); 
+        activator->managed->managedService = (void *)activator->example;
+        activator->managed->updated = (void *)example_updated;
+		bundleContext_registerService(context, (char *)  MANAGED_SERVICE_SERVICE_NAME, activator->managed, NULL, &activator->managedServiceRegistry);
+	}
+
+	return status;
+}
+
+celix_status_t bundleActivator_stop(void *userData, bundle_context_pt context) {
+	celix_status_t status = CELIX_SUCCESS;
+	struct activator *activator = userData;
+
+	if (activator->managed != NULL) {
+		serviceRegistration_unregister(activator->managedServiceRegistry);
+	}
+	example_stop(activator->example);
+
+	return status;
+}
+
+celix_status_t bundleActivator_destroy(void *userData, bundle_context_pt context) {
+	celix_status_t status = CELIX_SUCCESS;
+	struct activator *activator = userData;
+
+	example_destroy(activator->example);
+	if (activator->managed != NULL) {
+		free(activator->managed);
+	}
+
+	return status;
+}

http://git-wip-us.apache.org/repos/asf/celix/blob/d5666c57/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
new file mode 100644
index 0000000..9158943
--- /dev/null
+++ b/config_admin/example/private/src/example.c
@@ -0,0 +1,46 @@
+#include <stdlib.h>
+
+#include <pthread.h>
+
+#include "example.h"
+
+struct example {
+};
+
+//Create function
+celix_status_t example_create(example_pt *result) {
+	celix_status_t status = CELIX_SUCCESS;
+	
+    example_pt component = calloc(1, sizeof(*component));
+	if (component != NULL) {
+		(*result) = component;
+	} else {
+		status = CELIX_ENOMEM;
+	}	
+	return status;
+}
+
+celix_status_t example_destroy(example_pt component) {
+	celix_status_t status = CELIX_SUCCESS;
+	if (component != NULL) {
+		free(component);
+	} else {
+		status = CELIX_ILLEGAL_ARGUMENT;
+	}
+	return status;
+}
+
+celix_status_t example_start(example_pt component) {
+	celix_status_t status = CELIX_SUCCESS;
+	return status;
+}
+
+celix_status_t example_stop(example_pt component) {
+	celix_status_t status = CELIX_SUCCESS;
+	return status;
+}
+
+celix_status_t example_updated(example_pt component, properties_pt updatedProperties) {
+    printf("updated called\n");
+    return CELIX_SUCCESS;
+}


[48/50] celix git commit: CELIX-347: Add install command for dep man so file

Posted by pn...@apache.org.
CELIX-347: Add install command for dep man so file


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

Branch: refs/heads/release/celix-2.0.0
Commit: e6ebebba7b2c8c941ed26684bff27bcf35f9e327
Parents: 9ba3832
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 17 09:28:14 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 17 09:28:14 2016 +0100

----------------------------------------------------------------------
 dependency_manager/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e6ebebba/dependency_manager/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/dependency_manager/CMakeLists.txt b/dependency_manager/CMakeLists.txt
index 5ec35ec..4f85e3c 100644
--- a/dependency_manager/CMakeLists.txt
+++ b/dependency_manager/CMakeLists.txt
@@ -84,4 +84,5 @@ if (DEPENDENCY_MANAGER)
     install_bundle(dm_shell)
     #install(TARGETS dependency_manager dependency_manager_static DESTINATION lib COMPONENT dependency_manager)
     install(TARGETS dependency_manager_static DESTINATION lib COMPONENT dependency_manager)
+    install(TARGETS dependency_manager_so DESTINATION lib COMPONENT dependency_manager)
 endif (DEPENDENCY_MANAGER)


[10/50] celix git commit: CELIX-335: Cleanup of unneeded commands/comments in Packaging.cmake

Posted by pn...@apache.org.
CELIX-335: Cleanup of unneeded commands/comments in Packaging.cmake


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

Branch: refs/heads/release/celix-2.0.0
Commit: 1d00b446b494b77067d42ae21ba512621777568f
Parents: 8a8292b
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 4 15:21:38 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 4 15:21:38 2016 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/Packaging.cmake | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/1d00b446/cmake/cmake_celix/Packaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Packaging.cmake b/cmake/cmake_celix/Packaging.cmake
index 3fcf070..ccdc33c 100644
--- a/cmake/cmake_celix/Packaging.cmake
+++ b/cmake/cmake_celix/Packaging.cmake
@@ -71,8 +71,6 @@ function(set_library_version TARGET VERSION)
         #This is simpeler than using the <current>:<revision>:<age> approach of libtool
         set_property(TARGET ${TARGET} PROPERTY VERSION "${VERSION}")
         set_property(TARGET ${TARGET} PROPERTY SOVERSION ${MAJOR})
-        #set_property(TARGET ${TARGET} PROPERTY VERSION "${VERSION}")
-        #message("target '${TARGET}' with provided version '${VERSION}' has version parts: '${MAJOR}' '${MINOR}' '${PATCH}'")
     else ()
         message(WARNING "set_library_version: Cannot set version info TARGET and/or VERSION not provided")
     endif ()
@@ -151,7 +149,6 @@ function(add_bundle)
         add_library(${BUNDLE_TARGET_NAME} SHARED ${BUNDLE_SOURCES})
         set_library_version(${BUNDLE_TARGET_NAME} ${BUNDLE_VERSION})
         set_target_properties(${BUNDLE_TARGET_NAME} PROPERTIES "BUNDLE_TARGET_IS_LIB" TRUE)
-        add_dependencies(bundles ${BUNDLE_TARGET_NAME})
     else()
         add_custom_target(${BUNDLE_TARGET_NAME})
     endif()


[29/50] celix git commit: CELIX-348: Adds neededc cast for string hash function

Posted by pn...@apache.org.
CELIX-348: Adds neededc cast for string hash function


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

Branch: refs/heads/release/celix-2.0.0
Commit: 9012020c389e7219a1da64cbc11e85d57c62101b
Parents: 13f34df
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 10 08:46:39 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 10 08:46:39 2016 +0100

----------------------------------------------------------------------
 framework/private/src/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/9012020c/framework/private/src/utils.c
----------------------------------------------------------------------
diff --git a/framework/private/src/utils.c b/framework/private/src/utils.c
index a072623..fdb0f62 100644
--- a/framework/private/src/utils.c
+++ b/framework/private/src/utils.c
@@ -28,7 +28,8 @@
 
 #include "utils.h"
 
-unsigned int utils_stringHash(void * string) {
+unsigned int utils_stringHash(void * strPtr) {
+    char * string = strPtr;
     unsigned int hash = 5381;
     unsigned int i = 0;
     unsigned int len = strlen(string);


[02/50] celix git commit: CELIX-335: Add cmake install for osx in travis config

Posted by pn...@apache.org.
CELIX-335: Add cmake install for osx in travis config


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

Branch: refs/heads/release/celix-2.0.0
Commit: edf549c01b286dce261a74f9b838731fee77de2f
Parents: da78d30
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jan 26 11:17:03 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jan 26 11:17:03 2016 +0100

----------------------------------------------------------------------
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/edf549c0/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 905c714..3e8b170 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,7 +38,8 @@ matrix:
 
 before_install:
   - if [ "$TRAVIS_OS_NAME" = "linux" ] &&  [ -z "$ANDROID" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get -qq update && sudo apt-get install -y uuid-dev libxml2-dev lcov libffi-dev gcc-4.8 g++-4.8; fi
-  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov libffi && brew link --force libffi; fi
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew uninstall cmake; fi
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov libffi cmake && brew link --force libffi; fi
 
 before_script:
     - wget https://github.com/cpputest/cpputest.github.io/blob/master/releases/cpputest-3.7.1.tar.gz?raw=true -O /tmp/cpputest.tar.gz


[09/50] celix git commit: CELIX-335: Update in cmake command documentation

Posted by pn...@apache.org.
CELIX-335: Update in cmake command documentation


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

Branch: refs/heads/release/celix-2.0.0
Commit: 8a8292bd7c173baa4bfb9774f204a7ee1f078c09
Parents: 89eaab3
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 3 09:57:58 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 3 09:57:58 2016 +0100

----------------------------------------------------------------------
 documents/cmake_commands/readme.md | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/8a8292bd/documents/cmake_commands/readme.md
----------------------------------------------------------------------
diff --git a/documents/cmake_commands/readme.md b/documents/cmake_commands/readme.md
index e9f994e..30d863e 100644
--- a/documents/cmake_commands/readme.md
+++ b/documents/cmake_commands/readme.md
@@ -165,6 +165,15 @@ add_deploy(<deploy_target_name>
 )
 ```
 
+The provided bundle targets for a deployment do not have to exists (yet).
+This removes the need for correctly ordening the add_bundle commands so that all bundle target are present before an add_deploy command.
+If the bundle target is never added CMake will give an error:
+```
+  Error evaluating generator expression:
+
+    $<TARGET_PROPERTY:foo,BUNDLE_FILE>
+```
+
 - If COPY is provided the selected bundles will be copied in a bundles dir and the generated config.properties will use relative paths to the bundle locations. Default bundles will not be copied and the generated config.properties will use absolute references to the bundle locations.
 - If GROUP is provided the deployment will be grouped in the provided group name. 
 - If NAME is provided that name will be used for the deployment dir. Default the deploy target name will be used.


[38/50] celix git commit: CELIX-351: Moved remove service listener after untracking service in service tracker. This ensure service reference are still valid during untracking.

Posted by pn...@apache.org.
CELIX-351: Moved remove service listener after untracking service in service tracker. This ensure service reference are still valid during untracking.


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

Branch: refs/heads/release/celix-2.0.0
Commit: b990dde04edd5a106a8e39bf57158167177c267d
Parents: 9434821
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 12 09:32:57 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 12 09:32:57 2016 +0100

----------------------------------------------------------------------
 cmake/CMakeCelix.cmake                    | 1 +
 cmake/cmake_celix/BuildOptions.cmake      | 7 +++++++
 framework/private/src/service_reference.c | 4 +++-
 framework/private/src/service_tracker.c   | 4 +++-
 4 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b990dde0/cmake/CMakeCelix.cmake
----------------------------------------------------------------------
diff --git a/cmake/CMakeCelix.cmake b/cmake/CMakeCelix.cmake
index 2bff25b..0cda030 100644
--- a/cmake/CMakeCelix.cmake
+++ b/cmake/CMakeCelix.cmake
@@ -31,3 +31,4 @@ include(cmake_celix/PackagingLegacy)
 #include(cmake_celix/Test)
 include(cmake_celix/ApacheRat)
 include(cmake_celix/CodeCoverage)
+include(cmake_celix/BuildOptions)

http://git-wip-us.apache.org/repos/asf/celix/blob/b990dde0/cmake/cmake_celix/BuildOptions.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/BuildOptions.cmake b/cmake/cmake_celix/BuildOptions.cmake
new file mode 100644
index 0000000..8c5caf5
--- /dev/null
+++ b/cmake/cmake_celix/BuildOptions.cmake
@@ -0,0 +1,7 @@
+
+option(ENABLE_ADDRESS_SANITIZER "Enabled building with address sanitizer. Note for gcc libasan must be installed" OFF)
+
+if (ENABLE_ADDRESS_SANITIZER)
+    set(CMAKE_C_FLAGS "-lasan -fsanitize=address ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-lasan -fsanitize=address ${CMAKE_CXX_FLAGS}")
+endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/b990dde0/framework/private/src/service_reference.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_reference.c b/framework/private/src/service_reference.c
index c40d3c2..3f1adff 100644
--- a/framework/private/src/service_reference.c
+++ b/framework/private/src/service_reference.c
@@ -191,7 +191,9 @@ celix_status_t serviceReference_getOwner(service_reference_pt ref, bundle_pt *ow
 
 celix_status_t serviceReference_getServiceRegistration(service_reference_pt ref, service_registration_pt *out) {
     celixThreadRwlock_readLock(&ref->lock);
-    *out = ref->registration;
+    if (ref != NULL) {
+        *out = ref->registration;
+    }
     celixThreadRwlock_unlock(&ref->lock);
     return CELIX_SUCCESS;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/b990dde0/framework/private/src/service_tracker.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_tracker.c b/framework/private/src/service_tracker.c
index 92c3a92..546ee5d 100644
--- a/framework/private/src/service_tracker.c
+++ b/framework/private/src/service_tracker.c
@@ -148,7 +148,6 @@ celix_status_t serviceTracker_open(service_tracker_pt tracker) {
 celix_status_t serviceTracker_close(service_tracker_pt tracker) {
 	celix_status_t status = CELIX_SUCCESS;
 
-	status = bundleContext_removeServiceListener(tracker->context, tracker->listener);
 	if (status == CELIX_SUCCESS) {
 		array_list_pt refs = serviceTracker_getServiceReferences(tracker);
 		if (refs != NULL) {
@@ -160,6 +159,9 @@ celix_status_t serviceTracker_close(service_tracker_pt tracker) {
 		}
 		arrayList_destroy(refs);
 	}
+    if (status == CELIX_SUCCESS) {
+        status = bundleContext_removeServiceListener(tracker->context, tracker->listener);
+    }
 
 	framework_logIfError(logger, status, NULL, "Cannot close tracker");
 


[49/50] celix git commit: CELIX-272: Added missing properties for importing services

Posted by pn...@apache.org.
CELIX-272: Added missing properties for importing services


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

Branch: refs/heads/release/celix-2.0.0
Commit: f741eb4f816df066c6a8e81d9a22b25cc8339f24
Parents: e6ebebb
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Mar 9 16:37:41 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Mar 9 16:37:41 2016 +0100

----------------------------------------------------------------------
 .../rsa/private/src/import_registration_dfi.c                    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/f741eb4f/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
index ee1dbbf..2507ea8 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c
@@ -142,7 +142,9 @@ void importRegistration_destroy(import_registration_pt import) {
 celix_status_t importRegistration_start(import_registration_pt import) {
     celix_status_t  status = CELIX_SUCCESS;
     if (import->factoryReg == NULL && import->factory != NULL) {
-        status = bundleContext_registerServiceFactory(import->context, (char *)import->classObject, import->factory, NULL /*TODO*/, &import->factoryReg);
+        properties_pt props = NULL;
+        properties_copy(import->endpoint->properties, &props);
+        status = bundleContext_registerServiceFactory(import->context, (char *)import->classObject, import->factory, props, &import->factoryReg);
     } else {
         status = CELIX_ILLEGAL_STATE;
     }


[07/50] celix git commit: CELIX-236: add dependency manager code to celix bootstrap, add project deployment

Posted by pn...@apache.org.
CELIX-236: add dependency manager code to celix bootstrap, add project deployment


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

Branch: refs/heads/release/celix-2.0.0
Commit: 37010fbe6249692a9d38175a618ca61204478a11
Parents: 4228b99
Author: Bjoern Petri <bp...@apache.org>
Authored: Thu Jan 28 12:35:29 2016 +0100
Committer: Bjoern Petri <bp...@apache.org>
Committed: Thu Jan 28 12:35:29 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/celix/bootstrap/generators.py   |  19 +-
 .../bootstrap/templates/bundle/CMakeLists.txt   |  15 +-
 .../bootstrap/templates/bundle/bundle.yaml      |  62 ++-
 .../templates/bundle/bundle_activator.c         | 527 ++++---------------
 .../bootstrap/templates/bundle/component.c      | 276 +++++-----
 .../bootstrap/templates/bundle/component.h      |  84 +--
 .../bootstrap/templates/bundle/deploy.cmake     |   3 +-
 .../celix/bootstrap/templates/bundle/service.h  |  10 +-
 .../bootstrap/templates/project/CMakeLists.txt  |   3 +-
 .../bootstrap/templates/project/deploy.cmake    |   5 +-
 10 files changed, 348 insertions(+), 656 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/generators.py
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/generators.py b/celix-bootstrap/celix/bootstrap/generators.py
index 7854f3f..e9d469b 100644
--- a/celix-bootstrap/celix/bootstrap/generators.py
+++ b/celix-bootstrap/celix/bootstrap/generators.py
@@ -146,15 +146,20 @@ class Project(BaseGenerator):
 		#python3 super(Project, self).__init__(gendir, "project")
 
 	def update_cmakelists(self) :
-		options = ["-D", "projectFile=%s" % self.descriptor]
-		self.update_file("CMakeLists.txt", "CMakeLists.txt", options, "#")	
+                options = ["-D", "projectFile=%s" % self.descriptor]
+                self.update_file("CMakeLists.txt", "CMakeLists.txt", options, "#")      
 
-	def create(self) :
-		self.update_file(os.path.join(self.template_dir, self.profile, "%s.yaml" % self.profile),  "%s.yaml" % self.profile, [], None)	
+        def update_deploy_file(self) :
+                options = ["-D", "projectFile=%s" % self.descriptor]
+                self.update_file("deploy.cmake", "deploy.cmake", options, "#")  
+
+        def create(self) :
+                self.update_file(os.path.join(self.template_dir, self.profile, "%s.yaml" % self.profile),  "%s.yaml" % self.profile, [], None)  
 
 	def update(self) :
 		descriptor = self.read_descriptor()
 		if descriptor is None :
-			print("%s does not exist or does not contain a project.yaml file" % self.gendir)
-		else :
-			self.update_cmakelists()	
+                        print("%s does not exist or does not contain a project.yaml file" % self.gendir)
+                else :
+                        self.update_cmakelists()        
+                        self.update_deploy_file()

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
index a6295b2..5e1cdd8 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
@@ -36,12 +36,13 @@ SET(
 SET(BUNDLE_VERSION "0.0.1")
 
 include_directories(
-	"private/include"
-	"public/include"
+        ${CELIX_INCLUDE_DIR}/dependency_manager
+        "private/include"
+        "public/include"
 #{{ 
 #for comp in bundle['components'] : 
-#	for service in comp['serviceDependencies']:
-#			cog.outl("\t\"%s\"" % os.path.dirname(service['include'])) 
+#       for service in comp['serviceDependencies']:
+#                       cog.outl("\t\"%s\"" % os.path.abspath(os.path.dirname(service['include']))) 
 #}}
 "org.example.mybundle" #do not edit, generated code
 #{{end}}
@@ -68,4 +69,8 @@ mybundle SOURCES #do not edit, generated code
 SET(BUNDLE_LIB "mybundle") #do not edit, generated code
 #{{end}}
 
-target_link_libraries(${BUNDLE_LIB} ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
+IF(APPLE)
+target_link_libraries(${BUNDLE_LIB} ${CELIX_FRAMEWORK_LIBRARY} -Wl,-all_load dependency_manager  ${CELIX_UTILS_LIBRARY})
+else()
+target_link_libraries(${BUNDLE_LIB} -Wl,--whole-archive dependency_manager -Wl,--no-whole-archive ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
+ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
index d85030d..1bf752e 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
@@ -25,40 +25,44 @@ components:
     #		componentName = checkInput('\nPlease enter componentName', '([a-zA-Z_][a-zA-Z0-9_]*)', 'example') 
     #		cog.outl('- name: \'%s\'' % componentName )
     #		cog.outl('  providedServices:')
-    #		while yn('Should component \'%s\' provide %s service?' % (componentName, 'a' if 'psInclude' not in vars() else 'another')):
-    #			psServiceName1 = checkInput('(1) Please enter a name, which can be used for the filename and the include guards', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
-    #			psServiceName2 = checkInput('(2) Please enter a name, which is used to register and lookup the service', '([a-zA-Z_][a-zA-Z0-9_]*)', (psServiceName1.lower() + ('_service' if not psServiceName1.endswith('_service') else ''))); 
-    #			psServiceType = checkInput('(3) Please enter a type', '([a-zA-Z_][a-zA-Z0-9_]*)',  (psServiceName1.lower() + ('_service_pt' if not psServiceName1.endswith('_service_pt') else ''))  );
-    #			psInclude = checkInput('(4) Please enter the name of the include file', '(.+?)(\.[^.]*$|$)', psServiceName1.lower() + '.h'); 
+    #           while yn('Should component \'%s\' provide %s service?' % (componentName, 'a' if 'psInclude' not in vars() else 'another')):
+    #                   psServiceName1 = checkInput('(1) Please enter a name, which can be used for the filename and the include guards', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
+    #                   psServiceName2 = checkInput('(2) Please enter a name, which is used to register and lookup the service', '([a-zA-Z_][a-zA-Z0-9_]*)', (psServiceName1.lower() + ('_service' if not psServiceName1.endswith('_service') else ''))); 
+    #                   psServiceVersion = checkInput('(3) Please enter a version number', '(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)', '1.0.0.0'); 
+    #                   psServiceType = checkInput('(4) Please enter a type', '([a-zA-Z_][a-zA-Z0-9_]*)',  (psServiceName1.lower() + ('_service_t' if not psServiceName1.endswith('_service_t') else ''))  );
+    #                   psInclude = checkInput('(5) Please enter the name of the include file', '(.+?)(\.[^.]*$|$)', psServiceName1.lower() + '.h'); 
     #
-    #			print("\n Summary:")	
-    #			print("\tname :\t%s" % (psServiceName1))	
-    #			print("\tservice_name:\t%s" % (psServiceName2))	
-    #			print("\tservice_type:\t%s" % (psServiceType))	
-    #			print("\tinclude file:\t%s" % (psInclude)) 
-    #			if yn('Are those information correct?'):
-    #				cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', type: \'%s\'}' % (psInclude, psServiceName1, psServiceName2, psServiceType))
-    #			else:
-    #				print("Service was not added.")
+    #                   print("\n Summary:")    
+    #                   print("\tname :\t%s" % (psServiceName1))        
+    #                   print("\tservice_name:\t%s" % (psServiceName2)) 
+    #                   print("\tservice_version:\t%s" % (psServiceVersion))    
+    #                   print("\tservice_type:\t%s" % (psServiceType))  
+    #                   print("\tinclude file:\t%s" % (psInclude)) 
+    #                   if yn('Are those information correct?'):
+    #                           cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', service_version: \'%s\', type: \'%s\'}' % (psInclude, psServiceName1, psServiceName2, psServiceVersion, psServiceType))
+    #                   else:
+    #                           print("Service was not added.")
     #
     #		cog.outl('  serviceDependencies:')
     #		while yn('Should component \'%s\' depend on %s service?' % (componentName, 'a' if 'sdInclude' not in vars() else 'another')):
-    #			sdInclude = checkInclude('(1) Please enter the include filename, which describes the service', '(.+?)(\.[^.]*$|$)'); 
-    #			sdServiceName1 = checkInput('(2) Please enter a name, which is used to generate the code', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
-    #			sdServiceName2 = checkIncludeContent('(3) Please enter the variable/constants, which is used to register the service within the framework', sdInclude); 
-    #			sdServiceType = checkIncludeContent('(4) Please enter the type of the service', sdInclude);
-    #			sdCardinality = checkInput('(5) Please enter the cardinality (one|many|optional)', '(one)|(many)|(optional)');
+    #                   sdInclude = checkInclude('(1) Please enter the include filename, which describes the service', '(.+?)(\.[^.]*$|$)'); 
+    #                   sdServiceName1 = checkInput('(2) Please enter a name, which is used to generate the code', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
+    #                   sdServiceName2 = checkIncludeContent('(3) Please enter the variable/constants, which is used to register the service within the framework', sdInclude); 
+    #                   sdServiceRange = checkIncludeContent('(4) Please enter the variable/constants, which contains the version range', sdInclude); 
+    #                   sdServiceType = checkIncludeContent('(5) Please enter the type of the service', sdInclude);
+    #                   sdCardinality = checkInput('(6) Please enter the cardinality (one|many|optional)', '(one)|(many)|(optional)');
     #
-    #			print("\n Summary:")	
-    #			print("\tname :\t%s" % (sdServiceName1))	
-    #			print("\tservice_name:\t%s" % (sdServiceName2))	
-    #			print("\tservice_type:\t%s" % (sdServiceType))	
-    #			print("\tcardinality:\t%s" % (sdCardinality)) 
-    #			print("\tinclude file:\t%s" % (sdInclude)) 
-    #			if yn('Are those information correct?'):
-    #				cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', type: \'%s\', cardinality: \'%s\'}' % (sdInclude, sdServiceName1, sdServiceName2, sdServiceType, sdCardinality))
-    #			else:
-    #				print("Service dependency was not added.")
+    #                   print("\n Summary:")    
+    #                   print("\tname :\t%s" % (sdServiceName1))        
+    #                   print("\tservice_name:\t%s" % (sdServiceName2)) 
+    #                   print("\tservice_range:\t%s" % (sdServiceRange))        
+    #                   print("\tservice_type:\t%s" % (sdServiceType))  
+    #                   print("\tcardinality:\t%s" % (sdCardinality)) 
+    #                   print("\tinclude file:\t%s" % (sdInclude)) 
+    #                   if yn('Are those information correct?'):
+    #                           cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', service_versionrange: \'%s\', type: \'%s\', cardinality: \'%s\'}' % (sdInclude, sdServiceName1, sdServiceName2, sdServiceRange, sdServiceType, sdCardinality))
+    #                   else:
+    #                           print("Service dependency was not added.")
     #}}
     #{{end}}
 

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
index d28b73c..025eed4 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
@@ -1,5 +1,21 @@
-//TODO update fields from <service>Type to <service>For<component>Type
-
+/**
+ *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.
+ */
 //{{
 //import os, yaml
 //bundle = None 
@@ -17,7 +33,6 @@
 //}}
 //{{end}}
 #include <stdlib.h>
-
 #include <pthread.h>
 
 #include <constants.h>
@@ -25,6 +40,9 @@
 #include <service_tracker.h>
 #include <hash_map.h>
 
+#include "bundle_activator.h"
+#include "dm_activator_base.h"
+
 //Includes for the services / components
 //{{
 //for comp in bundle['components'] : 
@@ -36,448 +54,107 @@
 //}}
 //{{end}}
 
-
-
-//Private (static) function declarations
-//{{
-//for comp in bundle['components'] :
-//	cog.outl("static bundleActivator_resolveStateFor%s(struct activator *activator);" % comp['name'].title())
-//	for service in comp['serviceDependencies'] :
-//		cog.outl("static celix_status_t bundleActivator_add%sFor%s(void *handle, service_reference_pt ref, void *service);" % (service['name'].title(), comp['name'].title()))
-//		cog.outl("static celix_status_t bundleActivator_remove%sFor%s(void *handle, service_reference_pt ref, void *service);" % (service['name'].title(), comp['name'].title()))
-//}}
-static bundleActivator_resolveStateForExample(struct activator *activator); //do not edit, generated code
-static celix_status_t bundleActivator_addLoggerForExample(void *handle, service_reference_pt ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_removeLoggerForExample(void *handle, service_reference_pt ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_addLoggerOptionalForExample(void *handle, service_reference_pt ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_removeLoggerOptionalForExample(void *handle, service_reference_pt ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_addLoggerManyForExample(void *handle, service_reference_pt ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_removeLoggerManyForExample(void *handle, service_reference_pt ref, void *service); //do not edit, generated code
-//{{end}}
-static celix_status_t bundleActivator_getFirst(hash_map_pt services, void **result);
-
-typedef enum component_state {
-	COMPONENT_STATE_UNKNOWN = 0,
-	COMPONENT_STATE_CREATED = 1,
-	COMPONENT_STATE_STARTED = 2,
-	COMPONENT_STATE_STOPPED = 3,
-	COMPONENT_STATE_DESTROYED = 4
-} component_state_type;
-
-struct activator {
-	bundle_context_pt context;
-//Fields for components, service structs, service registries and trackers
 //{{
-//cog.outl("//no indent marker")
-//for comp in bundle['components'] :
-//	cog.outl("\t%s_pt %s;" % (comp['name'], comp['name']))
-//	cog.outl("\tpthread_mutex_t %sLock;" % comp['name'])
-//	cog.outl("\tcomponent_state_type %sState;" % comp['name'])
-//	for service in comp['serviceDependencies'] :
-//		cog.outl("\tservice_tracker_customizer_pt %sCustomizer;" % service['name'])
-//		cog.outl("\tservice_tracker_pt %sServiceTracker;" % service['name'])
-//		if service['cardinality'] == "one" or service['cardinality'] == "optional" :
-//			cog.outl("\thash_map_pt %sServicesFor%s;" % (service['name'], comp['name'].title()))
-//			cog.outl("\t%s current%sServiceFor%s;" % (service['type'], service['name'].title(), comp['name'].title())) 
-//	for service in comp['providedServices'] :
-//		cog.outl("\t%s %s;" % (service['type'], service['name']))
-//		cog.outl("\tservice_registration_pt %sServiceRegistry;" % service['name'])
-//	cog.outl("")
+//cog.outl("struct %s_activator_struct {" %(bundle['name']) )
+//for comp in bundle['components'] : 
+//      cog.outl("    %s_cmp_t *%sCmp;" %(comp['name'], comp['name']) )
+//      for service in comp['providedServices'] :
+//              cog.outl("      %s %sServ;" %(service['type'],service['name']) )
+//cog.outl("};");
 //}}
-//no indent marker //do not edit, generated code
-	example_pt example; //do not edit, generated code
-	pthread_mutex_t exampleLock; //do not edit, generated code
-	component_state_type exampleState; //do not edit, generated code
-	service_tracker_customizer_pt loggerCustomizer; //do not edit, generated code
-	service_tracker_pt loggerServiceTracker; //do not edit, generated code
-	hash_map_pt loggerServicesForExample; //do not edit, generated code
-	log_service_pt currentLoggerServiceForExample; //do not edit, generated code
-	service_tracker_customizer_pt loggerOptionalCustomizer; //do not edit, generated code
-	service_tracker_pt loggerOptionalServiceTracker; //do not edit, generated code
-	hash_map_pt loggerOptionalServicesForExample; //do not edit, generated code
-	log_service_pt currentLoggerOptionalServiceForExample; //do not edit, generated code
-	service_tracker_customizer_pt loggerManyCustomizer; //do not edit, generated code
-	service_tracker_pt loggerManyServiceTracker; //do not edit, generated code
-	command_service_pt command; //do not edit, generated code
-	service_registration_pt commandServiceRegistry; //do not edit, generated code
-	command_service_pt command2; //do not edit, generated code
-	service_registration_pt command2ServiceRegistry; //do not edit, generated code
-
-//{{end}}
+struct example_activator_struct {
+        example_cmp_t* exampleCmp;
+        example_t exampleServ;  
 };
-
-celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
-	celix_status_t status = CELIX_SUCCESS;
-	struct activator *activator = calloc(1, sizeof(struct activator));
-	if (activator != NULL) {
-		(*userData) = activator;
-//{{
-//for comp in bundle['components'] :
-//	cog.outl("//no indent marker")
-//	cog.outl("\t\tactivator->%s = NULL;" % comp['name'])
-//	cog.outl("\t\t%s_create(&activator->%s);" % (comp['name'], comp['name']))
-//	cog.outl("\t\tactivator->%sState = COMPONENT_STATE_CREATED;" % (comp['name']))
-//	cog.outl("\t\tpthread_mutex_init(&activator->%sLock, NULL);" % comp['name'])
-//
-//	for service in comp['serviceDependencies'] :
-//		cog.outl("\t\tactivator->%sServiceTracker = NULL;" % service['name'])
-//		cog.outl("\t\tserviceTrackerCustomizer_create(activator, NULL, bundleActivator_add%sFor%s, NULL, bundleActivator_remove%sFor%s, &activator->%sCustomizer);" % (service['name'].title(), comp['name'].title(), service['name'].title(), comp['name'].title(), service['name']))
-//		if 'service_name' in service :
-//			cog.outl("\t\tserviceTracker_create(context, (char *) %s, activator->%sCustomizer, &activator->%sServiceTracker);" % (service['service_name'], service['name'], service['name']))
-//		else :
-//			cog.outl("\t\tserviceTracker_createWithService(context, \"%s\", activator->%sCustomizer, &activator->%sServiceTracker);" % (service['filter'], service['name'], service['name']))
-//		if service['cardinality'] == "one" or service['cardinality'] == "optional" :
-//			cog.outl("\t\tactivator->%sServicesFor%s = hashMap_create(NULL, NULL, NULL, NULL);" % (service['name'], comp['name'].title()))
-//			cog.outl("\t\tactivator->current%sServiceFor%s = NULL;" % (service['name'].title(), comp['name'].title()))
-//
-//	for service in comp['providedServices'] :
-//		cog.outl("\t\tactivator->%s = NULL;" % service['name'])
-//		cog.outl("\t\tactivator->%sServiceRegistry = NULL;" % service['name'])
-//	cog.outl("")
-//}}
-//no indent marker //do not edit, generated code
-		activator->example = NULL; //do not edit, generated code
-		example_create(&activator->example); //do not edit, generated code
-		activator->exampleState = COMPONENT_STATE_CREATED; //do not edit, generated code
-		pthread_mutex_init(&activator->exampleLock, NULL); //do not edit, generated code
-		activator->loggerServiceTracker = NULL; //do not edit, generated code
-		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_addLoggerForExample, NULL, bundleActivator_removeLoggerForExample, &activator->loggerCustomizer); //do not edit, generated code
-		serviceTracker_create(context, (char *) OSGI_LOGSERVICE_NAME, activator->loggerCustomizer, &activator->loggerServiceTracker); //do not edit, generated code
-		activator->loggerServicesForExample = hashMap_create(NULL, NULL, NULL, NULL); //do not edit, generated code
-		activator->currentLoggerServiceForExample = NULL; //do not edit, generated code
-		activator->loggerOptionalServiceTracker = NULL; //do not edit, generated code
-		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_addLoggerOptionalForExample, NULL, bundleActivator_removeLoggerOptionalForExample, &activator->loggerOptionalCustomizer); //do not edit, generated code
-		serviceTracker_create(context, (char *) OSGI_LOGSERVICE_NAME, activator->loggerOptionalCustomizer, &activator->loggerOptionalServiceTracker); //do not edit, generated code
-		activator->loggerOptionalServicesForExample = hashMap_create(NULL, NULL, NULL, NULL); //do not edit, generated code
-		activator->currentLoggerOptionalServiceForExample = NULL; //do not edit, generated code
-		activator->loggerManyServiceTracker = NULL; //do not edit, generated code
-		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_addLoggerManyForExample, NULL, bundleActivator_removeLoggerManyForExample, &activator->loggerManyCustomizer); //do not edit, generated code
-		serviceTracker_create(context, (char *) OSGI_LOGSERVICE_NAME, activator->loggerManyCustomizer, &activator->loggerManyServiceTracker); //do not edit, generated code
-		activator->command = NULL; //do not edit, generated code
-		activator->commandServiceRegistry = NULL; //do not edit, generated code
-		activator->command2 = NULL; //do not edit, generated code
-		activator->command2ServiceRegistry = NULL; //do not edit, generated code
-
 //{{end}}
-	} else {
-		status = CELIX_ENOMEM;
-	}
-	return status;
-}
-
-celix_status_t bundleActivator_start(void *userData, bundle_context_pt context) {
-	celix_status_t status = CELIX_SUCCESS;
-	struct activator *activator = userData;
 
-	//TODO allocate and assign all declared provided services  
-	//e.g:
-	//activator->command = calloc(1, sizeof(*activator->command));
-	//activator->command->command = activator->example;
-	//activator->command->getName = example_getStateCommandName;
-	//activator->command->getUsage = example_getUsage;
-	//activator->command->getShortDescription = example_getStateCommandShortDescription;
-	//activator->command->executeCommand = example_executeStateCommand;
 
-//Start compnent, register service if the service struct is allocated
+celix_status_t dm_create(bundle_context_pt context, void **userData) {
 //{{
-//cog.outl("//indent marker")
-//for comp in bundle['components'] :
-//	cog.outl("\t%s_start(activator->%s);" % (comp['name'], comp['name']))
-//	for service in comp['serviceDependencies'] :
-//		cog.outl("\tserviceTracker_open(activator->%sServiceTracker);" % service['name'])
-//	for service in comp['providedServices'] :
-//		cog.outl("\tif (activator->%s != NULL) {" % service['name'])
-//		cog.outl("\t\tbundleContext_registerService(context, (char *)  %s_SERVICE_NAME, activator->%s, NULL, &activator->%sServiceRegistry);" % (service['name'].upper(), service['name'], service['name']))
-//		cog.outl("\t}")
+//cog.outl("    printf(\"%s: dm_create\\n\");" %(bundle['name']) )
+//cog.outl("    *userData = calloc(1, sizeof(struct %s_activator_struct));" %(bundle['name']) )
 //}}
-//indent marker //do not edit, generated code
-	example_start(activator->example); //do not edit, generated code
-	serviceTracker_open(activator->loggerServiceTracker); //do not edit, generated code
-	serviceTracker_open(activator->loggerOptionalServiceTracker); //do not edit, generated code
-	serviceTracker_open(activator->loggerManyServiceTracker); //do not edit, generated code
-	if (activator->command != NULL) { //do not edit, generated code
-		bundleContext_registerService(context, (char *)"commandService", activator->command, NULL, &activator->commandServiceRegistry); //do not edit, generated code
-	} //do not edit, generated code
-	if (activator->command2 != NULL) { //do not edit, generated code
-		bundleContext_registerService(context, (char *)"commandService", activator->command2, NULL, &activator->command2ServiceRegistry); //do not edit, generated code
-	} //do not edit, generated code
+        *userData = calloc(1, sizeof(struct example_activator_struct));
+        printf("example: dm_create\n");
 //{{end}}
-
-	return status;
+        return *userData != NULL ? CELIX_SUCCESS : CELIX_ENOMEM;
 }
 
-celix_status_t bundleActivator_stop(void *userData, bundle_context_pt context) {
-	celix_status_t status = CELIX_SUCCESS;
-	struct activator *activator = userData;
-
-//Stop compnent, unregister service if the service struct is allocated
+celix_status_t dm_init(void * userData, bundle_context_pt context, dm_dependency_manager_pt manager) {
+        celix_status_t status = CELIX_SUCCESS;
 //{{
-//cog.outl("//indent marker")
-//for comp in bundle['components'] :
-//	for service in comp['providedServices'] :
-//		cog.outl("\tif (activator->%s != NULL) {" % service['name'])
-//		cog.outl("\t\tserviceRegistration_unregister(activator->%sServiceRegistry);" % (service['name']))
-//		cog.outl("\t}")
+//cog.outl("    printf(\"%s: dm_init\\n\");" %(bundle['name']) )
+//cog.outl("    struct %s_activator_struct *act = (struct %s_activator_struct *) userData;" %(bundle['name'],bundle['name']) )
+//for comp in bundle['components'] : 
+//      cog.outl("      act->%sCmp = %s_create();" %(comp['name'],comp['name']) )
+//      cog.outl("      if (act->%sCmp != NULL) {" %(comp['name']) )
+//      cog.outl("              dm_component_pt cmp%s;" %(comp['name'].title()))
+//      cog.outl("              component_create(context, \"%s_PROCESSING_COMPONENT\", &cmp%s);" %(comp['name'].upper(), comp['name'].title()))
+//      cog.outl("              component_setImplementation(cmp%s, act->%sCmp);" %(comp['name'].title(), comp['name']) )
+//      cog.outl("              component_setCallbacksSafe(cmp%s, %s_cmp_t *, %s_init, %s_start, %s_stop, %s_deinit);" %(comp['name'].title(), comp['name'],comp['name'],comp['name'],comp['name'],comp['name']) )
 //
-//	for service in comp['serviceDependencies'] :
-//		cog.outl("\tserviceTracker_close(activator->%sServiceTracker);" % service['name'])
-//		cog.outl("\t%s_stop(activator->%s);" % (comp['name'], comp['name']))
+//      for service in comp['providedServices'] :
+//              cog.outl("              properties_pt props%s = properties_create();" %(service['name'].title()))
+//              cog.outl("              act->%sServ.handle = act->%sCmp;" %(service['name'], comp['name']) )
+//              cog.outl("              act->%sServ.callService = (void *)%s%s_callService;" %(service['name'], comp['name'],service['name'].title()) )
+//              cog.outl("              properties_set(props%s, \"id\", \"%s\");" %(service['name'].title(), comp['name']) )
+//              cog.outl("              component_addInterface(cmp%s, %s_NAME, %s_VERSION, &act->%sServ, props%s);" %(comp['name'].title(), service['name'].upper(), service['name'].upper(), service['name'], service['name'].title()) )
+//
+//      for service in comp['serviceDependencies'] :
+//              cog.outl("              dm_service_dependency_pt dep%s;" %(service['name'].title()))
+//              cog.outl("              serviceDependency_create(&dep%s);" %(service['name'].title()))
+//              cog.outl("              serviceDependency_setService(dep%s, (char*) %s, (char*) %s, NULL);" %(service['name'].title(), service['service_name'], service['service_versionrange']))
+//              cog.outl("              serviceDependency_setCallbacksSafe(dep%s, %s_cmp_t *, %s, %s_set%s, NULL, NULL, NULL, NULL);" %(service['name'].title(), comp['name'], service['type'], comp['name'], service['name']) )
+//              cog.outl("              serviceDependency_setRequired(dep%s, true);" %(service['name'].title()))
+//              cog.outl("              component_addServiceDependency(cmp%s, dep%s);" %(comp['name'].title(), service['name'].title()))
+//
+//      cog.outl("              dependencyManager_add(manager, cmp%s);"  %(comp['name'].title()))
+//      cog.outl("      } else {")
+//      cog.outl("              status = CELIX_ENOMEM;")
+//      cog.outl("      }")
 //}}
-//indent marker //do not edit, generated code
-	if (activator->command != NULL) { //do not edit, generated code
-		serviceRegistration_unregister(activator->commandServiceRegistry); //do not edit, generated code
-	} //do not edit, generated code
-	if (activator->command2 != NULL) { //do not edit, generated code
-		serviceRegistration_unregister(activator->command2ServiceRegistry); //do not edit, generated code
-	} //do not edit, generated code
-	serviceTracker_close(activator->loggerServiceTracker); //do not edit, generated code
-	serviceTracker_close(activator->loggerOptionalServiceTracker); //do not edit, generated code
-	serviceTracker_close(activator->loggerManyServiceTracker); //do not edit, generated code
-	example_stop(activator->example); //do not edit, generated code
-//{{end}}
+        struct example_activator_struct *act = (struct example_activator_struct *) userData;
+
+        printf("example: dm_init\n");
+
+        act->exampleCmp = example_create();
+        if (act->exampleCmp != NULL) {
+                dm_component_pt cmpExample;
+                component_create(context, "EXAMPLE_PROCESSING_COMPONENT", &cmpExample);
+                component_setImplementation(cmpExample, act->exampleCmp);
+                component_setCallbacksSafe(cmpExample, example_cmp_t *, example_init, example_start, example_stop, example_deinit);
+                
+                // provided services
+                properties_pt propsExample = properties_create();
+                act->exampleServ.handle = act->exampleCmp;
+                act->exampleServ.getDate = act->exampleServ_getData;
+                properties_set(propsExample, "id", "example");
+
+                component_addInterface(cmpExample, EXAMPLE_NAME, EXAMPLE_VERSION, &act->exampleServ, propsExample);
+                dependencyManager_add(manager, cmpExample);
+        }
 
-	return status;
-}
-
-celix_status_t bundleActivator_destroy(void *userData, bundle_context_pt context) {
-	celix_status_t status = CELIX_SUCCESS;
-	struct activator *activator = userData;
-
-//Stop compnent, unregister service if the service struct is allocated
-//{{
-//cog.outl("//indent marker")
-//for comp in bundle['components'] :
-//	cog.outl("\t%s_destroy(activator->%s);" % (comp['name'], comp['name']))
-//	for service in comp['serviceDependencies'] :
-//		cog.outl("\tserviceTracker_destroy(activator->%sServiceTracker);" % service['name'])
-//	for service in comp['providedServices'] :
-//		cog.outl("\tif (activator->%s != NULL) {" % service['name'])
-//		cog.outl("\t\tfree(activator->%s);" % (service['name']))
-//		cog.outl("\t\tactivator->%sState = COMPONENT_STATE_DESTROYED;" % comp['name'])
-//		cog.outl("\t}")
-//}}
-//indent marker //do not edit, generated code
-	example_destroy(activator->example); //do not edit, generated code
-	serviceTracker_destroy(activator->loggerServiceTracker); //do not edit, generated code
-	serviceTracker_destroy(activator->loggerOptionalServiceTracker); //do not edit, generated code
-	serviceTracker_destroy(activator->loggerManyServiceTracker); //do not edit, generated code
-	if (activator->command != NULL) { //do not edit, generated code
-		free(activator->command); //do not edit, generated code
-		activator->exampleState = COMPONENT_STATE_DESTROYED; //do not edit, generated code
-	} //do not edit, generated code
-	if (activator->command2 != NULL) { //do not edit, generated code
-		free(activator->command2); //do not edit, generated code
-		activator->exampleState = COMPONENT_STATE_DESTROYED; //do not edit, generated code
-	} //do not edit, generated code
 //{{end}}
-
-	return status;
-}
-
-
-static celix_status_t bundleActivator_getFirst(hash_map_pt services, void **result) {
-	celix_status_t status = CELIX_SUCCESS;
-	void *highestPrio = NULL;
-	int highestPrioRanking = -1;
-	int highestPrioServiceId = -1;
-	char *rankingStr;
-	int ranking;
-	char *serviceIdStr;
-	int serviceId;
-	
-	hash_map_iterator_pt iter = hashMapIterator_create(services); 
-	while (hashMapIterator_hasNext(iter)) {
-		service_reference_pt ref = hashMapIterator_nextKey(iter);
-		rankingStr = NULL;
-		serviceIdStr = NULL;
-		serviceReference_getProperty(ref, (char *)OSGI_FRAMEWORK_SERVICE_RANKING, &rankingStr);
-		if (rankingStr != NULL) {
-			ranking = atoi(rankingStr);	
-		} else {
-			ranking = 0;
-		}
-		serviceReference_getProperty(ref, (char *)OSGI_FRAMEWORK_SERVICE_RANKING, &serviceIdStr);
-		serviceId  = atoi(serviceIdStr);
-
-		if (ranking > highestPrioRanking) {
-			highestPrio = hashMap_get(services, ref);
-		} else if (ranking == highestPrioRanking && serviceId < highestPrioServiceId) {
-			highestPrio = hashMap_get(services, ref);
-		}
-	}
-
-	if (highestPrio != NULL) {
-		(*result) = highestPrio;
-	}
-	return status;
+    return status;
 }
 
 
-//ResolveNewState
+celix_status_t dm_destroy(void * userData, bundle_context_pt context, dm_dependency_manager_pt manager) {
 //{{
-//for comp in bundle['components'] :
-//	cog.outl("static bundleActivator_resolveStateFor%s(struct activator *activator) {" % comp['name'].title())
-//	cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//
-//	cog.out("\tif (activator->%sState == COMPONENT_STATE_CREATED " % comp['name'])
-//	conditions = [("activator->current%sServiceFor%s != NULL" % (serv['name'].title(), comp['name'].title())) for serv in comp['serviceDependencies'] if serv['cardinality'] == "one"] 
-//	if len(conditions) > 0: 
-//		cog.out(" && ")
-//		cog.out(" && ".join(conditions))
-//	cog.outl(") {")
-//	cog.outl("\t\t%s_start(activator->%s);" % (comp['name'], comp['name']))
-//	cog.outl("\t}")
-//
-//	cog.out("\tif (activator->%sState == COMPONENT_STATE_STARTED " % comp['name'])
-//	conditions = [("activator->current%sServiceFor%s == NULL" % (serv['name'].title(), comp['name'].title())) for serv in comp['serviceDependencies'] if serv['cardinality'] == "one"]
-//	if len(conditions) > 0:
-//		cog.out(" && (");
-//		cog.out(" || ".join(conditions))
-//		cog.out(")"); 
-//	cog.outl(") {")
-//	cog.outl("\t\t%s_stop(activator->%s);" % (comp['name'], comp['name']))
-//	cog.outl("\t}")
-//
-//	cog.outl("\treturn status;")
-//	cog.outl("}")
+//cog.outl("    printf(\"%s: dm-destroy\\n\");" %(bundle['name']) )
+//cog.outl("    struct %s_activator_struct *act = (struct %s_activator_struct *)userData;" %(bundle['name'],bundle['name']) )
+//cog.outl("    if (act->%sCmp != NULL) {" %(comp['name']) )
+//cog.outl("            %s_destroy(act->%sCmp);" %(comp['name'],comp['name']) )
+//cog.outl("    }");
+//cog.outl("    free(act);")
 //}}
-static bundleActivator_resolveStateForExample(struct activator *activator) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	if (activator->exampleState == COMPONENT_STATE_CREATED && activator->currentLoggerServiceForExample != NULL) { //do not edit, generated code
-		example_start(activator->example); //do not edit, generated code
-	} //do not edit, generated code
-	if (activator->exampleState == COMPONENT_STATE_STARTED && (activator->currentLoggerServiceForExample == NULL)) { //do not edit, generated code
-		example_stop(activator->example); //do not edit, generated code
-	} //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
+        struct example_activator_struct *act = (struct example_activator_struct *) userData;
+        printf("example: dm_destroy\n");
+        
+        if (act->exampleCmp != NULL) {  
+                example_destroy(act->exampleCmp);
+        }
 //{{end}}
+        return CELIX_SUCCESS;
+}
 
-//Add/Remove functions for the trackers
-//{{
-//for comp in bundle['components'] :
-//	for service in comp['serviceDependencies'] :
-//		cog.outl("static celix_status_t bundleActivator_add%sFor%s(void *handle, service_reference_pt ref, void *service) {" % (service['name'].title(), comp['name'].title()))
-//		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("\tstruct activator *activator = handle;")
-//		cog.outl("\t%s %s = service;" % (service['type'], service['name']))
-//		if service['cardinality'] == "many" :
-//			cog.outl("\t%s_add%s(activator->%s, %s);" % (comp['name'], service['name'].title(), comp['name'], service['name']))
-//		else :
-//			cog.outl("\tpthread_mutex_lock(&activator->%sLock);" % comp['name']);
-//			cog.outl("\t%s highest = NULL;" % service['type']);
-//			cog.outl("\tbundleActivator_getFirst(activator->%sServicesFor%s, (void **)&highest);" % (service['name'], comp['name'].title()))
-//			cog.outl("\tif (highest != activator->current%sServiceFor%s) {" % (service['name'].title(), comp['name'].title()))
-//			cog.outl("\t\tactivator->current%sServiceFor%s = highest;" % (service['name'].title(), comp['name'].title()))
-//			cog.outl("\t\t%s_set%s(activator->%s, highest);" % (comp['name'], service['name'].title(), comp['name'])) 
-//			cog.outl("\t\tbundleActivator_resolveStateFor%s(activator);" % comp['name'].title());
-//			cog.outl("\t}")
-//			cog.outl("\tpthread_mutex_unlock(&activator->%sLock);" % comp['name']);
-//		cog.outl("\treturn status;")
-//		cog.outl("}")
-//		cog.outl("")
-//		cog.outl("static celix_status_t bundleActivator_remove%sFor%s(void *handle, service_reference_pt ref, void *service) {" % (service['name'].title(), comp['name'].title()))
-//		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("\tstruct activator *activator = handle;")
-//		cog.outl("\t%s %s = service;" % (service['type'], service['name']))
-//
-//		if service['cardinality'] == "many" :
-//			cog.outl("\t%s_remove_%s(activator->%s, %s);" % (comp['name'], service['name'], comp['name'], service['name']))
-//		else :
-//			cog.outl("\tpthread_mutex_lock(&activator->%sLock);" % comp['name']);
-//			cog.outl("\thashMap_remove(activator->%sServicesFor%s, ref);" % (service['name'], comp['name'].title()))
-//			cog.outl("\tif (activator->current%sServiceFor%s == service) { " % (service['name'].title(), comp['name'].title()))
-//			cog.outl("\t\t%s highest = NULL;" % service['type']);
-//		cog.outl("\t\tbundleActivator_getFirst(activator->%sServicesFor%s, (void **)&highest);" % (service['name'], comp['name'].title()))
-//		cog.outl("\t\tactivator->current%sServiceFor%s = highest;" % (service['name'].title(), comp['name'].title()))
-//		cog.outl("\t\tbundleActivator_resolveStateFor%s(activator);" % comp['name'].title());
-//		cog.outl("\t\t%s_set%s(activator->%s, highest);" % (comp['name'], service['name'].title(), comp['name'])) 
-//		cog.outl("\t}")
-//		cog.outl("\tpthread_mutex_unlock(&activator->%sLock);" % comp['name']);
-//		cog.outl("\treturn status;")
-//		cog.outl("}")
-//		cog.outl("")
-//}}
-static celix_status_t bundleActivator_addLoggerForExample(void *handle, service_reference_pt ref, void *service) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	struct activator *activator = handle; //do not edit, generated code
-	log_service_pt logger = service; //do not edit, generated code
-	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
-	log_service_pt highest = NULL; //do not edit, generated code
-	bundleActivator_getFirst(activator->loggerServicesForExample, (void **)&highest); //do not edit, generated code
-	if (highest != activator->currentLoggerServiceForExample) { //do not edit, generated code
-		activator->currentLoggerServiceForExample = highest; //do not edit, generated code
-		example_setLogger(activator->example, highest); //do not edit, generated code
-		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
-	} //do not edit, generated code
-	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-static celix_status_t bundleActivator_removeLoggerForExample(void *handle, service_reference_pt ref, void *service) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	struct activator *activator = handle; //do not edit, generated code
-	log_service_pt logger = service; //do not edit, generated code
-	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
-	hashMap_remove(activator->loggerServicesForExample, ref); //do not edit, generated code
-	if (activator->currentLoggerServiceForExample == service) {  //do not edit, generated code
-		log_service_pt highest = NULL; //do not edit, generated code
-		bundleActivator_getFirst(activator->loggerServicesForExample, (void **)&highest); //do not edit, generated code
-		activator->currentLoggerServiceForExample = highest; //do not edit, generated code
-		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
-		example_setLogger(activator->example, highest); //do not edit, generated code
-	} //do not edit, generated code
-	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-static celix_status_t bundleActivator_addLoggerOptionalForExample(void *handle, service_reference_pt ref, void *service) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	struct activator *activator = handle; //do not edit, generated code
-	log_service_pt loggerOptional = service; //do not edit, generated code
-	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
-	log_service_pt highest = NULL; //do not edit, generated code
-	bundleActivator_getFirst(activator->loggerOptionalServicesForExample, (void **)&highest); //do not edit, generated code
-	if (highest != activator->currentLoggerOptionalServiceForExample) { //do not edit, generated code
-		activator->currentLoggerOptionalServiceForExample = highest; //do not edit, generated code
-		example_setLoggerOptional(activator->example, highest); //do not edit, generated code
-		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
-	} //do not edit, generated code
-	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-static celix_status_t bundleActivator_removeLoggerOptionalForExample(void *handle, service_reference_pt ref, void *service) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	struct activator *activator = handle; //do not edit, generated code
-	log_service_pt loggerOptional = service; //do not edit, generated code
-	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
-	hashMap_remove(activator->loggerOptionalServicesForExample, ref); //do not edit, generated code
-	if (activator->currentLoggerOptionalServiceForExample == service) {  //do not edit, generated code
-		log_service_pt highest = NULL; //do not edit, generated code
-		bundleActivator_getFirst(activator->loggerOptionalServicesForExample, (void **) &highest); //do not edit, generated code
-		activator->currentLoggerOptionalServiceForExample = highest; //do not edit, generated code
-		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
-		example_setLoggerOptional(activator->example, highest); //do not edit, generated code
-	} //do not edit, generated code
-	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-static celix_status_t bundleActivator_addLoggerManyForExample(void *handle, service_reference_pt ref, void *service) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	struct activator *activator = handle; //do not edit, generated code
-	log_service_pt loggerMany = service; //do not edit, generated code
-	example_addLoggerMany(activator->example, loggerMany); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-static celix_status_t bundleActivator_removeLoggerManyForExample(void *handle, service_reference_pt ref, void *service) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	struct activator *activator = handle; //do not edit, generated code
-	log_service_pt loggerMany = service; //do not edit, generated code
-	example_remove_loggerMany(activator->example, loggerMany); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-//{{end}}

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/component.c b/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
index 78ccdd2..b73cba7 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
@@ -1,9 +1,33 @@
+/**
+ *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.
+ */
+/*
+ * component.c
+ *
+ *  \date       Oct 29, 2015
+ *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
 //{{
-//import yaml
+//import os, yaml
 //bundle = None 
-//component = None
 //with open(bundleFile) as input :
-//	bundle = yaml.load(input)
+//      bundle = yaml.load(input)
 //
 //if not 'components' in bundle or bundle['components'] is None:
 // 	bundle['components'] = []
@@ -11,180 +35,150 @@
 //	for comp in bundle['components'] : 
 //		if not 'serviceDependencies' in comp or comp['serviceDependencies'] is None:
 //			comp['serviceDependencies'] = []
-//		if not 'providedServices' in comp or comp['providedServices'] is None:
-//			comp['providedServices'] = []
+//              if not 'providedServices' in comp or comp['providedServices'] is None:
+//                      comp['providedServices'] = []
+//
 //
 //for comp in bundle['components'] :
-//	if comp['name'] == componentName :
-//		component = comp
-//		break
+//      if comp['name'] == componentName :
+//              component = comp
+//              break
 //}}
 //{{end}}
-
-
+#include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include "celix_threads.h"
 
-#include <pthread.h>
 
-//Component Struct
+//Includes for the services / components
 //{{
-//cog.outl("#include \"%s.h\"" % componentName);
-//cog.outl("")
-//cog.outl("struct %s {" % componentName)
-//for service in component['serviceDependencies'] : 
-//	if service['cardinality'] == "many" :
-//		cog.outl("\tarray_list_pt %sServices;" % (service['name']))	
-//		cog.outl("\tpthread_mutex_t mutexFor%sServices;" % service['name'].title());
-//	else :
-//		cog.outl("\t%s %s;" % (service['type'], service['name']))	
-//		cog.outl("\tpthread_mutex_t mutexFor%s;" % service['name'].title());
+//cog.outl("#include \"%s.h\"" % component['name'])
+//for service in component['providedServices'] :
+//      cog.outl("#include <%s>" % service['include'])
+//for service in component['serviceDependencies'] :
+//      cog.outl("#include <%s>" % os.path.split(service['include'])[1])
 //}}
-#include "example.h" //do not edit, generated code
-
-struct example { //do not edit, generated code
-	log_service_pt logger; //do not edit, generated code
-	pthread_mutex_t mutexForLogger; //do not edit, generated code
-	log_service_pt loggerOptional; //do not edit, generated code
-	pthread_mutex_t mutexForLoggerOptional; //do not edit, generated code
-	array_list_pt loggerManyServices; //do not edit, generated code
-	pthread_mutex_t mutexForLoggerManyServices; //do not edit, generated code
 //{{end}}
+
+
+//{{
+//cog.outl("struct %s_cmp_struct {" %(component['name']) )
+//for service in component['serviceDependencies'] :
+//      cog.outl("      %s %sServ;" %(service['type'], service['name']))
+//      cog.outl("      celix_thread_mutex_t %sMutex;" %(service['name']))
+//cog.outl("};");
+//}}
+struct example_cmp_struct {
+    phase1_t* phase1Serv;
+    celix_thread_mutex_t mutex;
 };
+//{{end}}
+
+
 
-//Create function
 //{{
-//cog.outl("celix_status_t %s_create(%s_pt *result) {" % (componentName, componentName))
-//cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//cog.outl("printf(\" %s_create called.\\n\");" % (componentName))
-//cog.outl("\t%s_pt component = calloc(1, sizeof(*component));" % componentName)
-//cog.outl("\tif (component != NULL) {")
+//cog.outl("%s_cmp_t *%s_create(void) {" %(component['name'], component['name']))
+//cog.outl("    %s_cmp_t *cmp = calloc(1, sizeof(*cmp));" %(component['name']))
+//cog.outl("    if (cmp != NULL) {")
 //for service in component['serviceDependencies'] :
-//	if service['cardinality'] == "many" :
-//		cog.outl("\t\tcomponent->%sServices = NULL;" % service['name'])
-//		cog.outl("\t\tstatus = arrayList_create(&component->%sServices);" % service['name'])
-//		cog.outl("\t\tpthread_mutex_init(&component->mutexFor%sServices, NULL);" % service['name'].title())
-//	else :
-//		cog.outl("\t\tcomponent->%s = NULL;" % service['name'])
-//		cog.outl("\t\tpthread_mutex_init(&component->mutexFor%s, NULL);" % service['name'].title())
+//      cog.outl("              celixThreadMutex_create(&cmp->%sMutex, NULL);" %(service['name']));
+//cog.outl("    }");
 //}}
-celix_status_t example_create(example_pt *result) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	example_pt component = calloc(1, sizeof(*component)); //do not edit, generated code
-	if (component != NULL) { //do not edit, generated code
-		component->logger = NULL; //do not edit, generated code
-		pthread_mutex_init(&component->mutexForLogger, NULL); //do not edit, generated code
-		component->loggerOptional = NULL; //do not edit, generated code
-		pthread_mutex_init(&component->mutexForLoggerOptional, NULL); //do not edit, generated code
-		component->loggerManyServices = NULL; //do not edit, generated code
-		status = arrayList_create(&component->loggerManyServices); //do not edit, generated code
-		pthread_mutex_init(&component->mutexForLoggerManyServices, NULL); //do not edit, generated code
+example_cmp_t* example_create(void) {
+        example_cmp_t* cmp = calloc(1, sizeof(*cmp));
+        if (cmp != NULL) {
+                celixThreadMutex_create(&cmp->mutex, NULL);
+        }
 //{{end}}
-		(*result) = component;
-	} else {
-		status = CELIX_ENOMEM;
-	}	
-	return status;
+
+        return cmp;
 }
 
+//{{
+//cog.outl("int %s_init(%s_cmp_t* cmp) {" %(component['name'], component['name']) )
+//cog.outl("    printf(\"init %s\\n\");" %(component['name']) )
+//}}
+int example_init(example_cmp_t* cmp) {
+        printf("init example\n");
+//{{end}}
+        return 0;
+}
+
+//{{
+//cog.outl("int %s_start(%s_cmp_t* cmp) {" %(component['name'], component['name']) )
+//cog.outl("    printf(\"start %s\\n\");" %(component['name']) )
+//}}
+int example_init(example_cmp_t* cmp) {
+        printf("start example\n");
+//{{end}}
+        return 0;
+}
 
-//Destroy function
 //{{
-//cog.outl("celix_status_t %s_destroy(%s_pt component) {" % (componentName,componentName))
-//cog.outl("printf(\" %s_destroy called.\\n\");" % (componentName))
+//cog.outl("int %s_stop(%s_cmp_t* cmp) {" %(component['name'], component['name']) )
+//cog.outl("    printf(\"stop %s\\n\");" %(component['name']) )
 //}}
-celix_status_t example_destroy(example_pt component) { //do not edit, generated code
+int example_stop(example_cmp_t* cmp) {
+        printf("stop example\n");
 //{{end}}
-	celix_status_t status = CELIX_SUCCESS;
-	if (component != NULL) {
-		free(component);
-	} else {
-		status = CELIX_ILLEGAL_ARGUMENT;
-	}
-	return status;
+        return 0;
 }
 
-//Start function
 //{{
-//cog.outl("celix_status_t %s_start(%s_pt component) {" % (componentName,componentName))
-//cog.outl("printf(\" %s_start called.\\n\");" % (componentName))
+//cog.outl("int %s_deinit(%s_cmp_t* cmp) {" %(component['name'], component['name']) )
+//cog.outl("    printf(\"deinit %s\\n\");" %(component['name']) )
 //}}
-celix_status_t example_start(example_pt component) { //do not edit, generated code
+int example_deinit(example_cmp_t* cmp) {
+        printf("deinit example\n");
 //{{end}}
-	celix_status_t status = CELIX_SUCCESS;
-	return status;
+        return 0;
 }
 
-//Stop function
 //{{
-//cog.outl("celix_status_t %s_stop(%s_pt component) {" % (componentName,componentName))
-//cog.outl("printf(\" %s_stop called.\\n\");" % (componentName))
+//cog.outl("int %s_destroy(%s_cmp_t* cmp) {" %(component['name'], component['name']) )
+//cog.outl("    printf(\"destroy %s\\n\");" %(component['name']) )
 //}}
-celix_status_t example_stop(example_pt component) { //do not edit, generated code
+int example_destroy(example_cmp_t* cmp) {
+        printf("destroy example\n");
 //{{end}}
-	celix_status_t status = CELIX_SUCCESS;
-	return status;
+        free(cmp);
+        return 0;
 }
 
+
 //{{
 //for service in component['serviceDependencies'] :
-//	if service['cardinality'] == "many" :
-//		cog.outl("celix_status_t %s_add%s(%s_pt component, %s %s) {" % (componentName, service['name'].title(), componentName, service['type'], service['name'])) 
-//		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("printf(\" %s_add%s called.\\n\");" % (componentName, service['name'].title()))
-//		cog.outl("\tpthread_mutex_lock(&component->mutexFor%sServices);" % service['name'].title())
-//		cog.outl("\tarrayList_add(component->%sServices, %s);" % (service['name'], service['name']))
-//		cog.outl("\tpthread_mutex_unlock(&component->mutexFor%sServices);" % service['name'].title())
-//		cog.outl("\treturn status;")
-//		cog.outl("}")
-//		cog.outl("")
-//		cog.outl("celix_status_t %s_remove%s(%s_pt component, %s %s) {" % (componentName, service['name'].title(), componentName, service['type'], service['name'])) 
-//		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("\tpthread_mutex_lock(&component->mutexFor%sServices);" % service['name'].title())
-//		cog.outl("\tarrayList_removeElement(component->%sServices, %s);" % (service['name'], service['name']))
-//		cog.outl("\tpthread_mutex_unlock(&component->mutexFor%sServices);" % service['name'].title())
-//		cog.outl("\treturn status;")
-//		cog.outl("}")
-//	else :
-//		cog.outl("celix_status_t %s_set%s(%s_pt component, %s %s) {" % (componentName, service['name'].title(), componentName, service['type'], service['name'])) 
-//		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("printf(\" %s_set%s called.\\n\");" % (componentName, service['name'].title()))
-//		cog.outl("\tpthread_mutex_lock(&component->mutexFor%s);" % service['name'].title())
-//		cog.outl("\tcomponent->%s == %s;" % (service['name'], service['name']))
-//		cog.outl("\tpthread_mutex_unlock(&component->mutexFor%s);" % service['name'].title())
-//		cog.outl("\treturn status;")
-//		cog.outl("}")
-//		cog.outl("")	
+//      cog.outl("int %s_set%s(%s_cmp_t* cmp, %s srvc) {" %(component['name'], service['name'], component['name'], service['type']) )
+//      cog.outl("      printf(\"%s_set%s called!\\n\");" %(component['name'], service['name']) )
+//      cog.outl("      celixThreadMutex_lock(&cmp->%sMutex);" %(service['name']))
+//      cog.outl("      cmp->%sServ = srvc;" %(service['name']))
+//      cog.outl("      celixThreadMutex_unlock(&cmp->%sMutex);" %(service['name']))
+//      cog.outl("      return 0;")
+//      cog.outl("}")
 //}}
-celix_status_t example_setLogger(example_pt component, log_service_pt logger) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutexFor:ogger); //do not edit, generated code
-	component->logger == logger; //do not edit, generated code
-	pthread_mutex_unlock(&component->mutexForLogger); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-celix_status_t example_setLoggerOptional(example_pt component, log_service_pt loggerOptional) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutexForLoggerOptional); //do not edit, generated code
-	component->loggerOptional == loggerOptional; //do not edit, generated code
-	pthread_mutex_unlock(&component->mutexForLoggerOptional); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-celix_status_t example_addLoggerMany(example_pt component, log_service_pt loggerMany) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutexFor:oggerManyServices); //do not edit, generated code
-	arrayList_add(component->loggerManyServices, loggerMany); //do not edit, generated code
-	pthread_mutex_unlock(&component->mutexForLoggerManyServices); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
-
-celix_status_t example_removeLoggerMany(example_pt component, log_service_pt loggerMany) { //do not edit, generated code
-	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutexForLoggerManyServices); //do not edit, generated code
-	arrayList_removeElement(component->loggerManyServices, loggerMany); //do not edit, generated code
-	pthread_mutex_unlock(&component->mutexForLoggerManyServices); //do not edit, generated code
-	return status; //do not edit, generated code
-} //do not edit, generated code
+int example_setDependendService(example_cmp_t* cmp, void* service) {
+        celixThreadMutex_lock(&cmp->mutex);
+        cmp->phase1Serv = service;
+        celixThreadMutex_unlock(&cmp->mutex);
+        return 0;
+}
+//{{end}}
 
+
+//{{
+//for service in component['providedServices'] :
+//      cog.outl("int %s%s_callService(%s_cmp_t* cmp, void* data) {" %(component['name'], service['name'].title(), component['name']) )
+//      cog.outl("      printf(\"%s%s callService\\n\");" %(component['name'], service['name'].title() ))
+//      cog.outl("      return 0;")
+//      cog.outl("}")
+//}}
+   
+int example_callService(example_cmp_t* cmp, void* data) {
+        printf("callService called!!\n");
+        return 0;
+}
 //{{end}}
+

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/component.h b/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
index 64972fd..ec43f81 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
@@ -1,9 +1,33 @@
+/**
+ *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.
+ */
+/*
+ * component.c
+ *
+ *  \date       Oct 29, 2015
+ *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright  Apache License, Version 2.0
+ */
 //{{
-//import yaml
+//import os, yaml
 //bundle = None 
-//component = None
 //with open(bundleFile) as input :
-//	bundle = yaml.load(input)
+//      bundle = yaml.load(input)
 //
 //if not 'components' in bundle or bundle['components'] is None:
 // 	bundle['components'] = []
@@ -23,56 +47,36 @@
 //cog.outl("#define __%s_H_" % componentName.upper())
 //cog.outl("")
 //
-//if 'serviceDependencies' in comp and comp['serviceDependencies'] is not None:
-//	for service in component['serviceDependencies'] :
-//		cog.outl("#include <%s>" % service['include'])
-//	cog.outl("")
+//if 'serviceDependencies' in comp and component['serviceDependencies'] is not None:
+//      for service in component['serviceDependencies'] :
+//              cog.outl("#include <%s>" % os.path.split(service['include'])[1])
+//      cog.outl("")
 //
 //}}
 #ifndef __EXAMPLE_H_ //do not edit, generated code
 #define __EXAMPLE_H_ //do not edit, generated code
-
-#include <log_service/log_service.h> //do not edit, generated code
-#include <log_service/log_service.h> //do not edit, generated code
-#include <log_service/log_service.h> //do not edit, generated code
-
 //{{end}}
-
 #include <celix_errno.h>
-#include <array_list.h>
-
 //{{
-//cog.outl("typedef struct %s *%s_pt;" % (componentName, componentName))
-//cog.outl("")
-//cog.outl("celix_status_t %s_create(%s_pt *component);" % (componentName, componentName))
-//cog.outl("celix_status_t %s_start(%s_pt component);" % (componentName, componentName))
-//cog.outl("celix_status_t %s_stop(%s_pt component);" % (componentName, componentName))
-//cog.outl("celix_status_t %s_destroy(%s_pt component);" % (componentName, componentName))
-//
-//#TODO add remote of service dependencies
+//cog.outl("typedef struct %s_cmp_struct %s_cmp_t;" %(component['name'], component['name']))
+//cog.outl("%s_cmp_t *%s_create(void);" %(component['name'], component['name']))
+//cog.outl("int %s_init(%s_cmp_t *cmp);" %(component['name'], component['name']))
+//cog.outl("int %s_start(%s_cmp_t *cmp);" %(component['name'], component['name'])) 
+//cog.outl("int %s_stop(%s_cmp_t *cmp);" %(component['name'],component['name'])) 
+//cog.outl("int %s_deinit(%s_cmp_t *cmp);" %(component['name'],component['name'])) 
+//cog.outl("int %s_destroy(%s_cmp_t *cmp);" %(component['name'],component['name'])) 
 //}}
-typedef struct example *example_pt; //do not edit, generated code
-
-celix_status_t example_create(example_pt *component); //do not edit, generated code
-celix_status_t example_start(example_pt component); //do not edit, generated code
-celix_status_t example_stop(example_pt component); //do not edit, generated code
-celix_status_t example_destroy(example_pt component); //do not edit, generated code
 //{{end}}
-
 //{{
 //for service in component['serviceDependencies'] :
-//	if service['cardinality'] == "many" :
-//		cog.outl("celix_status_t %s_add%s(%s_pt component, %s %s);" % (componentName, service['name'].title(), componentName, service['type'], service['name']))
-//		cog.outl("celix_status_t %s_remove%s(%s_pt component, %s %s);" % (componentName, service['name'].title(), componentName, service['type'], service['name']))
-//	else :
-//		cog.outl("celix_status_t %s_set%s(%s_pt component, %s %s);" % (componentName, service['name'].title(), componentName, service['type'], service['name']))
+//      cog.outl("int %s_set%s(%s_cmp_t* cmp, %s srvc);" %(component['name'], service['name'], component['name'], service['type'] ) )
+//}}
+//{{end}}
+//{{
+//for service in component['providedServices'] :
+//      cog.outl("int %s%s_callService(%s_cmp_t* cmp, void* data);" %(component['name'], service['name'].title(), component['name']))
 //}}
-celix_status_t example_setLogger(example_pt component, log_service_pt logger); //do not edit, generated code
-celix_status_t example_setLoggerOptional(example_pt component, log_service_pt loggerOptional); //do not edit, generated code
-celix_status_t example_add:oggerMany(example_pt component, log_service_pt loggerMany); //do not edit, generated code
-celix_status_t example_removeLoggerMany(example_pt component, log_service_pt loggerMany); //do not edit, generated code
 //{{end}}
-
 //{{
 //cog.outl("#endif //__%s_H_" % componentName.upper())
 //}}

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake b/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
index f654771..2f80596 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
@@ -2,9 +2,10 @@
 #import yaml
 #bundle = None 
 #with open(bundleFile) as input :
-#	bundle = yaml.load(input)
+#       bundle = yaml.load(input)
 #cog.outl("deploy( \"%s\" BUNDLES" % bundle['name'])
 #cog.outl("\t${CELIX_BUNDLES_DIR}/shell.zip")
+#cog.outl("\t${CELIX_BUNDLES_DIR}/dm_shell.zip")
 #cog.outl("\t${CELIX_BUNDLES_DIR}/shell_tui.zip")
 #cog.outl("\t${CELIX_BUNDLES_DIR}/log_service.zip")
 #cog.outl("\t%s" % bundle['name'])

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/bundle/service.h
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/service.h b/celix-bootstrap/celix/bootstrap/templates/bundle/service.h
index a6b1fd8..7797fe8 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/service.h
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/service.h
@@ -31,9 +31,10 @@
 //TODO add needed includes
 
 //{{
-//cog.outl("#define %s_SERVICE_NAME \"%s_service\"" % (service['name'].upper(), service['service_name']))
+//cog.outl("#define %s_NAME \"%s_service\"" % (service['name'].upper(), service['service_name']))
+//cog.outl("#define %s_VERSION \"1.0.0.0\"" % (service['name'].upper()))
 //cog.outl("")
-//cog.outl("typedef struct %s_service* %s;" % (service['name'], service['type']))
+//cog.outl("typedef struct %s_service %s;" % (service['name'], service['type']))
 //cog.outl("")
 //cog.outl("struct %s_service {" % service['name'])
 //cog.outl("\tvoid *handle;")
@@ -42,10 +43,9 @@
 typedef struct benchmark_service *benchmark_service_pt;
 
 struct benchmark_service {
-	benchmark_handler_pt handler;
+        benchmark_handler_pt handler;
 //{{end}}}
-
-	//TODO add service methods
+        void (*callService)(void *handle, void* data);
 
 //{{
 //cog.outl("};")

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
index b6f7958..6991e4a 100644
--- a/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
@@ -17,7 +17,8 @@ project(myproject C) #do not edit, generated code
 #{{end}}
 
 #{{ 
-#	cog.outl("set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \"%s/share/celix/cmake/modules\")" % project['celix_install_dir'])
+#       cog.outl("set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \"%s/share/celix/cmake/modules\")" % project['celix_install_dir'])
+#       cog.outl("link_directories(\"%s/lib\")" % project['celix_install_dir'])
 #}}
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/share/celix/cmake/modules") #do not edit, generated code
 #{{end}}

http://git-wip-us.apache.org/repos/asf/celix/blob/37010fbe/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake b/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
index 84c3ffb..6001f27 100644
--- a/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
+++ b/celix-bootstrap/celix/bootstrap/templates/project/deploy.cmake
@@ -11,6 +11,7 @@
 #
 #cog.outl("deploy( \"%s\" BUNDLES" % project['name'])
 #cog.outl("\t${CELIX_BUNDLES_DIR}/shell.zip")
+#cog.outl("\t${CELIX_BUNDLES_DIR}/dm_shell.zip")
 #cog.outl("\t${CELIX_BUNDLES_DIR}/shell_tui.zip")
 #cog.outl("\t${CELIX_BUNDLES_DIR}/log_service.zip")
 #
@@ -19,8 +20,8 @@
 #	for foundFile in fnmatch.filter(filenames, 'bundle.yaml'):
 #		bundleFile = root + '/' + foundFile
 #		with open(bundleFile) as input :
-#			bundle = yaml.load(input)
-#			cog.outl("\t%s" % bundle['name'])
+#                       bundle = yaml.load(input)
+#                       cog.outl("\t%s" % bundle['name'])
 #
 #cog.outl(")");
 #}}


[47/50] celix git commit: CELIX-347: Changes build options for building with dependency manager. Trying to fix issues when building with asan

Posted by pn...@apache.org.
CELIX-347: Changes build options for building with dependency manager. Trying to fix issues when building with asan


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

Branch: refs/heads/release/celix-2.0.0
Commit: 9ba3832910d933cea7cd9e110f51e35710d373ab
Parents: c107842
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Feb 16 19:43:32 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Feb 16 19:43:32 2016 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/BuildOptions.cmake       | 4 ++--
 examples/dm_example/phase1/CMakeLists.txt  | 9 +++++++--
 examples/dm_example/phase2a/CMakeLists.txt | 7 ++++++-
 examples/dm_example/phase2b/CMakeLists.txt | 7 ++++++-
 examples/dm_example/phase3/CMakeLists.txt  | 7 ++++++-
 5 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/cmake/cmake_celix/BuildOptions.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/BuildOptions.cmake b/cmake/cmake_celix/BuildOptions.cmake
index 11deb68..8c5caf5 100644
--- a/cmake/cmake_celix/BuildOptions.cmake
+++ b/cmake/cmake_celix/BuildOptions.cmake
@@ -2,6 +2,6 @@
 option(ENABLE_ADDRESS_SANITIZER "Enabled building with address sanitizer. Note for gcc libasan must be installed" OFF)
 
 if (ENABLE_ADDRESS_SANITIZER)
-    set(CMAKE_C_FLAGS "-lasan -fsanitize=address ${CMAKE_C_FLAGS} -Wl,--allow-shlib-undefined")
-    set(CMAKE_CXX_FLAGS "-lasan -fsanitize=address ${CMAKE_CXX_FLAGS} -Wl,--allow-shlib-undefined")
+    set(CMAKE_C_FLAGS "-lasan -fsanitize=address ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-lasan -fsanitize=address ${CMAKE_CXX_FLAGS}")
 endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase1/CMakeLists.txt b/examples/dm_example/phase1/CMakeLists.txt
index b8c34b3..99abe65 100644
--- a/examples/dm_example/phase1/CMakeLists.txt
+++ b/examples/dm_example/phase1/CMakeLists.txt
@@ -34,5 +34,10 @@ add_bundle(phase1
 IF(APPLE)
     target_link_libraries(phase1 celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase1 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
-ENDIF()
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase1 -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    else()
+        target_link_libraries(phase1 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    endif()
+endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase2a/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2a/CMakeLists.txt b/examples/dm_example/phase2a/CMakeLists.txt
index 5474534..31c27a6 100644
--- a/examples/dm_example/phase2a/CMakeLists.txt
+++ b/examples/dm_example/phase2a/CMakeLists.txt
@@ -31,5 +31,10 @@ add_bundle(phase2a
 IF(APPLE)
     target_link_libraries(phase2a celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase2a -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase2a -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    else()
+        target_link_libraries(phase2a -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    endif()
 ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase2b/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2b/CMakeLists.txt b/examples/dm_example/phase2b/CMakeLists.txt
index ff3089c..1d107ec 100644
--- a/examples/dm_example/phase2b/CMakeLists.txt
+++ b/examples/dm_example/phase2b/CMakeLists.txt
@@ -33,5 +33,10 @@ add_bundle(phase2b
 IF(APPLE)
     target_link_libraries(phase2b celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase2b -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase2b -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    else()
+        target_link_libraries(phase2b -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    endif()
 ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase3/CMakeLists.txt b/examples/dm_example/phase3/CMakeLists.txt
index 71d31c0..aea9f9e 100644
--- a/examples/dm_example/phase3/CMakeLists.txt
+++ b/examples/dm_example/phase3/CMakeLists.txt
@@ -33,5 +33,10 @@ add_bundle(phase3
 IF(APPLE)
     target_link_libraries(phase3 celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase3 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase3 -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    else()
+        target_link_libraries(phase3 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    endif()
 ENDIF()


[12/50] celix git commit: CELIX-344: Fix wrong assumption that a service references always is tracked when untracking int the service tracker.

Posted by pn...@apache.org.
CELIX-344: Fix wrong assumption that a service references always is tracked when untracking int the service tracker.


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

Branch: refs/heads/release/celix-2.0.0
Commit: c4a34a9802f7a9a75fd4e819915fd6de189f92a0
Parents: 37010fb
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 4 15:55:38 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 4 15:55:38 2016 +0100

----------------------------------------------------------------------
 framework/private/src/service_tracker.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/c4a34a98/framework/private/src/service_tracker.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_tracker.c b/framework/private/src/service_tracker.c
index 1d4e4aa..42ac254 100644
--- a/framework/private/src/service_tracker.c
+++ b/framework/private/src/service_tracker.c
@@ -382,6 +382,7 @@ static celix_status_t serviceTracker_untrack(service_tracker_pt tracker, service
     celix_status_t status = CELIX_SUCCESS;
     tracked_pt tracked = NULL;
     unsigned int i;
+    bool found = false;
 
     celixThreadRwlock_writeLock(&tracker->lock);
     for (i = 0; i < arrayList_size(tracker->trackedServices); i++) {
@@ -389,13 +390,14 @@ static celix_status_t serviceTracker_untrack(service_tracker_pt tracker, service
         tracked = (tracked_pt) arrayList_get(tracker->trackedServices, i);
         serviceReference_equals(reference, tracked->reference, &equals);
         if (equals) {
+            found = true;
             arrayList_remove(tracker->trackedServices, i);
             break;
         }
     }
     celixThreadRwlock_unlock(&tracker->lock);
 
-    if (tracked != NULL) {
+    if (found && tracked != NULL) {
         serviceTracker_invokeRemovingService(tracker, tracked->reference, tracked->service);
         free(tracked);
         bundleContext_ungetServiceReference(tracker->context, reference);


[31/50] celix git commit: CELIX-348: Fixes utils_test for changes string hash

Posted by pn...@apache.org.
CELIX-348: Fixes utils_test for changes string hash


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

Branch: refs/heads/release/celix-2.0.0
Commit: a303b7984305c8ee6ab15ec7c9bc97e03cd7852c
Parents: 2933fcd
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 10 09:07:14 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 10 09:07:14 2016 +0100

----------------------------------------------------------------------
 framework/private/test/utils_test.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/a303b798/framework/private/test/utils_test.cpp
----------------------------------------------------------------------
diff --git a/framework/private/test/utils_test.cpp b/framework/private/test/utils_test.cpp
index fb391f2..22b04b7 100644
--- a/framework/private/test/utils_test.cpp
+++ b/framework/private/test/utils_test.cpp
@@ -70,12 +70,12 @@ TEST(utils, stringHash) {
 	char * toHash = my_strdup("abc");
 	unsigned int hash;
 	hash = utils_stringHash((void *) toHash);
-	LONGS_EQUAL(446371745, hash);
+	LONGS_EQUAL(193485928, hash);
 
 	free(toHash);
 	toHash = my_strdup("abc123def456ghi789jkl012mno345pqr678stu901vwx234yz");
 	hash = utils_stringHash((void *) toHash);
-	LONGS_EQUAL(1508668412, hash);
+	LONGS_EQUAL(3704717399, hash);
 
 	free(toHash);
 	toHash = my_strdup("abc123def456ghi789jkl012mno345pqr678stu901vwx234yz"
@@ -101,7 +101,7 @@ TEST(utils, stringHash) {
 			"abc123def456ghi789jkl012mno345pqr678stu901vwx234yz"
 			"abc123def456ghi789jkl012mno345pqr678stu901vwx234yz");
 	hash = utils_stringHash((void *) toHash);
-	LONGS_EQUAL(829630780, hash);
+	LONGS_EQUAL(3862509969, hash);
 	free(toHash);
 }
 


[28/50] celix git commit: CELIX-348: Improved string hash.

Posted by pn...@apache.org.
CELIX-348: Improved string hash.


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

Branch: refs/heads/release/celix-2.0.0
Commit: 13f34df4648ab63e9c5a01afee1a99de06cf467e
Parents: 88a7da2
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 10 08:43:50 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 10 08:43:50 2016 +0100

----------------------------------------------------------------------
 framework/private/src/utils.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/13f34df4/framework/private/src/utils.c
----------------------------------------------------------------------
diff --git a/framework/private/src/utils.c b/framework/private/src/utils.c
index f8e5d1f..a072623 100644
--- a/framework/private/src/utils.c
+++ b/framework/private/src/utils.c
@@ -29,18 +29,14 @@
 #include "utils.h"
 
 unsigned int utils_stringHash(void * string) {
-	char * str = (char *) string;
+    unsigned int hash = 5381;
+    unsigned int i = 0;
+    unsigned int len = strlen(string);
 
-	unsigned int hash = 1315423911;
-	unsigned int i    = 0;
-	unsigned int len = strlen(str);
+    for(i=0; i < len; i++)
+    { hash = (hash << 5) + (*string) + hash; }
 
-	for(i = 0; i < len; str++, i++)
-	{
-	  hash ^= ((hash << 5) + (*str) + (hash >> 2));
-	}
-
-	return hash;
+    return hash;
 }
 
 int utils_stringEquals(void * string, void * toCompare) {
@@ -134,4 +130,4 @@ FRAMEWORK_EXPORT int utils_compareServiceIdsAndRanking(long servId, long servRan
 	}
 
 	return result;
-}
\ No newline at end of file
+}


[32/50] celix git commit: CELIX-349: Fixes an issue service tracker that the service reference list was updated after the added callback was invoked.

Posted by pn...@apache.org.
CELIX-349: Fixes an issue service tracker that the service reference list was updated after the added callback was invoked.


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

Branch: refs/heads/release/celix-2.0.0
Commit: d4fe6558d214f24fbda1d0b7747e348d6fdeb451
Parents: a303b79
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 10 12:22:15 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 10 12:22:15 2016 +0100

----------------------------------------------------------------------
 framework/private/src/service_tracker.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/d4fe6558/framework/private/src/service_tracker.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_tracker.c b/framework/private/src/service_tracker.c
index 42ac254..92c3a92 100644
--- a/framework/private/src/service_tracker.c
+++ b/framework/private/src/service_tracker.c
@@ -301,10 +301,12 @@ static celix_status_t serviceTracker_track(service_tracker_pt tracker, service_r
                 assert(reference != NULL);
                 tracked->reference = reference;
                 tracked->service = service;
-                serviceTracker_invokeAddService(tracker, reference, service);
+
                 celixThreadRwlock_writeLock(&tracker->lock);
                 arrayList_add(tracker->trackedServices, tracked);
                 celixThreadRwlock_unlock(&tracker->lock);
+
+                serviceTracker_invokeAddService(tracker, reference, service);
             }
         }
 


[21/50] celix git commit: CELIX-343: Update CMakeLists.txt for changed bundle_file target property. Enable config_admin in travis

Posted by pn...@apache.org.
CELIX-343: Update CMakeLists.txt for changed bundle_file target property. Enable config_admin in travis


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

Branch: refs/heads/release/celix-2.0.0
Commit: 2e31fdd536e6f874cdbb69867ba84fe4ab03a335
Parents: b19a8f6
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 13:08:23 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 13:08:23 2016 +0100

----------------------------------------------------------------------
 .travis.yml                                                | 2 +-
 config_admin/config_admin_tst/CMakeLists.txt               | 6 +++---
 config_admin/config_admin_tst/example_test2/CMakeLists.txt | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/2e31fdd5/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 3e8b170..7448d72 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -53,7 +53,7 @@ before_script:
     - cd -
     - mkdir build install
     - export BUILD_OPTIONS=" \
-        -DBUILD_CONFIG_ADMIN=OFF \
+        -DBUILD_CONFIG_ADMIN=ON \
         -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON \
         -DBUILD_DEPLOYMENT_ADMIN=ON \
         -DBUILD_DEPENDENCY_MANAGER=ON \

http://git-wip-us.apache.org/repos/asf/celix/blob/2e31fdd5/config_admin/config_admin_tst/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/config_admin_tst/CMakeLists.txt b/config_admin/config_admin_tst/CMakeLists.txt
index bc20862..e74e7bd 100644
--- a/config_admin/config_admin_tst/CMakeLists.txt
+++ b/config_admin/config_admin_tst/CMakeLists.txt
@@ -35,9 +35,9 @@ add_executable(config_admin_test config_admin_test.cpp)
 target_link_libraries(config_admin_test celix_framework ${CELIX_LIBRARIES} ${CPPUTEST_LIBRARY} pthread)
 
 
-get_property(config_admin_bundle_file TARGET config_admin PROPERTY BUNDLE)
-get_property(example_test_bundle_file TARGET example_test PROPERTY BUNDLE)
-get_property(example_test2_bundle_file TARGET example_test2 PROPERTY BUNDLE)
+get_property(config_admin_bundle_file TARGET config_admin PROPERTY BUNDLE_FILE)
+get_property(example_test_bundle_file TARGET example_test PROPERTY BUNDLE_FILE)
+get_property(example_test2_bundle_file TARGET example_test2 PROPERTY BUNDLE_FILE)
 
 configure_file(config.properties.in config.properties @ONLY)
 

http://git-wip-us.apache.org/repos/asf/celix/blob/2e31fdd5/config_admin/config_admin_tst/example_test2/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/config_admin_tst/example_test2/CMakeLists.txt b/config_admin/config_admin_tst/example_test2/CMakeLists.txt
index 2d38251..d312673 100644
--- a/config_admin/config_admin_tst/example_test2/CMakeLists.txt
+++ b/config_admin/config_admin_tst/example_test2/CMakeLists.txt
@@ -21,7 +21,7 @@ include_directories("${PROJECT_SOURCE_DIR}/framework/public/include")
 include_directories("${PROJECT_SOURCE_DIR}/config_admin/service/public/include")
 include_directories("private/include")
 
-add_bundle(bundle_managed_service SOURCES
+add_bundle(example_test2 SOURCES
 	private/src/activator
 	private/src/example_managed_service_impl
     VERSION 0.1.0


[41/50] celix git commit: CELIX-352: refactor of find ext path for framework bundle

Posted by pn...@apache.org.
CELIX-352: refactor of find ext path for framework bundle


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

Branch: refs/heads/release/celix-2.0.0
Commit: 2e763f3c74139c355b63111bc9b4ff350af714ca
Parents: 90adc1f
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 12 18:07:04 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 12 18:07:04 2016 +0100

----------------------------------------------------------------------
 .../rsa/private/src/dfi_utils.c                        | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/2e763f3c/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c b/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
index e9888f9..503c931 100644
--- a/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
+++ b/remote_services/remote_service_admin_dfi/rsa/private/src/dfi_utils.c
@@ -24,20 +24,15 @@
 static celix_status_t dfi_findFileForFramework(bundle_context_pt context, const char *fileName, FILE **out) {
     celix_status_t  status;
 
-    char cwd[1024];
-    char *extPath = NULL;
+    char pwd[1024]
     char path[1024];
    
     status = bundleContext_getProperty(context, "CELIX_FRAMEWORK_EXTENDER_PATH", &extPath);
-    if (status != CELIX_SUCCESS || extPath == NULL) {
-        getcwd(cwd, sizeof(cwd));
-        extPath = cwd;
-        if (extPath == NULL) {
-            status = CELIX_FILE_IO_EXCEPTION;
-        }
+    if (status != CELIX_SUCCESS) {
+        getcwd(pwd, sizeof(pwd));
     }
 
-    snprintf(path, sizeof(path), "%s/%s", extPath, fileName);
+    snprintf(path, sizeof(path), "%s/%s", pwd, fileName);
 
     if (status == CELIX_SUCCESS) {
         FILE *df = fopen(path, "r");


[46/50] celix git commit: CELIX-347: Updated BuildOptions to allow undefs in shared libaries. This is needed when using the asan

Posted by pn...@apache.org.
CELIX-347: Updated BuildOptions to allow undefs in shared libaries. This is needed when using the asan


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

Branch: refs/heads/release/celix-2.0.0
Commit: c1078421b70a25db60a9f99d3157198f5aadbe9c
Parents: e0ab154
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Feb 16 16:51:03 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Feb 16 16:51:03 2016 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/BuildOptions.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/c1078421/cmake/cmake_celix/BuildOptions.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/BuildOptions.cmake b/cmake/cmake_celix/BuildOptions.cmake
index 8c5caf5..11deb68 100644
--- a/cmake/cmake_celix/BuildOptions.cmake
+++ b/cmake/cmake_celix/BuildOptions.cmake
@@ -2,6 +2,6 @@
 option(ENABLE_ADDRESS_SANITIZER "Enabled building with address sanitizer. Note for gcc libasan must be installed" OFF)
 
 if (ENABLE_ADDRESS_SANITIZER)
-    set(CMAKE_C_FLAGS "-lasan -fsanitize=address ${CMAKE_C_FLAGS}")
-    set(CMAKE_CXX_FLAGS "-lasan -fsanitize=address ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_C_FLAGS "-lasan -fsanitize=address ${CMAKE_C_FLAGS} -Wl,--allow-shlib-undefined")
+    set(CMAKE_CXX_FLAGS "-lasan -fsanitize=address ${CMAKE_CXX_FLAGS} -Wl,--allow-shlib-undefined")
 endif()


[40/50] celix git commit: CELIX-351: Refactoring of shell to use service tracker instead of service listener.

Posted by pn...@apache.org.
CELIX-351: Refactoring of shell to use service tracker instead of service listener.


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

Branch: refs/heads/release/celix-2.0.0
Commit: 90adc1f4ef56f75b64e8943f9848f9f51b26048b
Parents: e0812b0
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 12 15:03:05 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 12 15:03:05 2016 +0100

----------------------------------------------------------------------
 .../private/src/dm_shell_list_command.c         |  1 +
 framework/private/src/service_tracker.c         |  1 -
 shell/private/include/shell_private.h           |  5 +-
 shell/private/src/activator.c                   | 49 ++++++--------------
 shell/private/src/shell.c                       | 38 ++-------------
 5 files changed, 21 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/90adc1f4/dependency_manager/private/src/dm_shell_list_command.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_shell_list_command.c b/dependency_manager/private/src/dm_shell_list_command.c
index 4862d42..6f95eb9 100644
--- a/dependency_manager/private/src/dm_shell_list_command.c
+++ b/dependency_manager/private/src/dm_shell_list_command.c
@@ -107,6 +107,7 @@ void dmListCommand_execute(bundle_context_pt context, char * line, FILE *out, FI
             infoServ->destroyInfo(infoServ->handle, info);
 
 		bundleContext_ungetService(context,servRef,NULL);
+		bundleContext_ungetServiceReference(context,servRef);
 
         }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/90adc1f4/framework/private/src/service_tracker.c
----------------------------------------------------------------------
diff --git a/framework/private/src/service_tracker.c b/framework/private/src/service_tracker.c
index 1fb9b37..546ee5d 100644
--- a/framework/private/src/service_tracker.c
+++ b/framework/private/src/service_tracker.c
@@ -132,7 +132,6 @@ celix_status_t serviceTracker_open(service_tracker_pt tracker) {
 			for (i = 0; i < arrayList_size(initial); i++) {
 				initial_reference = (service_reference_pt) arrayList_get(initial, i);
 				serviceTracker_track(tracker, initial_reference, NULL);
-                bundleContext_ungetServiceReference(tracker->context, initial_reference);
 			}
 			arrayList_clear(initial);
 			arrayList_destroy(initial);

http://git-wip-us.apache.org/repos/asf/celix/blob/90adc1f4/shell/private/include/shell_private.h
----------------------------------------------------------------------
diff --git a/shell/private/include/shell_private.h b/shell/private/include/shell_private.h
index c3a3386..7270fa2 100644
--- a/shell/private/include/shell_private.h
+++ b/shell/private/include/shell_private.h
@@ -42,11 +42,10 @@ struct shell {
 
 celix_status_t shell_create(bundle_context_pt context_ptr, shell_service_pt *shell_service_ptr);
 celix_status_t shell_destroy(shell_service_pt *shell_service_ptr);
-celix_status_t shell_addCommand(shell_pt shell_ptr, service_reference_pt reference_ptr);
-celix_status_t shell_removeCommand(shell_pt shell_ptr, service_reference_pt reference_ptr);
+celix_status_t shell_addCommand(shell_pt shell_ptr, service_reference_pt reference_ptr, void *svc);
+celix_status_t shell_removeCommand(shell_pt shell_ptr, service_reference_pt reference_ptr, void *svc);
 
 celix_status_t shell_getCommandReference(shell_pt shell_ptr, char *command_name_str, service_reference_pt *command_reference_ptr);
 celix_status_t shell_executeCommand(shell_pt shell_ptr, char *command_line_str, FILE *out, FILE *err);
-celix_status_t shell_serviceChanged(service_listener_pt listener_ptr, service_event_pt event_ptr);
 
 #endif /* SHELL_PRIVATE_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/90adc1f4/shell/private/src/activator.c
----------------------------------------------------------------------
diff --git a/shell/private/src/activator.c b/shell/private/src/activator.c
index 69f656f..b98cb26 100644
--- a/shell/private/src/activator.c
+++ b/shell/private/src/activator.c
@@ -28,6 +28,7 @@
 #include "shell_private.h"
 #include "bundle_activator.h"
 #include "std_commands.h"
+#include "service_tracker.h"
 
 #define NUMBER_OF_COMMANDS 10
 
@@ -44,7 +45,7 @@ struct command {
 struct bundle_instance {
 	shell_service_pt shellService;
 	service_registration_pt registration;
-	service_listener_pt listener;
+    service_tracker_pt tracker;
 
     struct command std_commands[NUMBER_OF_COMMANDS];
 };
@@ -179,8 +180,6 @@ celix_status_t bundleActivator_start(void *_ptr, bundle_context_pt context_ptr)
 	celix_status_t status = CELIX_SUCCESS;
 
 	bundle_instance_pt instance_ptr  = (bundle_instance_pt) _ptr;
-    array_list_pt references_ptr     = NULL;
-    service_listener_pt listener_ptr = NULL;
 
     if (!instance_ptr || !context_ptr) {
         status = CELIX_ILLEGAL_ARGUMENT;
@@ -191,29 +190,12 @@ celix_status_t bundleActivator_start(void *_ptr, bundle_context_pt context_ptr)
     }
 
 	if (status == CELIX_SUCCESS) {
-        listener_ptr = (service_listener_pt) calloc(1, sizeof(*listener_ptr));
-        if (!listener_ptr) {
-            status = CELIX_ENOMEM;
-        }
-    }
-
-    if (status == CELIX_SUCCESS) {
-        instance_ptr->listener = listener_ptr;
-        listener_ptr->handle = instance_ptr->shellService->shell;
-        listener_ptr->serviceChanged = (void *) shell_serviceChanged;
-
-        status = bundleContext_addServiceListener(context_ptr, listener_ptr, "(objectClass=commandService)");
+        service_tracker_customizer_pt cust = NULL;
+        serviceTrackerCustomizer_create(instance_ptr->shellService->shell, NULL, (void *)shell_addCommand, NULL, (void *)shell_removeCommand, &cust);
+        serviceTracker_create(context_ptr, (char *)OSGI_SHELL_COMMAND_SERVICE_NAME, cust, &instance_ptr->tracker);
+        serviceTracker_open(instance_ptr->tracker);
     }
 
-    if (status == CELIX_SUCCESS) {
-        status = bundleContext_getServiceReferences(context_ptr, "commandService", NULL, &references_ptr);
-    }
-
-    if (status == CELIX_SUCCESS) {
-        for (unsigned int i = 0; i < arrayList_size(references_ptr); i++) {
-            shell_addCommand(instance_ptr->shellService->shell, arrayList_get(references_ptr, i));
-        }
-    }
 
     if (status == CELIX_SUCCESS) {
         for (unsigned int i = 0; instance_ptr->std_commands[i].exec != NULL; i++) {
@@ -226,19 +208,13 @@ celix_status_t bundleActivator_start(void *_ptr, bundle_context_pt context_ptr)
             }
 
         }
-		arrayList_destroy(references_ptr);
 	}
 
-    if (status != CELIX_SUCCESS) {
-        bundleActivator_stop(_ptr, context_ptr);
-    }
-
 	return status;
 }
 
 celix_status_t bundleActivator_stop(void *_ptr, bundle_context_pt context_ptr) {
     celix_status_t status = CELIX_SUCCESS;
-    celix_status_t sub_status;
 
     bundle_instance_pt instance_ptr = (bundle_instance_pt) _ptr;
 
@@ -251,9 +227,8 @@ celix_status_t bundleActivator_stop(void *_ptr, bundle_context_pt context_ptr) {
             }
         }
 
-        sub_status = bundleContext_removeServiceListener(context_ptr, instance_ptr->listener);
-        if (status == CELIX_SUCCESS && sub_status != CELIX_SUCCESS) {
-            status = sub_status;
+        if (instance_ptr->tracker != NULL) {
+            serviceTracker_close(instance_ptr->tracker);
         }
     } else {
         status = CELIX_ILLEGAL_ARGUMENT;
@@ -268,14 +243,18 @@ celix_status_t bundleActivator_destroy(void *_ptr, bundle_context_pt __attribute
     bundle_instance_pt instance_ptr = (bundle_instance_pt) _ptr;
 
     if (instance_ptr) {
+        serviceRegistration_unregister(instance_ptr->registration);
+
         for (unsigned int i = 0; instance_ptr->std_commands[i].exec != NULL; i++) {
             free(instance_ptr->std_commands[i].service);
         }
 
-        serviceRegistration_unregister(instance_ptr->registration);
         shell_destroy(&instance_ptr->shellService);
 
-        free(instance_ptr->listener);
+        if (instance_ptr->tracker != NULL) {
+            serviceTracker_destroy(instance_ptr->tracker);
+        }
+
         free(instance_ptr);
     } else {
         status = CELIX_ILLEGAL_ARGUMENT;

http://git-wip-us.apache.org/repos/asf/celix/blob/90adc1f4/shell/private/src/shell.c
----------------------------------------------------------------------
diff --git a/shell/private/src/shell.c b/shell/private/src/shell.c
index c48c265..8f8241e 100644
--- a/shell/private/src/shell.c
+++ b/shell/private/src/shell.c
@@ -107,7 +107,7 @@ celix_status_t shell_destroy(shell_service_pt *shell_service_ptr) {
 	return status;
 }
 
-celix_status_t shell_addCommand(shell_pt shell_ptr, service_reference_pt reference_ptr) {
+celix_status_t shell_addCommand(shell_pt shell_ptr, service_reference_pt reference_ptr, void *svc) {
     celix_status_t status = CELIX_SUCCESS;
     command_service_pt command_ptr = NULL;
     char *name_str = NULL;
@@ -117,10 +117,7 @@ celix_status_t shell_addCommand(shell_pt shell_ptr, service_reference_pt referen
     }
 
     if (status == CELIX_SUCCESS) {
-        status = bundleContext_getService(shell_ptr->bundle_context_ptr, reference_ptr, (void **) &command_ptr);
-        if (!command_ptr) {
-            status = CELIX_BUNDLE_EXCEPTION;
-        }
+        command_ptr = svc;
     }
 
     if (status == CELIX_SUCCESS) {
@@ -137,7 +134,7 @@ celix_status_t shell_addCommand(shell_pt shell_ptr, service_reference_pt referen
     }
 
     if (status != CELIX_SUCCESS) {
-        shell_removeCommand(shell_ptr, reference_ptr);
+        shell_removeCommand(shell_ptr, reference_ptr, svc);
         char err[32];
         celix_strerror(status, err, 32);
         logHelper_log(shell_ptr->logHelper, OSGI_LOGSERVICE_ERROR, "Could not add command, got error %s\n", err);
@@ -146,7 +143,7 @@ celix_status_t shell_addCommand(shell_pt shell_ptr, service_reference_pt referen
     return status;
 }
 
-celix_status_t shell_removeCommand(shell_pt shell_ptr, service_reference_pt reference_ptr) {
+celix_status_t shell_removeCommand(shell_pt shell_ptr, service_reference_pt reference_ptr, void *svc) {
     celix_status_t status = CELIX_SUCCESS;
 
     command_service_pt command_ptr = NULL;
@@ -174,13 +171,6 @@ celix_status_t shell_removeCommand(shell_pt shell_ptr, service_reference_pt refe
         hashMap_remove(shell_ptr->command_name_map_ptr, name_str);
     }
 
-    if (status == CELIX_SUCCESS) {
-        celix_status_t sub_status = bundleContext_ungetService(shell_ptr->bundle_context_ptr, reference_ptr, NULL);
-        if (sub_status != CELIX_SUCCESS && status == CELIX_SUCCESS) {
-            status = sub_status;
-        }
-    }
-
     return status;
 }
 
@@ -312,23 +302,3 @@ celix_status_t shell_executeCommand(shell_pt shell_ptr, char *command_line_str,
 
 	return status;
 }
-
-celix_status_t shell_serviceChanged(service_listener_pt listener_ptr, service_event_pt event_ptr) {
-	celix_status_t status = CELIX_SUCCESS;
-
-	if (!listener_ptr || !event_ptr || !listener_ptr->handle || !event_ptr->type || !event_ptr->reference) {
-		status = CELIX_ILLEGAL_ARGUMENT;
-	}
-
-	if (status == CELIX_SUCCESS) {
-		shell_pt shell_ptr = (shell_pt) listener_ptr->handle;
-		if (event_ptr->type == OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED) {
-			status = shell_addCommand(shell_ptr, event_ptr->reference);
-		} else if (event_ptr->type == OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING) {
-			status = shell_removeCommand(shell_ptr, event_ptr->reference);
-		}
-	}
-
-	return status;
-}
-


[13/50] celix git commit: CELIX-343: Fix some issues in config admin. Among others unbind configuration when bundles are removed

Posted by pn...@apache.org.
CELIX-343: Fix some issues in config admin. Among others unbind configuration when bundles are removed


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

Branch: refs/heads/release/celix-2.0.0
Commit: 4705f77269da4824e29e19137a734b4b69875516
Parents: c4a34a9
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 4 16:12:29 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 4 16:12:29 2016 +0100

----------------------------------------------------------------------
 config_admin/config_admin_tst/config_admin_test.cpp       |  2 +-
 .../config_admin_tst/example_test/private/src/activator.c |  9 +++++----
 config_admin/example/private/src/bundle_activator.c       |  2 +-
 config_admin/readme.md                                    | 10 +++++++++-
 config_admin/service/private/src/configuration_impl.c     |  7 ++++---
 config_admin/service/private/src/configuration_store.c    |  2 +-
 .../service/private/src/managed_service_tracker.c         |  9 +++++++++
 7 files changed, 30 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/4705f772/config_admin/config_admin_tst/config_admin_test.cpp
----------------------------------------------------------------------
diff --git a/config_admin/config_admin_tst/config_admin_test.cpp b/config_admin/config_admin_tst/config_admin_test.cpp
index 8539c76..80f1480 100644
--- a/config_admin/config_admin_tst/config_admin_test.cpp
+++ b/config_admin/config_admin_tst/config_admin_test.cpp
@@ -337,7 +337,7 @@ tst2_service_pt test2Serv = NULL;
 			testServ->get_second_type(testServ->handle, value);
 			CHECK_TEXT("my_second_value", value);
 			printf("end: %s\n", __func__);
-		 }
+	}
 }
 
 

http://git-wip-us.apache.org/repos/asf/celix/blob/4705f772/config_admin/config_admin_tst/example_test/private/src/activator.c
----------------------------------------------------------------------
diff --git a/config_admin/config_admin_tst/example_test/private/src/activator.c b/config_admin/config_admin_tst/example_test/private/src/activator.c
index 2507e4e..bae4daf 100644
--- a/config_admin/config_admin_tst/example_test/private/src/activator.c
+++ b/config_admin/config_admin_tst/example_test/private/src/activator.c
@@ -123,13 +123,11 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
 				printf("[ TEST ]: ConfigAdminService not available\n");
 			} else {
 				char *pid = "base.device1";
-				properties_pt dictionary;
 				configuration_pt configuration;
 				/* ------------------ get Configuration -------------------*/
 				(*confAdminServ->getConfiguration)(confAdminServ->configAdmin,pid, &configuration);
 				act->configAdminServ = confAdminServ;
 				act->configAdminServRef = ref;
-
 				managed_service_pt managedService;
 				status = managedServiceImpl_create(ctx, &managedService);
 				if (status != CELIX_SUCCESS){
@@ -147,19 +145,20 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
 
 				act->mgmServ->managedService = managedService;
 				act->mgmServ->updated = managedServiceImpl_updated;
-
+				properties_pt dictionary;
 				configuration->configuration_getProperties(configuration->handle, &dictionary);
 				if (dictionary == NULL) {
 					dictionary = properties_create();
 					properties_set(dictionary, (char *) OSGI_FRAMEWORK_SERVICE_PID, pid);
 					properties_set(dictionary, (char *) "type", (char*)"default_value");
 				}
+				// the service has to be registered with a properties/dictionary structure that at least contains a pid to assure it
+				// is picked up by the managedServiceTracker of the configuration Admin
 				status = bundleContext_registerService(ctx, (char *) MANAGED_SERVICE_SERVICE_NAME, act->mgmServ, dictionary, &act->mgmReg);
 				if (status != CELIX_SUCCESS){
 					printf("[ ERROR ]: Managed Service not registered \n");
 					return status;
 				}
-
 				status = bundleContext_registerService(ctx, (char *)TST_SERVICE_NAME, act->tstServ, NULL, &act->tstReg);
 
 			}
@@ -186,8 +185,10 @@ celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context)
 
 celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
 	struct activator *act = (struct activator *)userData;
+
 	managedServiceImpl_destroy(&act->mgmServ->managedService);
 	managedService_destroy(act->mgmServ);
+
 	free(act->tstServ);
 	free(act);
 	return CELIX_SUCCESS;

http://git-wip-us.apache.org/repos/asf/celix/blob/4705f772/config_admin/example/private/src/bundle_activator.c
----------------------------------------------------------------------
diff --git a/config_admin/example/private/src/bundle_activator.c b/config_admin/example/private/src/bundle_activator.c
index 55bc11e..3e4622f 100644
--- a/config_admin/example/private/src/bundle_activator.c
+++ b/config_admin/example/private/src/bundle_activator.c
@@ -44,7 +44,7 @@ celix_status_t bundleActivator_start(void *userData, bundle_context_pt context)
         properties_set(props, "service.pid", "org.example.config.admin"); 
         activator->managed->managedService = (void *)activator->example;
         activator->managed->updated = (void *)example_updated;
-		bundleContext_registerService(context, (char *)  MANAGED_SERVICE_SERVICE_NAME, activator->managed, NULL, &activator->managedServiceRegistry);
+		bundleContext_registerService(context, (char *)  MANAGED_SERVICE_SERVICE_NAME, activator->managed, props, &activator->managedServiceRegistry);
 	}
 
 	return status;

http://git-wip-us.apache.org/repos/asf/celix/blob/4705f772/config_admin/readme.md
----------------------------------------------------------------------
diff --git a/config_admin/readme.md b/config_admin/readme.md
index 900d8a7..db13504 100644
--- a/config_admin/readme.md
+++ b/config_admin/readme.md
@@ -11,6 +11,11 @@ When compared to config.properties it adds the option to update configuration da
 ## Design
 
 The config_admin bundle implements the configuration_admin service, the interface to configuration objects and the interface of a managed service. At the moment, the implementation uses a config_admin_factory to generate config_admin services for each bundle that wants to use this service. This is an inheritance of the original design and not needed.
+The configuration data is stored persistently in a subdirectory store of the current bundle directory. 
+The filenames have the name of the PID and have an extension pid, e.g. base.device1.pid
+The files contains a list of key/value pairs. At least the following keys need to be present:
+service.bundleLocation
+service.pid
 
 ---
 
@@ -18,12 +23,15 @@ The config_admin bundle implements the configuration_admin service, the interfac
 
 1. Test the configuration of a service_factory
 2. Think about the option to allow remote update of the managed_services
+3. Support configuration of multiple managed services with the same PID. At the moment, only one service is bound to a configuration object.
+   To support this the getConfiguration2 function needs to be called with a location NULL according to the spec.
 
 ---
 
 ## Usage
 
 1. Bundle that needs configuration data
-   This bundle has to register next to its normal service a managed service that has an update method.  Use config_admin_tst/example_test as an example (it is better than example_test2)
+   This bundle has to register next to its normal service a managed service that has an update method. This managed service needs to be registered with a properties object that contains the key/value pair service.pid=<PID NAME>.
+ Use config_admin_tst/example_test as an example (it is better than example_test2)
 2. Bundle/application that wants to update the configuration data of the system
    This bundle needs to retrieve the running config_admin service. With this service it can retrieve all configuration objects for all known Persistent Identifiers (PIDs). For each PID, get all properites that need to be updated. See config_admin_test for an example.

http://git-wip-us.apache.org/repos/asf/celix/blob/4705f772/config_admin/service/private/src/configuration_impl.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/configuration_impl.c b/config_admin/service/private/src/configuration_impl.c
index f39dfa0..eed51ff 100644
--- a/config_admin/service/private/src/configuration_impl.c
+++ b/config_admin/service/private/src/configuration_impl.c
@@ -455,7 +455,8 @@ celix_status_t configuration_bind(configuration_impl_pt configuration, bundle_pt
 }
 
 celix_status_t configuration_unbind(configuration_impl_pt configuration, bundle_pt bundle){
-	return CELIX_SUCCESS;
+	configuration->boundBundle = NULL;
+    return CELIX_SUCCESS;
 }
 
 celix_status_t configuration_getBundleLocation2(configuration_impl_pt configuration, bool checkPermission, char **location){
@@ -635,9 +636,9 @@ celix_status_t configuration_setAutoProperties(configuration_impl_pt configurati
 	configuration_lock(configuration);
 
 	// (2) set service.pid
-    if (properties_get(*properties, (char*)OSGI_FRAMEWORK_SERVICE_PID) != NULL) {
+//    if (properties_get(*properties, (char*)OSGI_FRAMEWORK_SERVICE_PID) != NULL) {
         properties_set(*properties, (char*)OSGI_FRAMEWORK_SERVICE_PID, configuration->pid);
-    }
+//    }
 
 	// (3) set factory.pid
 	if ( configuration->factoryPid != NULL ){

http://git-wip-us.apache.org/repos/asf/celix/blob/4705f772/config_admin/service/private/src/configuration_store.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/configuration_store.c b/config_admin/service/private/src/configuration_store.c
index d4bb831..37b091e 100644
--- a/config_admin/service/private/src/configuration_store.c
+++ b/config_admin/service/private/src/configuration_store.c
@@ -261,7 +261,7 @@ celix_status_t configurationStore_writeConfigurationFile(int file, properties_pt
         char* key = hashMapEntry_getKey(entry);
         char* val = hashMapEntry_getValue(entry);
 
-        snprintf(buffer, 256, "%s=%s", key, val);
+        snprintf(buffer, 256, "%s=%s\n", key, val);
 
         int buffLength = strlen((const char *) buffer);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/4705f772/config_admin/service/private/src/managed_service_tracker.c
----------------------------------------------------------------------
diff --git a/config_admin/service/private/src/managed_service_tracker.c b/config_admin/service/private/src/managed_service_tracker.c
index e723f29..1ce5ac1 100644
--- a/config_admin/service/private/src/managed_service_tracker.c
+++ b/config_admin/service/private/src/managed_service_tracker.c
@@ -399,6 +399,15 @@ celix_status_t managedServiceTracker_add(managed_service_tracker_pt tracker, ser
 }
 
 celix_status_t managedServiceTracker_remove(managed_service_tracker_pt tracker, service_reference_pt reference, char * pid){
+    configuration_pt configuration = NULL;
+    bundle_pt bundle = NULL;
+
+    configurationStore_findConfiguration(tracker->configurationStore, pid, &configuration);
+    if (configuration != NULL) {
+        if (serviceReference_getBundle(reference, &bundle) == CELIX_SUCCESS) {
+			configuration_unbind(configuration->handle, bundle);
+		}	
+	}
 	return managedServiceTracker_untrackManagedService(tracker, pid, reference);
 }
 


[34/50] celix git commit: CELIX-351: Adds a retained refs list per service listener, so that when service listener are removed correct cleanup can be done.

Posted by pn...@apache.org.
CELIX-351: Adds a retained refs list per service listener, so that when service listener are removed correct cleanup can be done.


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

Branch: refs/heads/release/celix-2.0.0
Commit: e6bff9f584570fe21e6ac18e10f1c6b5a8c2e7af
Parents: e3e6d1a
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 11 13:09:46 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 11 13:09:46 2016 +0100

----------------------------------------------------------------------
 framework/private/src/framework.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e6bff9f5/framework/private/src/framework.c
----------------------------------------------------------------------
diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c
index 691bb40..56b02cd 100644
--- a/framework/private/src/framework.c
+++ b/framework/private/src/framework.c
@@ -109,6 +109,7 @@ struct fw_serviceListener {
 	bundle_pt bundle;
 	service_listener_pt listener;
 	filter_pt filter;
+    array_list_pt retainedReferences;
 };
 
 typedef struct fw_serviceListener * fw_service_listener_pt;
@@ -1379,6 +1380,7 @@ void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_lis
 	bundle_context_pt context = NULL;
 
 	fwListener->bundle = bundle;
+    arrayList_create(&fwListener->retainedReferences);
 	if (sfilter != NULL) {
 		filter_pt filter = filter_create(sfilter);
 		fwListener->filter = filter;
@@ -1447,8 +1449,22 @@ void fw_removeServiceListener(framework_pt framework, bundle_pt bundle, service_
 
 			arrayList_remove(framework->serviceListeners, i);
 			i--;
+            
+            //unregistering retained service references. For these refs a unregister event will not be triggered.
+            int k;
+            int rSize = arrayList_size(element->retainedReferences);
+            for (k = 0; k < rSize; k += 1) {
+                service_reference_pt ref = arrayList_get(element->retainedReferences, i);
+                if (ref != NULL) {
+                    serviceRegistry_ungetServiceReference(framework->registry, element->bundle, ref); // decrease retain counter                                       
+                } else {
+                    //TODO,FIXME ref is sometimes NULL. This should not happen, investigate why
+                }
+            }
+
 			element->bundle = NULL;
 			filter_destroy(element->filter);
+            arrayList_destroy(element->retainedReferences);
 			element->filter = NULL;
 			element->listener = NULL;
 			free(element);
@@ -1605,12 +1621,11 @@ void fw_serviceChanged(framework_pt framework, service_event_type_e eventType, s
 
                 serviceRegistry_getServiceReference(framework->registry, element->bundle, registration, &reference);
                 
-                
-                //FIXME, TODO need to retain the service ref. If not bundles using the service_listener will crash.
-                //update service_listener users so that they retain references if the keep them. 
-                //NOTE: that you are never sure that the UNREGISTERED event will by handle by an service_listener (could be gone))
+                //NOTE: that you are never sure that the UNREGISTERED event will by handle by an service_listener. listener could be gone
+                //Every reference retained is therefore stored and called when a service listener is removed from the framework.
                 if (eventType == OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED) {
                     serviceRegistry_retainServiceReference(framework->registry, element->bundle, reference);
+                    arrayList_add(element->retainedReferences, reference); //TODO improve by using set (or hashmap) instead of list
                 }
 
                 event->type = eventType;
@@ -1621,7 +1636,8 @@ void fw_serviceChanged(framework_pt framework, service_event_type_e eventType, s
                 serviceRegistry_ungetServiceReference(framework->registry, element->bundle, reference);
                 
                 if (eventType == OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING) {
-                    serviceRegistry_ungetServiceReference(framework->registry, element->bundle, reference); // to counter retain    
+                    arrayList_removeElement(element->retainedReferences, reference);
+                    serviceRegistry_ungetServiceReference(framework->registry, element->bundle, reference); // decrease retain counter
                 }
                 
                 free(event);


[43/50] celix git commit: CELIX-347: Improves dependency manager linking, so library with undefined symbols are not expected (for Linux)

Posted by pn...@apache.org.
CELIX-347: Improves dependency manager linking, so library with undefined symbols are not expected (for Linux)


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

Branch: refs/heads/release/celix-2.0.0
Commit: 0251da239366df133b4f23cc7b0529df7eb82a45
Parents: 90adc1f
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Feb 16 14:56:18 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Feb 16 14:56:18 2016 +0100

----------------------------------------------------------------------
 dependency_manager/private/src/dm_service_dependency.c | 10 ++++++++--
 examples/dm_example/phase1/CMakeLists.txt              |  4 ++--
 examples/dm_example/phase2a/CMakeLists.txt             |  4 ++--
 examples/dm_example/phase2b/CMakeLists.txt             |  4 ++--
 examples/dm_example/phase3/CMakeLists.txt              |  4 ++--
 5 files changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/0251da23/dependency_manager/private/src/dm_service_dependency.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_service_dependency.c b/dependency_manager/private/src/dm_service_dependency.c
index 4e77175..f81bd93 100644
--- a/dependency_manager/private/src/dm_service_dependency.c
+++ b/dependency_manager/private/src/dm_service_dependency.c
@@ -229,10 +229,16 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency,
 
             while (arrayListIterator_hasNext(filterElementsIter) == true) {
                 char* filterElement = (char*) arrayListIterator_next(filterElementsIter);
-                size_t len = strlen(dependency->tracked_filter) + strlen(filterElement) + 4;
+                size_t len = strnlen(dependency->tracked_filter, 1024*1024) + strnlen(filterElement, 1024*1024) + 4;
                 char* newFilter = calloc(len, sizeof(*newFilter));
 
-                snprintf(newFilter, len, "(&%s%s)", dependency->tracked_filter, filterElement);
+                if (dependency->tracked_filter[0] == '(' && dependency->tracked_filter[1] == '&') {
+                    //already have an & (AND) can combine with additional filter -> easier to read
+                    size_t orgLen = strnlen(dependency->tracked_filter, 1024*1024);
+                    snprintf(newFilter, len, "%.*s%s)", (int)orgLen -1, dependency->tracked_filter, filterElement);
+                } else {
+                    snprintf(newFilter, len, "(&%s%s)", dependency->tracked_filter, filterElement);
+                }
 
                 free(dependency->tracked_filter);
                 free(filterElement);

http://git-wip-us.apache.org/repos/asf/celix/blob/0251da23/examples/dm_example/phase1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase1/CMakeLists.txt b/examples/dm_example/phase1/CMakeLists.txt
index d61fc77..b8c34b3 100644
--- a/examples/dm_example/phase1/CMakeLists.txt
+++ b/examples/dm_example/phase1/CMakeLists.txt
@@ -32,7 +32,7 @@ add_bundle(phase1
 #bundle_private_libs(phase1 dependency_manager)
 
 IF(APPLE)
-target_link_libraries(phase1 celix_framework -Wl,-all_load dependency_manager_static)
+    target_link_libraries(phase1 celix_framework -Wl,-all_load dependency_manager_static)
 else()
-target_link_libraries(phase1 -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    target_link_libraries(phase1 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
 ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/0251da23/examples/dm_example/phase2a/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2a/CMakeLists.txt b/examples/dm_example/phase2a/CMakeLists.txt
index 0884250..5474534 100644
--- a/examples/dm_example/phase2a/CMakeLists.txt
+++ b/examples/dm_example/phase2a/CMakeLists.txt
@@ -29,7 +29,7 @@ add_bundle(phase2a
 )
 
 IF(APPLE)
-target_link_libraries(phase2a celix_framework -Wl,-all_load dependency_manager_static)
+    target_link_libraries(phase2a celix_framework -Wl,-all_load dependency_manager_static)
 else()
-target_link_libraries(phase2a -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    target_link_libraries(phase2a -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
 ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/0251da23/examples/dm_example/phase2b/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2b/CMakeLists.txt b/examples/dm_example/phase2b/CMakeLists.txt
index 5bd2a6e..ff3089c 100644
--- a/examples/dm_example/phase2b/CMakeLists.txt
+++ b/examples/dm_example/phase2b/CMakeLists.txt
@@ -31,7 +31,7 @@ add_bundle(phase2b
 #bundle_private_libs(phase2b dependency_manager)
 
 IF(APPLE)
-target_link_libraries(phase2b celix_framework -Wl,-all_load dependency_manager_static)
+    target_link_libraries(phase2b celix_framework -Wl,-all_load dependency_manager_static)
 else()
-target_link_libraries(phase2b -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    target_link_libraries(phase2b -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
 ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/0251da23/examples/dm_example/phase3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase3/CMakeLists.txt b/examples/dm_example/phase3/CMakeLists.txt
index ba195cd..71d31c0 100644
--- a/examples/dm_example/phase3/CMakeLists.txt
+++ b/examples/dm_example/phase3/CMakeLists.txt
@@ -31,7 +31,7 @@ add_bundle(phase3
 #bundle_private_libs(phase3 dependency_manager)
 
 IF(APPLE)
-target_link_libraries(phase3 celix_framework -Wl,-all_load dependency_manager_static)
+    target_link_libraries(phase3 celix_framework -Wl,-all_load dependency_manager_static)
 else()
-target_link_libraries(phase3 -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
+    target_link_libraries(phase3 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive celix_framework)
 ENDIF()


[37/50] celix git commit: CELIX-351: Adds mutex usage to shell_tui to protect services changes

Posted by pn...@apache.org.
CELIX-351: Adds mutex usage to shell_tui to protect services changes


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

Branch: refs/heads/release/celix-2.0.0
Commit: 94348219b56d641bcbe9547d40a71962521c2afa
Parents: 58f521f
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 11 20:35:02 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 11 20:35:02 2016 +0100

----------------------------------------------------------------------
 dependency_manager/CMakeLists.txt     | 6 +++++-
 shell_tui/private/include/shell_tui.h | 1 +
 shell_tui/private/src/activator.c     | 9 ++++++++-
 shell_tui/private/src/shell_tui.c     | 2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/94348219/dependency_manager/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/dependency_manager/CMakeLists.txt b/dependency_manager/CMakeLists.txt
index 8c1f74f..5ec35ec 100644
--- a/dependency_manager/CMakeLists.txt
+++ b/dependency_manager/CMakeLists.txt
@@ -57,7 +57,11 @@ if (DEPENDENCY_MANAGER)
         private/src/dm_dependency_manager_impl
     )
     set_target_properties(dependency_manager_so PROPERTIES SOVERSION 1)
-    target_link_libraries(dependency_manager_so celix_framework)
+    if (APPLE) 
+        target_link_libraries(dependency_manager_so celix_framework "-undefined dynamic_lookup")
+    else()
+        target_link_libraries(dependency_manager_so celix_framework)
+    endif()
 
    	include_directories("public/include")
    	include_directories("private/include")

http://git-wip-us.apache.org/repos/asf/celix/blob/94348219/shell_tui/private/include/shell_tui.h
----------------------------------------------------------------------
diff --git a/shell_tui/private/include/shell_tui.h b/shell_tui/private/include/shell_tui.h
index 2d7c251..29f5eda 100644
--- a/shell_tui/private/include/shell_tui.h
+++ b/shell_tui/private/include/shell_tui.h
@@ -41,6 +41,7 @@ struct shellTuiActivator {
     service_tracker_pt tracker;
     bool running;
     celix_thread_t runnable;
+    celix_thread_mutex_t mutex;
 };
 
 typedef struct shellTuiActivator * shell_tui_activator_pt;

http://git-wip-us.apache.org/repos/asf/celix/blob/94348219/shell_tui/private/src/activator.c
----------------------------------------------------------------------
diff --git a/shell_tui/private/src/activator.c b/shell_tui/private/src/activator.c
index 1759e38..ec28088 100644
--- a/shell_tui/private/src/activator.c
+++ b/shell_tui/private/src/activator.c
@@ -35,13 +35,19 @@
 
 static celix_status_t activator_addShellService(void *handle, service_reference_pt ref, void *svc) {
     shell_tui_activator_pt act = (shell_tui_activator_pt) handle;
+    celixThreadMutex_lock(&act->mutex);
     act->shell = svc;
+    celixThreadMutex_unlock(&act->mutex);
     return CELIX_SUCCESS;
 }
 
 static celix_status_t activator_removeShellService(void *handle, service_reference_pt ref, void *svc) {
     shell_tui_activator_pt act = (shell_tui_activator_pt) handle;
-    act->shell = svc;
+    celixThreadMutex_lock(&act->mutex);
+    if (act->shell == svc) {
+        act->shell = NULL;
+    }
+    celixThreadMutex_unlock(&act->mutex);
     return CELIX_SUCCESS;
 }
 
@@ -52,6 +58,7 @@ celix_status_t bundleActivator_create(bundle_context_pt context, void **userData
 
 	if (activator) {
 		activator->shell = NULL;
+        celixThreadMutex_create(&activator->mutex, NULL);
 		(*userData) = activator;
 	}
 	else {

http://git-wip-us.apache.org/repos/asf/celix/blob/94348219/shell_tui/private/src/shell_tui.c
----------------------------------------------------------------------
diff --git a/shell_tui/private/src/shell_tui.c b/shell_tui/private/src/shell_tui.c
index fbff74e..b659188 100644
--- a/shell_tui/private/src/shell_tui.c
+++ b/shell_tui/private/src/shell_tui.c
@@ -72,11 +72,13 @@ static void* shellTui_runnable(void *data) {
                 continue;
             }
 
+            celixThreadMutex_lock(&act->mutex);
             if (act->shell != NULL) {
                 act->shell->executeCommand(act->shell->shell, line, stdout, stderr);
             } else {
                 fprintf(stderr, "Shell service not available\n");
             }
+            celixThreadMutex_unlock(&act->mutex);
         }
     }
 


[33/50] celix git commit: CELIX-350: Fixes wrong handling of shell service refernce in the shell_tui

Posted by pn...@apache.org.
CELIX-350: Fixes wrong handling of shell service refernce in the shell_tui


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

Branch: refs/heads/release/celix-2.0.0
Commit: e3e6d1a4e637015f87bf454db3cad0867b55a439
Parents: d4fe655
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 10 12:46:03 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 10 12:46:03 2016 +0100

----------------------------------------------------------------------
 shell_tui/private/src/activator.c | 3 ---
 shell_tui/private/src/shell_tui.c | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e3e6d1a4/shell_tui/private/src/activator.c
----------------------------------------------------------------------
diff --git a/shell_tui/private/src/activator.c b/shell_tui/private/src/activator.c
index ee03b30..1e79bea 100644
--- a/shell_tui/private/src/activator.c
+++ b/shell_tui/private/src/activator.c
@@ -74,9 +74,6 @@ celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context)
 	celix_status_t status;
 	shell_tui_activator_pt activator = (shell_tui_activator_pt) userData;
 
-	bundleContext_ungetService(activator->context,activator->reference,NULL);
-	bundleContext_ungetServiceReference(activator->context,activator->reference);
-
 	status = bundleContext_removeServiceListener(context, activator->listener);
 
 	if (status == CELIX_SUCCESS) {

http://git-wip-us.apache.org/repos/asf/celix/blob/e3e6d1a4/shell_tui/private/src/shell_tui.c
----------------------------------------------------------------------
diff --git a/shell_tui/private/src/shell_tui.c b/shell_tui/private/src/shell_tui.c
index fd5b62c..08bc3f8 100644
--- a/shell_tui/private/src/shell_tui.c
+++ b/shell_tui/private/src/shell_tui.c
@@ -111,10 +111,10 @@ celix_status_t shellTui_serviceChanged(service_listener_pt listener, service_eve
         status = shellTui_initializeService(act);
     } else if ((event->type == OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING) && (equals)) {
         bundleContext_ungetService(act->context, act->reference, &result);
+        bundleContext_ungetServiceReference(act->context,act->reference);
         act->reference = NULL;
         act->shell = NULL;
 
-        status = shellTui_initializeService(act);
     }
 
     return status;


[26/50] celix git commit: CELIX-335: fixed travis setup/Dockerfile

Posted by pn...@apache.org.
CELIX-335: fixed travis setup/Dockerfile


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

Branch: refs/heads/release/celix-2.0.0
Commit: 492c21476e45fe934ec9b09774c1e0711f50973d
Parents: 5c5f35a
Author: Bjoern Petri <bp...@apache.org>
Authored: Tue Feb 9 13:17:26 2016 +0100
Committer: Bjoern Petri <bp...@apache.org>
Committed: Tue Feb 9 13:17:26 2016 +0100

----------------------------------------------------------------------
 .travis.yml        | 6 +++---
 Dockerfile.Android | 5 ++++-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/492c2147/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index c0d2075..3e8b170 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,9 +31,9 @@ matrix:
        - os: linux
          compiler: gcc
          env: SANITIZE=1
-#       - os: linux
-#         compiler: clang
-#         env: ANDROID=1
+       - os: linux
+         compiler: clang
+         env: ANDROID=1
 
 
 before_install:

http://git-wip-us.apache.org/repos/asf/celix/blob/492c2147/Dockerfile.Android
----------------------------------------------------------------------
diff --git a/Dockerfile.Android b/Dockerfile.Android
index 6960ce7..49cf790 100644
--- a/Dockerfile.Android
+++ b/Dockerfile.Android
@@ -36,6 +36,8 @@ ENV CHOST arm-linux-androideabi
 
 # install needed tools
 
+RUN apt-get install -y software-properties-common && add-apt-repository ppa:george-edison55/cmake-3.x
+
 RUN apt-get update && apt-get install -y \
     automake \
     build-essential \
@@ -112,8 +114,9 @@ RUN curl -L -O ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz && \
 	
 
 # finally add celix src
+
 RUN git clone -b develop --single-branch https://github.com/apache/celix.git celix
 
-CMD mkdir -p celix/build-android && cd celix/build-android && cmake -DANDROID=TRUE -DENABLE_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=OFF -DBUILD_RSA_TOPOLOGY_MANAGER=ON -DFFI_LIBRARY=/build/output/libffi/lib/libffi.a -DFFI_INCLUDE_DIR=/build/output/libffi/lib/libffi-3.2.1/include -DJANSSON_LIBRARY=/build/output/jansson/lib/libjansson.a -DJANSSON_INCLUDE_DIR=/build/output/jansson/include -DCURL_LIBRARY=/build/output/curl/lib/libcurl.a -DCURL_INCLUDE_DIR=/build/output/curl/include -DLIBXML2_LIBRARIES=/build/output/libxml2/lib/libxml2.a -DLIBXML2_INCLUDE_DIR=/build/output/libxml2/include/libxml2 -DZLIB_LIBRARY=/build/output/zlib/lib/libz.a -DZLIB_INCLUDE_DIR=/build/output/zlib/include -DUUID_LIBRARY=/build/output/uuid/lib/libuuid.a -DUUID_INCLUDE_DIR=/build/output/uuid/incl
 ude -DCMAKE_INSTALL_PREFIX:PATH=/build/output/celix .. && make && make install-all
+CMD mkdir -p celix/build-android && cd celix/build-android && cmake -DANDROID=TRUE -DENABLE_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=OFF -DBUILD_RSA_TOPOLOGY_MANAGER=ON -DFFI_LIBRARY=/build/output/libffi/lib/libffi.a -DFFI_INCLUDE_DIR=/build/output/libffi/lib/libffi-3.2.1/include -DJANSSON_LIBRARY=/build/output/jansson/lib/libjansson.a -DJANSSON_INCLUDE_DIR=/build/output/jansson/include -DCURL_LIBRARY=/build/output/curl/lib/libcurl.a -DCURL_INCLUDE_DIR=/build/output/curl/include -DLIBXML2_LIBRARIES=/build/output/libxml2/lib/libxml2.a -DLIBXML2_INCLUDE_DIR=/build/output/libxml2/include/libxml2 -DZLIB_LIBRARY=/build/output/zlib/lib/libz.a -DZLIB_INCLUDE_DIR=/build/output/zlib/include -DUUID_LIBRARY=/build/output/uuid/lib/libuuid.a -DUUID_INCLUDE_DIR=/build/output/uuid/incl
 ude -DCMAKE_INSTALL_PREFIX:PATH=/build/output/celix .. && make && make install
 
 # done


[03/50] celix git commit: CELIX-236: Added 'pip install pyyaml' instructions for the readme

Posted by pn...@apache.org.
CELIX-236: Added 'pip install pyyaml' instructions for the readme


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

Branch: refs/heads/release/celix-2.0.0
Commit: 15b41d221bbcd7acd04214ba4374ed635ec948e0
Parents: 2729299
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jan 26 12:59:26 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jan 26 12:59:26 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/README.md | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/15b41d22/celix-bootstrap/README.md
----------------------------------------------------------------------
diff --git a/celix-bootstrap/README.md b/celix-bootstrap/README.md
index cbd1f58..32296c6 100644
--- a/celix-bootstrap/README.md
+++ b/celix-bootstrap/README.md
@@ -5,12 +5,15 @@ A (python based) code generation tool for [Apache Celix](https://celix.apache.or
 
 ###Option 1 (install with distutils)
 
+* Install PyYAML: `pip install pyyaml`
 * Download Cog from https://pypi.python.org/pypi/cogapp
 * Unpack and run `python setup.py install' in the cogapp directory
 * Clone this repository
 * Run `python setup.py install` in the celix-bootstrap directory
 
 ###Option 2 (configure with alias)
+
+* Install PyYAML: `pip install pyyaml`
 * Download Cog from https://pypi.python.org/pypi/cogapp
 * Unpack it in a convenient directory 
 * Clone this repository


[35/50] celix git commit: CELIX-351: Refactoring of shell_tui to use service_tracker instead of service listener

Posted by pn...@apache.org.
CELIX-351: Refactoring of shell_tui to use service_tracker instead of service listener


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

Branch: refs/heads/release/celix-2.0.0
Commit: 91ba2a168f76da578d6032e66349f6740f52dc91
Parents: e6bff9f
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 11 15:28:41 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 11 15:28:41 2016 +0100

----------------------------------------------------------------------
 shell_tui/private/include/shell_tui.h |  8 ++---
 shell_tui/private/src/activator.c     | 55 ++++++++++++++++--------------
 shell_tui/private/src/shell_tui.c     | 54 ++++++++++-------------------
 3 files changed, 51 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/91ba2a16/shell_tui/private/include/shell_tui.h
----------------------------------------------------------------------
diff --git a/shell_tui/private/include/shell_tui.h b/shell_tui/private/include/shell_tui.h
index fec60c9..2d7c251 100644
--- a/shell_tui/private/include/shell_tui.h
+++ b/shell_tui/private/include/shell_tui.h
@@ -33,19 +33,19 @@
 #include "celix_threads.h"
 #include "service_reference.h"
 #include "shell.h"
+#include "service_tracker.h"
 
 struct shellTuiActivator {
     bundle_context_pt context;
     shell_service_pt shell;
-    service_reference_pt reference;
-    struct serviceListener * listener;
+    service_tracker_pt tracker;
     bool running;
     celix_thread_t runnable;
 };
 
 typedef struct shellTuiActivator * shell_tui_activator_pt;
 
-celix_status_t shellTui_initializeService(shell_tui_activator_pt activator);
-celix_status_t shellTui_serviceChanged(service_listener_pt listener, service_event_pt event);
+celix_status_t shellTui_start(shell_tui_activator_pt activator);
+celix_status_t shellTui_stop(shell_tui_activator_pt activator);
 
 #endif /* SHELL_TUI_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/91ba2a16/shell_tui/private/src/activator.c
----------------------------------------------------------------------
diff --git a/shell_tui/private/src/activator.c b/shell_tui/private/src/activator.c
index 1e79bea..1759e38 100644
--- a/shell_tui/private/src/activator.c
+++ b/shell_tui/private/src/activator.c
@@ -30,8 +30,20 @@
 
 
 #include "shell_tui.h"
+#include "service_tracker.h"
 
 
+static celix_status_t activator_addShellService(void *handle, service_reference_pt ref, void *svc) {
+    shell_tui_activator_pt act = (shell_tui_activator_pt) handle;
+    act->shell = svc;
+    return CELIX_SUCCESS;
+}
+
+static celix_status_t activator_removeShellService(void *handle, service_reference_pt ref, void *svc) {
+    shell_tui_activator_pt act = (shell_tui_activator_pt) handle;
+    act->shell = svc;
+    return CELIX_SUCCESS;
+}
 
 celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
 	celix_status_t status = CELIX_SUCCESS;
@@ -50,42 +62,30 @@ celix_status_t bundleActivator_create(bundle_context_pt context, void **userData
 }
 
 celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) {
-	celix_status_t status;
+	celix_status_t status = CELIX_SUCCESS;
 
 	shell_tui_activator_pt act = (shell_tui_activator_pt) userData;
-	service_listener_pt listener = (service_listener_pt) calloc(1, sizeof(*listener));
 
-	act->context = context;
-	act->running = true;
+    service_tracker_customizer_pt cust = NULL;
+    serviceTrackerCustomizer_create(userData, NULL, activator_addShellService, NULL, activator_removeShellService, &cust);
+    serviceTracker_create(context, (char *) OSGI_SHELL_SERVICE_NAME, cust, &act->tracker);
+    serviceTracker_open(act->tracker);
 
-	act->listener = listener;
-	act->listener->handle = act;
-	act->listener->serviceChanged = (void *) shellTui_serviceChanged;
-	status = bundleContext_addServiceListener(context, act->listener, "(objectClass=shellService)");
-
-	if (status == CELIX_SUCCESS) {
-		shellTui_initializeService(act);
-	}
+    shellTui_start(act);
 
 	return status;
 }
 
 celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) {
-	celix_status_t status;
-	shell_tui_activator_pt activator = (shell_tui_activator_pt) userData;
-
-	status = bundleContext_removeServiceListener(context, activator->listener);
-
-	if (status == CELIX_SUCCESS) {
-		free(activator->listener);
-
-		activator->running = false;
-		activator->listener = NULL;
-		activator->context = NULL;
-		activator->running = false;
+	celix_status_t status = CELIX_SUCCESS;
+	shell_tui_activator_pt act = (shell_tui_activator_pt) userData;
 
-		celixThread_join(activator->runnable, NULL);
-	}
+    if (act != NULL) {
+        shellTui_stop(act);
+        if (act->tracker != NULL) {
+            serviceTracker_close(act->tracker);
+        }
+    }
 
 	return status;
 }
@@ -93,6 +93,9 @@ celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context)
 celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
 	shell_tui_activator_pt activator = (shell_tui_activator_pt) userData;
 
+    if (activator->tracker != NULL) {
+        serviceTracker_destroy(activator->tracker);
+    }
 	free(activator);
 
 	return CELIX_SUCCESS;

http://git-wip-us.apache.org/repos/asf/celix/blob/91ba2a16/shell_tui/private/src/shell_tui.c
----------------------------------------------------------------------
diff --git a/shell_tui/private/src/shell_tui.c b/shell_tui/private/src/shell_tui.c
index 08bc3f8..fbff74e 100644
--- a/shell_tui/private/src/shell_tui.c
+++ b/shell_tui/private/src/shell_tui.c
@@ -34,6 +34,8 @@
 #include "shell.h"
 #include "shell_tui.h"
 #include "utils.h"
+#include <signal.h>
+#include <unistd.h>
 
 
 static void* shellTui_runnable(void *data) {
@@ -54,13 +56,13 @@ static void* shellTui_runnable(void *data) {
             needPrompt = false;
         }
         FD_ZERO(&rfds);
-        FD_SET(0, &rfds);
+        FD_SET(STDIN_FILENO, &rfds);
 
         tv.tv_sec = 1;
         tv.tv_usec = 0;
 
-        if (select(1, &rfds, NULL, NULL, &tv)) {
-            fgets(in, 256, stdin);
+        if (select(1, &rfds, NULL, NULL, &tv) > 0) {
+            fgets(in, sizeof(in)-1, stdin);
             needPrompt = true;
             memset(dline, 0, 256);
             strncpy(dline, in, 256);
@@ -70,52 +72,32 @@ static void* shellTui_runnable(void *data) {
                 continue;
             }
 
-            act->shell->executeCommand(act->shell->shell, line, stdout, stderr);
+            if (act->shell != NULL) {
+                act->shell->executeCommand(act->shell->shell, line, stdout, stderr);
+            } else {
+                fprintf(stderr, "Shell service not available\n");
+            }
         }
     }
 
     return NULL;
 }
 
-celix_status_t shellTui_initializeService(shell_tui_activator_pt activator) {
+celix_status_t shellTui_start(shell_tui_activator_pt activator) {
 
     celix_status_t status = CELIX_SUCCESS;
 
-    if (activator->shell != NULL) {
-        status = CELIX_ILLEGAL_ARGUMENT;
-    } else {
-        status = bundleContext_getServiceReference(activator->context, (char *) OSGI_SHELL_SERVICE_NAME, &activator->reference);
-
-        if (status != CELIX_SUCCESS || activator->reference != NULL) {
-            void *shell_svc = NULL;
-            bundleContext_getService(activator->context, activator->reference, &shell_svc);
-            activator->shell = (shell_service_pt) shell_svc;
-
-            celixThread_create(&activator->runnable, NULL, shellTui_runnable, activator);
-        }
-    }
+    activator->running = true;
+    celixThread_create(&activator->runnable, NULL, shellTui_runnable, activator);
 
     return status;
 }
 
-celix_status_t shellTui_serviceChanged(service_listener_pt listener, service_event_pt event) {
+celix_status_t shellTui_stop(shell_tui_activator_pt act) {
     celix_status_t status = CELIX_SUCCESS;
-
-    bool result = false;
-    shell_tui_activator_pt act = (shell_tui_activator_pt) listener->handle;
-    bool equals = false;
-
-    serviceReference_equals(act->reference, event->reference, &equals);
-
-    if ((event->type == OSGI_FRAMEWORK_SERVICE_EVENT_REGISTERED) && (act->reference == NULL)) {
-        status = shellTui_initializeService(act);
-    } else if ((event->type == OSGI_FRAMEWORK_SERVICE_EVENT_UNREGISTERING) && (equals)) {
-        bundleContext_ungetService(act->context, act->reference, &result);
-        bundleContext_ungetServiceReference(act->context,act->reference);
-        act->reference = NULL;
-        act->shell = NULL;
-
-    }
-
+    act->running = false;
+    celixThread_kill(act->runnable, SIGUSR1);
+    celixThread_join(act->runnable, NULL);
     return status;
 }
+


[23/50] celix git commit: CELIX-335: Fix for deploying bundles using absolute paths

Posted by pn...@apache.org.
CELIX-335: Fix for deploying bundles using absolute paths


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

Branch: refs/heads/release/celix-2.0.0
Commit: ea9a5a8dea580bf050073765559e6b2ec00c8bbf
Parents: 3a45281
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 21:30:30 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 21:30:30 2016 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/Packaging.cmake | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/ea9a5a8d/cmake/cmake_celix/Packaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Packaging.cmake b/cmake/cmake_celix/Packaging.cmake
index 0521261..3cb1b71 100644
--- a/cmake/cmake_celix/Packaging.cmake
+++ b/cmake/cmake_celix/Packaging.cmake
@@ -556,7 +556,7 @@ function(deploy_bundles_dir)
     foreach(BUNDLE IN ITEMS ${BD_BUNDLES})
         if (IS_ABSOLUTE ${BUNDLE} AND EXISTS ${BUNDLE})
             get_filename_component(BUNDLE_FILENAME ${BUNDLE} NAME) 
-            set(OUT "${DEPLOY_LOC}/${BD_DIR_NAME}/${BUNDLE_FILENAME}.zip")
+            set(OUT "${DEPLOY_LOC}/${BD_DIR_NAME}/${BUNDLE_FILENAME}")
             add_custom_command(OUTPUT ${OUT}
                 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUNDLE} ${OUT}
                 COMMENT "Copying bundle '${BUNDLE}' to '${DEPLOY_LOC}/${BD_DIR_NAME}'"
@@ -591,7 +591,7 @@ function(deploy_bundles)
            if(COPY)
                 if(IS_ABSOLUTE ${BUNDLE} AND EXISTS ${BUNDLE})
                     get_filename_component(BUNDLE_FILENAME ${BUNDLE} NAME) 
-                    list(APPEND BUNDLES ${BUNDLE_FILENAME})
+                    list(APPEND BUNDLES "bundles/${BUNDLE_FILENAME}")
                 else() #assuming target
                     list(APPEND BUNDLES "bundles/${BUNDLE}.zip")
                 endif()
@@ -604,7 +604,7 @@ function(deploy_bundles)
            endif()
    endforeach()
 
-   if(DEPLOY_COPY) 
+   if(COPY) 
        deploy_bundles_dir(${DEPLOY_NAME} DIR_NAME bundles BUNDLES ${ARGN})
    endif()
 


[27/50] celix git commit: CELIX-347: Remove several mem leaks in dependency manager.

Posted by pn...@apache.org.
CELIX-347: Remove several mem leaks in dependency manager.


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

Branch: refs/heads/release/celix-2.0.0
Commit: 88a7da2d88152c005af35b45e04eeecf68128ab6
Parents: 492c214
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 10 08:41:35 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 10 08:41:35 2016 +0100

----------------------------------------------------------------------
 .../private/src/dm_service_dependency.c           | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/88a7da2d/dependency_manager/private/src/dm_service_dependency.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_service_dependency.c b/dependency_manager/private/src/dm_service_dependency.c
index a92bfbf..11ea28b 100644
--- a/dependency_manager/private/src/dm_service_dependency.c
+++ b/dependency_manager/private/src/dm_service_dependency.c
@@ -163,7 +163,7 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency,
         }
 
         if (serviceVersionRange != NULL) {
-            version_range_pt versionRange;
+            version_range_pt versionRange = NULL;
 
             if (versionRange_parse(serviceVersionRange, &versionRange) == CELIX_SUCCESS) {
                 version_pt lowVersion = NULL;
@@ -172,7 +172,7 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency,
                 if ((versionRange_getHighVersion(versionRange, &highVersion) == CELIX_SUCCESS) && (highVersion != NULL)) {
                     bool isHighInclusive;
                     char* highOperator;
-                    char* highVersionStr;
+                    char* highVersionStr = NULL;
 
                     versionRange_isHighInclusive(versionRange, &isHighInclusive);
                     version_toString(highVersion, &highVersionStr);
@@ -183,12 +183,16 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency,
                     char serviceVersionFilter[len];
                     snprintf(serviceVersionFilter, len, "(%s%s%s)", CELIX_FRAMEWORK_SERVICE_VERSION, highOperator, highVersionStr);
                     arrayList_add(filterElements, strdup(serviceVersionFilter));
+
+                    if(highVersionStr!=NULL){
+                    	free(highVersionStr);
+                    }
                 }
 
                 if ((versionRange_getLowVersion(versionRange, &lowVersion) == CELIX_SUCCESS) && (lowVersion != NULL)) {
                     bool isLowInclusive;
                     char* lowOperator;
-                    char* lowVersionStr;
+                    char* lowVersionStr = NULL;
 
                     versionRange_isLowInclusive(versionRange, &isLowInclusive);
                     version_toString(lowVersion, &lowVersionStr);
@@ -199,8 +203,16 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency,
                     char serviceVersionFilter[len];
                     snprintf(serviceVersionFilter, len, "(%s%s%s)", CELIX_FRAMEWORK_SERVICE_VERSION, lowOperator, lowVersionStr);
                     arrayList_add(filterElements, strdup(serviceVersionFilter));
+
+                    if(lowVersionStr!=NULL){
+                    	free(lowVersionStr);
+                    }
                 }
             }
+
+            if(versionRange!=NULL){
+            	versionRange_destroy(versionRange);
+            }
         }
 
         if (filter != NULL) {


[25/50] celix git commit: CELIX-346: fixed formatting issue, documentation

Posted by pn...@apache.org.
CELIX-346: fixed formatting issue, documentation


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

Branch: refs/heads/release/celix-2.0.0
Commit: 5c5f35ae0cd0781a99d34e3a3aae68da78eae72f
Parents: 6bf16bd
Author: Bjoern Petri <bp...@apache.org>
Authored: Tue Feb 9 11:59:09 2016 +0100
Committer: Bjoern Petri <bp...@apache.org>
Committed: Tue Feb 9 11:59:09 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/README.md                       |  2 +-
 .../bootstrap/templates/bundle/bundle.yaml      | 66 ++++++++++----------
 2 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/5c5f35ae/celix-bootstrap/README.md
----------------------------------------------------------------------
diff --git a/celix-bootstrap/README.md b/celix-bootstrap/README.md
index 32296c6..0bc5553 100644
--- a/celix-bootstrap/README.md
+++ b/celix-bootstrap/README.md
@@ -19,7 +19,7 @@ A (python based) code generation tool for [Apache Celix](https://celix.apache.or
 * Clone this repository
 * Create a celix-bootstrap alias:
 ```
-alias celix-bootstrap='PYTHONPATH=${cog_dir}:${celix-boostrap_dir} python -m celix-bootstrap'
+alias celix-bootstrap='PYTHONPATH=${cog_dir}:${celix-boostrap_dir} python -m celix.bootstrap'
 ```
 
 #Concept

http://git-wip-us.apache.org/repos/asf/celix/blob/5c5f35ae/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
index 1bf752e..5476d55 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle.yaml
@@ -25,44 +25,44 @@ components:
     #		componentName = checkInput('\nPlease enter componentName', '([a-zA-Z_][a-zA-Z0-9_]*)', 'example') 
     #		cog.outl('- name: \'%s\'' % componentName )
     #		cog.outl('  providedServices:')
-    #           while yn('Should component \'%s\' provide %s service?' % (componentName, 'a' if 'psInclude' not in vars() else 'another')):
-    #                   psServiceName1 = checkInput('(1) Please enter a name, which can be used for the filename and the include guards', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
-    #                   psServiceName2 = checkInput('(2) Please enter a name, which is used to register and lookup the service', '([a-zA-Z_][a-zA-Z0-9_]*)', (psServiceName1.lower() + ('_service' if not psServiceName1.endswith('_service') else ''))); 
-    #                   psServiceVersion = checkInput('(3) Please enter a version number', '(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)', '1.0.0.0'); 
-    #                   psServiceType = checkInput('(4) Please enter a type', '([a-zA-Z_][a-zA-Z0-9_]*)',  (psServiceName1.lower() + ('_service_t' if not psServiceName1.endswith('_service_t') else ''))  );
-    #                   psInclude = checkInput('(5) Please enter the name of the include file', '(.+?)(\.[^.]*$|$)', psServiceName1.lower() + '.h'); 
+    #		while yn('Should component \'%s\' provide %s service?' % (componentName, 'a' if 'psInclude' not in vars() else 'another')):
+    #			psServiceName1 = checkInput('(1) Please enter a name, which can be used for the filename and the include guards', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
+    #			psServiceName2 = checkInput('(2) Please enter a name, which is used to register and lookup the service', '([a-zA-Z_][a-zA-Z0-9_]*)', (psServiceName1.lower() + ('_service' if not psServiceName1.endswith('_service') else ''))); 
+    #			psServiceVersion = checkInput('(3) Please enter a version number', '(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)', '1.0.0.0'); 
+    #			psServiceType = checkInput('(4) Please enter a type', '([a-zA-Z_][a-zA-Z0-9_]*)',  (psServiceName1.lower() + ('_service_t' if not psServiceName1.endswith('_service_t') else ''))  );
+    #			psInclude = checkInput('(5) Please enter the name of the include file', '(.+?)(\.[^.]*$|$)', psServiceName1.lower() + '.h'); 
     #
-    #                   print("\n Summary:")    
-    #                   print("\tname :\t%s" % (psServiceName1))        
-    #                   print("\tservice_name:\t%s" % (psServiceName2)) 
-    #                   print("\tservice_version:\t%s" % (psServiceVersion))    
-    #                   print("\tservice_type:\t%s" % (psServiceType))  
-    #                   print("\tinclude file:\t%s" % (psInclude)) 
-    #                   if yn('Are those information correct?'):
-    #                           cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', service_version: \'%s\', type: \'%s\'}' % (psInclude, psServiceName1, psServiceName2, psServiceVersion, psServiceType))
-    #                   else:
-    #                           print("Service was not added.")
+    #			print("\n Summary:")	
+    #			print("\tname :\t%s" % (psServiceName1))	
+    #			print("\tservice_name:\t%s" % (psServiceName2))	
+    #			print("\tservice_version:\t%s" % (psServiceVersion))	
+    #			print("\tservice_type:\t%s" % (psServiceType))	
+    #			print("\tinclude file:\t%s" % (psInclude)) 
+    #			if yn('Are those information correct?'):
+    #				cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', service_version: \'%s\', type: \'%s\'}' % (psInclude, psServiceName1, psServiceName2, psServiceVersion, psServiceType))
+    #			else:
+    #				print("Service was not added.")
     #
     #		cog.outl('  serviceDependencies:')
     #		while yn('Should component \'%s\' depend on %s service?' % (componentName, 'a' if 'sdInclude' not in vars() else 'another')):
-    #                   sdInclude = checkInclude('(1) Please enter the include filename, which describes the service', '(.+?)(\.[^.]*$|$)'); 
-    #                   sdServiceName1 = checkInput('(2) Please enter a name, which is used to generate the code', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
-    #                   sdServiceName2 = checkIncludeContent('(3) Please enter the variable/constants, which is used to register the service within the framework', sdInclude); 
-    #                   sdServiceRange = checkIncludeContent('(4) Please enter the variable/constants, which contains the version range', sdInclude); 
-    #                   sdServiceType = checkIncludeContent('(5) Please enter the type of the service', sdInclude);
-    #                   sdCardinality = checkInput('(6) Please enter the cardinality (one|many|optional)', '(one)|(many)|(optional)');
+    #			sdInclude = checkInclude('(1) Please enter the include filename, which describes the service', '(.+?)(\.[^.]*$|$)'); 
+    #			sdServiceName1 = checkInput('(2) Please enter a name, which is used to generate the code', '([a-zA-Z_][a-zA-Z0-9_]*)'); 
+    #			sdServiceName2 = checkIncludeContent('(3) Please enter the variable/constants, which is used to register the service within the framework', sdInclude); 
+    #			sdServiceRange = checkIncludeContent('(4) Please enter the variable/constants, which contains the version range', sdInclude); 
+    #			sdServiceType = checkIncludeContent('(5) Please enter the type of the service', sdInclude);
+    #			sdCardinality = checkInput('(6) Please enter the cardinality (one|many|optional)', '(one)|(many)|(optional)');
     #
-    #                   print("\n Summary:")    
-    #                   print("\tname :\t%s" % (sdServiceName1))        
-    #                   print("\tservice_name:\t%s" % (sdServiceName2)) 
-    #                   print("\tservice_range:\t%s" % (sdServiceRange))        
-    #                   print("\tservice_type:\t%s" % (sdServiceType))  
-    #                   print("\tcardinality:\t%s" % (sdCardinality)) 
-    #                   print("\tinclude file:\t%s" % (sdInclude)) 
-    #                   if yn('Are those information correct?'):
-    #                           cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', service_versionrange: \'%s\', type: \'%s\', cardinality: \'%s\'}' % (sdInclude, sdServiceName1, sdServiceName2, sdServiceRange, sdServiceType, sdCardinality))
-    #                   else:
-    #                           print("Service dependency was not added.")
+    #			print("\n Summary:")	
+    #			print("\tname :\t%s" % (sdServiceName1))	
+    #			print("\tservice_name:\t%s" % (sdServiceName2))	
+    #			print("\tservice_range:\t%s" % (sdServiceRange))	
+    #			print("\tservice_type:\t%s" % (sdServiceType))	
+    #			print("\tcardinality:\t%s" % (sdCardinality)) 
+    #			print("\tinclude file:\t%s" % (sdInclude)) 
+    #			if yn('Are those information correct?'):
+    #				cog.outl('      - {include: \'%s\', name: \'%s\', service_name: \'%s\', service_versionrange: \'%s\', type: \'%s\', cardinality: \'%s\'}' % (sdInclude, sdServiceName1, sdServiceName2, sdServiceRange, sdServiceType, sdCardinality))
+    #			else:
+    #				print("Service dependency was not added.")
     #}}
     #{{end}}
 


[19/50] celix git commit: CELIX-335: Fix run.sh generated. Generation now also works for celix based projects.

Posted by pn...@apache.org.
CELIX-335: Fix run.sh generated. Generation now also works for celix based projects.


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

Branch: refs/heads/release/celix-2.0.0
Commit: da797a080e393388bc48f8b52744e55a75d4ab85
Parents: b2b8505
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 11:16:56 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 11:16:56 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/da797a08/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
index c5d280f..1c80a04 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
@@ -34,7 +34,7 @@ add_bundle(
 #cog.outl("\tNAME \"%s\"" % bundle['name'])
 #cog.outl("\tSYMBOLIC_NAME \"%s\"" % bundle['symbolicName']) 
 #cog.outl("\tVERSION \"0.0.1\"")
-#cog.outl("\t%s SOURCES" % bundle['name']) 
+#cog.outl("\t%s SOURCES") 
 #cog.outl("\t\tprivate/src/bundle_activator")
 #for comp in bundle['components'] :
 #	cog.outl("\t\tprivate/src/%s" % comp['name'])


[11/50] celix git commit: CELIX-335: Remove out commented deploy-targets() CMake command

Posted by pn...@apache.org.
CELIX-335: Remove out commented deploy-targets() CMake command


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

Branch: refs/heads/release/celix-2.0.0
Commit: ef2d16fc02640350c1682e061f86fa50f1f87fab
Parents: 1d00b44
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Feb 4 15:23:59 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Feb 4 15:23:59 2016 +0100

----------------------------------------------------------------------
 CMakeLists.txt | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/ef2d16fc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3da3ef9..5b95566 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,5 +89,3 @@ add_subdirectory(launcher)
 add_subdirectory(framework)
 add_subdirectory(utils)
 add_subdirectory(dfi)
-
-#deploy_targets()


[30/50] celix git commit: CELIX-345: Fixes typo in dependency manager.

Posted by pn...@apache.org.
CELIX-345: Fixes typo in dependency manager.


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

Branch: refs/heads/release/celix-2.0.0
Commit: 2933fcd3f82f9e4468c44a99b91b738176fcd74f
Parents: 9012020
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Wed Feb 10 08:48:46 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Wed Feb 10 08:48:46 2016 +0100

----------------------------------------------------------------------
 dependency_manager/private/src/dm_activator_base.c          | 2 +-
 dependency_manager/private/src/dm_dependency_manager_impl.c | 2 +-
 dependency_manager/public/include/dm_dependency_manager.h   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/2933fcd3/dependency_manager/private/src/dm_activator_base.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_activator_base.c b/dependency_manager/private/src/dm_activator_base.c
index c636364..a7e6500 100644
--- a/dependency_manager/private/src/dm_activator_base.c
+++ b/dependency_manager/private/src/dm_activator_base.c
@@ -103,7 +103,7 @@ celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context _
 
     // Remove the service
     status = serviceRegistration_unregister(dependency_activator->reg);
-    depedencyManager_removeAllComponents(dependency_activator->manager);
+    dependencyManager_removeAllComponents(dependency_activator->manager);
 
     return status;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/2933fcd3/dependency_manager/private/src/dm_dependency_manager_impl.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_dependency_manager_impl.c b/dependency_manager/private/src/dm_dependency_manager_impl.c
index 24245b7..3e67f8c 100644
--- a/dependency_manager/private/src/dm_dependency_manager_impl.c
+++ b/dependency_manager/private/src/dm_dependency_manager_impl.c
@@ -66,7 +66,7 @@ celix_status_t dependencyManager_add(dm_dependency_manager_pt manager, dm_compon
 	return status;
 }
 
-celix_status_t depedencyManager_removeAllComponents(dm_dependency_manager_pt manager) {
+celix_status_t dependencyManager_removeAllComponents(dm_dependency_manager_pt manager) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	unsigned int i=0;

http://git-wip-us.apache.org/repos/asf/celix/blob/2933fcd3/dependency_manager/public/include/dm_dependency_manager.h
----------------------------------------------------------------------
diff --git a/dependency_manager/public/include/dm_dependency_manager.h b/dependency_manager/public/include/dm_dependency_manager.h
index 22b0ad6..2eceeb9 100644
--- a/dependency_manager/public/include/dm_dependency_manager.h
+++ b/dependency_manager/public/include/dm_dependency_manager.h
@@ -40,7 +40,7 @@ void dependencyManager_destroy(dm_dependency_manager_pt manager);
 
 celix_status_t dependencyManager_add(dm_dependency_manager_pt manager, dm_component_pt component);
 
-celix_status_t depedencyManager_removeAllComponents(dm_dependency_manager_pt manager);
+celix_status_t dependencyManager_removeAllComponents(dm_dependency_manager_pt manager);
 
 /**
  * returns a dm_ of dm_dependency_manager_info. Caller has ownership.


[14/50] celix git commit: CELIX-343: Update config_admin examples to print updated properties.

Posted by pn...@apache.org.
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/release/celix-2.0.0
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;
 }


[16/50] celix git commit: CELIX-335: Fix bundle command in PackagegingLegacy. Update celix-bootstrap for updated CMake commands

Posted by pn...@apache.org.
CELIX-335: Fix bundle command in PackagegingLegacy. Update celix-bootstrap for updated CMake commands


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

Branch: refs/heads/release/celix-2.0.0
Commit: 1eb9eb01f1db3b78d3f0d6840fddfc660ce1cf6f
Parents: 9934f75
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 10:13:21 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 10:13:21 2016 +0100

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 celix-bootstrap/celix/bootstrap/generators.py   | 10 -----
 .../bootstrap/templates/bundle/CMakeLists.txt   | 46 ++++++++++----------
 .../bootstrap/templates/bundle/deploy.cmake     | 14 ------
 cmake/cmake_celix/PackagingLegacy.cmake         | 18 ++++++--
 config_admin/CMakeLists.txt                     | 11 ++++-
 config_admin/example/CMakeLists.txt             |  4 +-
 7 files changed, 51 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 6c1ab95..50221c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ build
 *.swp
 .idea
 nbproject
+*.pyc

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/celix-bootstrap/celix/bootstrap/generators.py
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/generators.py b/celix-bootstrap/celix/bootstrap/generators.py
index e9d469b..4c6769e 100644
--- a/celix-bootstrap/celix/bootstrap/generators.py
+++ b/celix-bootstrap/celix/bootstrap/generators.py
@@ -97,10 +97,6 @@ class Bundle(BaseGenerator):
 		options = ["-D", "bundleFile=%s" % self.descriptor]
 		self.update_file("CMakeLists.txt", "CMakeLists.txt", options, "#")	
 		
-	def update_deploy_file(self) :
-		options = ["-D", "bundleFile=%s" % self.descriptor]
-		self.update_file("deploy.cmake", "deploy.cmake", options, "#")	
-
 	def update_activator(self) :
 		options = ["-D", "bundleFile=%s" % self.descriptor]
 		self.update_file("bundle_activator.c", "private/src/bundle_activator.c", options)
@@ -129,7 +125,6 @@ class Bundle(BaseGenerator):
 			print("%s does not exist or does not contain a bundle.yaml file" % self.gendir)
 		else :
 			self.update_cmakelists()	
-			self.update_deploy_file()
 			self.update_activator()
 			if 'components' in bd and bd['components'] is not None:
 				for comp in bd['components'] :
@@ -149,10 +144,6 @@ class Project(BaseGenerator):
                 options = ["-D", "projectFile=%s" % self.descriptor]
                 self.update_file("CMakeLists.txt", "CMakeLists.txt", options, "#")      
 
-        def update_deploy_file(self) :
-                options = ["-D", "projectFile=%s" % self.descriptor]
-                self.update_file("deploy.cmake", "deploy.cmake", options, "#")  
-
         def create(self) :
                 self.update_file(os.path.join(self.template_dir, self.profile, "%s.yaml" % self.profile),  "%s.yaml" % self.profile, [], None)  
 
@@ -162,4 +153,3 @@ class Project(BaseGenerator):
                         print("%s does not exist or does not contain a project.yaml file" % self.gendir)
                 else :
                         self.update_cmakelists()        
-                        self.update_deploy_file()

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
index 5e1cdd8..d96c422 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
@@ -14,27 +14,6 @@
 #}}
 #{{end}}
 
-
-SET(
-	BUNDLE_NAME 
-#{{ 
-#cog.outl("\t\"%s\"" % bundle['name']) 
-#}}
-"mybundle" #do not edit, generated code
-#{{end}}
-)
-
-SET(
-	BUNDLE_SYMBOLICNAME 
-#{{ 
-#cog.outl("\t\"%s\"" % bundle['symbolicName']) 
-#}}
-"org.example.mybundle" #do not edit, generated code
-#{{end}}
-)
-
-SET(BUNDLE_VERSION "0.0.1")
-
 include_directories(
         ${CELIX_INCLUDE_DIR}/dependency_manager
         "private/include"
@@ -49,8 +28,11 @@ include_directories(
 
 )
 
-bundle(
+add_bundle(
 #{{ 
+#cog.outl("\tNAME \"%s\"" % bundle['name'])
+#cog.outl("\tSYMBOLIC_NAME \"%s\"" % bundle['symbolicName']) 
+#cog.outl("\tVERSION \"0.0.1\"")
 #cog.outl("\t%s SOURCES" % bundle['name']) 
 #cog.outl("\t\tprivate/src/bundle_activator")
 #for comp in bundle['components'] :
@@ -74,3 +56,23 @@ target_link_libraries(${BUNDLE_LIB} ${CELIX_FRAMEWORK_LIBRARY} -Wl,-all_load dep
 else()
 target_link_libraries(${BUNDLE_LIB} -Wl,--whole-archive dependency_manager -Wl,--no-whole-archive ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
 ENDIF()
+
+#{{
+#cog.outl("add_deploy(%s_deploy" % bundle['name'])
+#cog.outl("\tCOPY")
+#cog.outl("\tNAME \"%s\"" % bundle['name'])
+#cog.outl("\tBUNDLES")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/shell.zip")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/dm_shell.zip")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/shell_tui.zip")
+#cog.outl("\t\t${CELIX_BUNDLES_DIR}/log_service.zip")
+#cog.outl("\t\t%s" % bundle['name'])
+#cog.outl(")")
+#}}
+add_deploy(mybundle_deploy
+    COPY
+    NAME "mybundle"
+    BUNDLES 
+        mybundle
+)
+#{{end}}

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake b/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
deleted file mode 100644
index 2f80596..0000000
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/deploy.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-#{{
-#import yaml
-#bundle = None 
-#with open(bundleFile) as input :
-#       bundle = yaml.load(input)
-#cog.outl("deploy( \"%s\" BUNDLES" % bundle['name'])
-#cog.outl("\t${CELIX_BUNDLES_DIR}/shell.zip")
-#cog.outl("\t${CELIX_BUNDLES_DIR}/dm_shell.zip")
-#cog.outl("\t${CELIX_BUNDLES_DIR}/shell_tui.zip")
-#cog.outl("\t${CELIX_BUNDLES_DIR}/log_service.zip")
-#cog.outl("\t%s" % bundle['name'])
-#cog.outl(")")
-#}}
-#{{end}}

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/cmake/cmake_celix/PackagingLegacy.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/PackagingLegacy.cmake b/cmake/cmake_celix/PackagingLegacy.cmake
index 58667cd..0802552 100644
--- a/cmake/cmake_celix/PackagingLegacy.cmake
+++ b/cmake/cmake_celix/PackagingLegacy.cmake
@@ -27,7 +27,7 @@ macro(SET_HEADERS HEADERS)
     endif()
 endmacro()
 
-function(bundles)
+function(bundle)
     list(GET ARGN 0 BUNDLE)
     list(REMOVE_AT ARGN 0)
 
@@ -45,27 +45,36 @@ function(bundles)
 
     if(BUNDLE_FILES)
         bundle_files(${BUNDLE} ${BUNDLE_FILES} DESTINATION .)
+    endif()
+
     if(BUNDLE_EXPORT_VERSION) 
         message(WARNING "EXPORT_VERSION argument not supported")
     endif()
+
     if(BUNDLE_LINK_LIBRARIES) 
         target_link_libraries(${BUNDLE} ${BUNDLE_LINK_LIBRARIES})
     endif()
+
     if(BUNDLE_PRIVATE_LIBRARIES) 
         bundle_private_libs(${BUNDLE} ${BUNDLE_PRIVATE_LIBS})
     endif()
+
     if(BUNDLE_EXPORT_LIBRARIES)
         bundle_export_libs(${BUNDLE} ${BUNDLE_PRIVATE_LIBS})
     endif()
+
     if(BUNDLE_IMPORT_LIBRARIES)
         message(FATAL_ERROR "TODO IMPORT LIBRARIES")
     endif()
+
     if(BUNDLE_DIRECTORIES)
         message(WARNING "DIRECTORIES argument not supported")
     endif()
+
     if(BUNDLE_INSTALL_FILES)
         message(WARNING "INSTALL_FILES argument not supported")
     endif()
+
     if(BUNDLE_INSTALL)
         bundle_install(${BUNDLE})
     endif()
@@ -73,17 +82,20 @@ function(bundles)
     if(BUNDLE_NAME)
         bundle_name(${BUNDLE} ${BUNDLE_NAME})
     endif()
+
     if(BUNDLE_SYMBOLICNAME)
         bundle_symbolic_name(${BUNDLE} ${BUNDLE_SYMBOLICNAME})
     endif()
+
     if(BUNDLE_VERSION)
         bundle_version(${BUNDLE} ${BUNDLE_VERSION})
     endif()
+
     if (BUNDLE_HEADERS)
         bundle_headers(${BUNDLE} ${BUNDLE_HEADERS})
     endif()
 
-    message(STATUS "bundle function is deprecated. update to add_bundle")
+    message(STATUS "bundle function is deprecated. update target '${BUNDLE}' to add_bundle")
 endfunction()
 
 
@@ -104,5 +116,5 @@ function(deploy)
     if(DEPLOY_ENDPOINTS)
         deploy_bundles_dir(${DEPLOY} DIR_NAME "endpoints" BUNDLES ${DEPLOY_ENDPOINTS})
     endif()
-    message(STATUS "deploy function is deprecated. update to add_deploy")
+    message(STATUS "deploy function is deprecated. update target '${DEPLOY}' to add_deploy")
 endfunction()

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/config_admin/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/CMakeLists.txt b/config_admin/CMakeLists.txt
index de06600..8087662 100644
--- a/config_admin/CMakeLists.txt
+++ b/config_admin/CMakeLists.txt
@@ -45,7 +45,14 @@ if (CONFIG_ADMIN)
    endif(ENABLE_TESTING)
 	
 
-	add_deploy("config_admin1" BUNDLES config_admin shell shell_tui log_service log_writer example_test)
-	add_deploy("config_admin2" BUNDLES config_admin shell shell_tui log_service log_writer bundle_managed_service bundle_configuring)
+   add_deploy(config_admin_deploy 
+       NAME "config_admin"
+       BUNDLES 
+        config_admin 
+        shell shell_tui 
+        log_service 
+        log_writer 
+        config_admin_example
+   )
 
 endif (CONFIG_ADMIN)

http://git-wip-us.apache.org/repos/asf/celix/blob/1eb9eb01/config_admin/example/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/config_admin/example/CMakeLists.txt b/config_admin/example/CMakeLists.txt
index b19c73b..2d92d0a 100644
--- a/config_admin/example/CMakeLists.txt
+++ b/config_admin/example/CMakeLists.txt
@@ -2,12 +2,12 @@
 
 SET(
 	BUNDLE_NAME 
-"config_admin_example"
+    "config_admin_example"
 )
 
 SET(
 	BUNDLE_SYMBOLICNAME 
-"org.apache.celix.config_admin.example"
+    "org.apache.celix.config_admin.example"
 )
 
 SET(BUNDLE_VERSION "0.0.1")


[17/50] celix git commit: CELIX-335: Remove deploy_targets() from project CMakeLists.txt template. Not needed with rewrite Packaging.cmake

Posted by pn...@apache.org.
CELIX-335: Remove deploy_targets() from project CMakeLists.txt template. Not needed with rewrite Packaging.cmake


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

Branch: refs/heads/release/celix-2.0.0
Commit: a733db4d4347a41fcc6513dfe6b840247e2b7b36
Parents: 1eb9eb0
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 10:49:39 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 10:49:39 2016 +0100

----------------------------------------------------------------------
 celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/a733db4d/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
index 6991e4a..d5d6d81 100644
--- a/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/project/CMakeLists.txt
@@ -35,4 +35,3 @@ include_directories(${CELIX_INCLUDE_DIRS})
 #
 #{{end}}
 
-deploy_targets()


[15/50] celix git commit: Merge branch 'feature/CELIX-335_deploy_refactoring' into develop

Posted by pn...@apache.org.
Merge branch 'feature/CELIX-335_deploy_refactoring' into develop


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

Branch: refs/heads/release/celix-2.0.0
Commit: 9934f75275c7de4d50088b7f87256a1bd5ba3047
Parents: b815e68 ef2d16f
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Fri Feb 5 09:37:35 2016 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Fri Feb 5 09:37:35 2016 +0100

----------------------------------------------------------------------
 .travis.yml                                     |    5 +-
 CMakeLists.txt                                  |   10 +-
 cmake/CMakeCelix.cmake                          |    1 +
 cmake/UseDoxygen.cmake                          |    4 +-
 cmake/cmake_celix/CPackConfig-Installation.in   |   29 -
 cmake/cmake_celix/CPackConfig.in                |   25 -
 cmake/cmake_celix/CPackConfigPKG.in             |   25 -
 cmake/cmake_celix/Dependencies.cmake            |   37 +-
 cmake/cmake_celix/Manifest.template.in          |   10 +
 cmake/cmake_celix/NOTE                          |    4 +-
 cmake/cmake_celix/Packaging.cmake               | 1048 ++++++++++--------
 cmake/cmake_celix/PackagingLegacy.cmake         |  108 ++
 cmake/cmake_celix/RunConfig.in                  |   37 +-
 cmake/cmake_celix/config.properties.in          |    2 -
 cmake/cmake_celix/installation.cmake            |   30 -
 cmake/cmake_celix/manifest.in                   |    2 -
 cmake/cmake_celix/run.sh.in                     |    2 -
 config_admin/CMakeLists.txt                     |    3 +
 .../example_test/CMakeLists.txt                 |    7 +-
 .../example_test2/CMakeLists.txt                |    6 +-
 config_admin/deploy.cmake                       |   23 -
 config_admin/service/CMakeLists.txt             |    7 +-
 dependency_manager/CMakeLists.txt               |   40 +-
 .../private/src/dm_activator_base.c             |    9 +-
 .../public/include/dm_activator.h               |   40 +
 .../public/include/dm_activator_base.h          |   41 -
 deployment_admin/CMakeLists.txt                 |   60 +-
 deployment_admin/deploy.cmake                   |   24 -
 device_access/CMakeLists.txt                    |    2 +-
 device_access/deploy.cmake                      |   21 -
 device_access/device_access/CMakeLists.txt      |   32 +-
 device_access/driver_locator/CMakeLists.txt     |   14 +-
 device_access/example/CMakeLists.txt            |   11 +-
 .../example/base_driver/CMakeLists.txt          |   14 +-
 .../example/consuming_driver/CMakeLists.txt     |   14 +-
 .../example/refining_driver/CMakeLists.txt      |   14 +-
 dfi/CMakeLists.txt                              |    8 +-
 documents/building/readme.md                    |  104 ++
 documents/cmake_commands/readme.md              |  210 ++++
 .../getting_started/getting_started_img1.png    |  Bin 0 -> 46250 bytes
 .../getting_started/getting_started_img2.png    |  Bin 0 -> 55615 bytes
 .../getting_started/getting_started_img3.png    |  Bin 0 -> 127686 bytes
 documents/getting_started/readme.md             |  216 ++++
 documents/memory_pools.png                      |  Bin 74273 -> 0 bytes
 documents/subprojects/readme.md                 |   23 +
 event_admin/CMakeLists.txt                      |    6 +-
 event_admin/deploy.cmake                        |   23 -
 event_admin/event_admin/CMakeLists.txt          |   10 +-
 event_admin/event_handler/CMakeLists.txt        |    9 +-
 event_admin/event_publisher/CMakeLists.txt      |   10 +-
 examples/CMakeLists.txt                         |   14 +
 examples/deploy.cmake                           |   34 -
 examples/dm_example/CMakeLists.txt              |   15 +
 examples/dm_example/deploy.cmake                |   32 -
 examples/dm_example/phase1/CMakeLists.txt       |   26 +-
 .../phase1/private/src/phase1_activator.c       |    2 +-
 .../dm_example/phase1/private/src/phase1_cmp.c  |    2 +-
 examples/dm_example/phase2a/CMakeLists.txt      |   22 +-
 .../phase2a/private/src/phase2a_activator.c     |    2 +-
 examples/dm_example/phase2b/CMakeLists.txt      |   24 +-
 .../phase2b/private/src/phase2b_activator.c     |    2 +-
 .../phase2b/private/src/phase2b_cmp.c           |    2 +-
 examples/dm_example/phase3/CMakeLists.txt       |   24 +-
 .../phase3/private/src/phase3_activator.c       |    2 +-
 examples/echo_service/client/CMakeLists.txt     |   16 +-
 examples/echo_service/server/CMakeLists.txt     |   16 +-
 examples/embedding/CMakeLists.txt               |    8 -
 examples/hello_world/CMakeLists.txt             |   41 +-
 examples/hello_world_test/CMakeLists.txt        |   80 +-
 .../hello_world_test/private/src/activator.c    |    3 -
 examples/hello_world_test/private/src/test.c    |   32 +
 examples/hello_world_test/public/include/test.h |   34 +
 examples/locking/CMakeLists.txt                 |    8 +
 examples/locking/benchmark/CMakeLists.txt       |    9 +-
 examples/locking/deploy.cmake                   |   26 -
 examples/locking/math_provider/CMakeLists.txt   |   11 +-
 .../modified_bool_benchmark/CMakeLists.txt      |    5 +-
 examples/locking/mutex_benchmark/CMakeLists.txt |   11 +-
 .../locking/reference_benchmark/CMakeLists.txt  |    5 +-
 .../locking/start_stop_benchmark/CMakeLists.txt |    5 +-
 examples/mongoose/CMakeLists.txt                |   17 +-
 .../client/CMakeLists.txt                       |    5 +-
 .../greeting/CMakeLists.txt                     |    5 +-
 .../chapter04-correct-listener/CMakeLists.txt   |    3 +-
 .../chapter04-correct-lookup/CMakeLists.txt     |    5 +-
 .../chapter04-paint-example/CMakeLists.txt      |    2 +
 .../circle/CMakeLists.txt                       |    2 +-
 .../chapter04-paint-example/deploy.cmake        |   22 -
 .../paint/CMakeLists.txt                        |    2 +-
 .../square/CMakeLists.txt                       |    2 +-
 .../triangle/CMakeLists.txt                     |    2 +-
 .../producer_consumer/consumer/CMakeLists.txt   |    8 +-
 .../producer_consumer/database/CMakeLists.txt   |    8 +-
 .../producer_consumer/producer/CMakeLists.txt   |    8 +-
 examples/whiteboard/publisherA/CMakeLists.txt   |    4 +-
 examples/whiteboard/publisherB/CMakeLists.txt   |    5 +-
 examples/whiteboard/tracker/CMakeLists.txt      |    5 +-
 .../whiteboard/tracker_depman/CMakeLists.txt    |    9 +-
 .../private/src/dependency_activator.c          |    2 +-
 framework/CMakeLists.txt                        |   14 +-
 .../test_bundle1/CMakeLists.txt                 |    7 +-
 framework/private/src/framework.c               |   32 +-
 framework/private/src/manifest.c                |    3 +-
 framework/private/src/utils.c                   |   17 +
 framework/public/include/constants.h            |    2 -
 framework/public/include/utils.h                |    1 +
 log_service/CMakeLists.txt                      |   11 +-
 log_writer/log_writer_stdout/CMakeLists.txt     |   18 +-
 log_writer/log_writer_syslog/CMakeLists.txt     |   10 +-
 .../discovery_configured/CMakeLists.txt         |    9 +-
 remote_services/discovery_etcd/CMakeLists.txt   |   11 +-
 remote_services/discovery_shm/CMakeLists.txt    |   10 +-
 remote_services/examples/CMakeLists.txt         |   69 ++
 .../examples/calculator_endpoint/CMakeLists.txt |    7 +-
 .../calculator_endpoint2/CMakeLists.txt         |    7 +-
 .../examples/calculator_proxy/CMakeLists.txt    |    7 +-
 .../examples/calculator_proxy2/CMakeLists.txt   |    7 +-
 .../examples/calculator_service/CMakeLists.txt  |   12 +-
 .../examples/calculator_shell/CMakeLists.txt    |   17 +-
 remote_services/examples/deploy.cmake           |   65 --
 .../remote_service_admin/CMakeLists.txt         |    5 -
 .../remote_service_admin_dfi/rsa/CMakeLists.txt |   10 +-
 .../rsa_tst/CMakeLists.txt                      |   20 +-
 .../rsa_tst/bundle/CMakeLists.txt               |   16 +-
 .../remote_service_admin_http/CMakeLists.txt    |   10 +-
 .../private/test/CMakeLists.txt                 |   20 +-
 .../remote_service_admin_shm/CMakeLists.txt     |    9 +-
 .../private/test/CMakeLists.txt                 |   26 +-
 .../private/test/client.properties.in           |    2 +-
 remote_services/topology_manager/CMakeLists.txt |   10 +-
 .../topology_manager/tms_tst/CMakeLists.txt     |   28 +-
 .../tms_tst/bundle/CMakeLists.txt               |   14 +-
 .../tms_tst/disc_mock/CMakeLists.txt            |    7 +-
 remote_shell/CMakeLists.txt                     |   28 +-
 remote_shell/deploy.cmake                       |   20 -
 scr/scr/CMakeLists.txt                          |    2 +-
 scr/test/CMakeLists.txt                         |    2 +-
 shell/CMakeLists.txt                            |   37 +-
 shell_bonjour/CMakeLists.txt                    |    7 +-
 shell_bonjour/deploy.cmake                      |   25 -
 shell_tui/CMakeLists.txt                        |   11 +-
 utils/CMakeLists.txt                            |    2 +
 142 files changed, 2110 insertions(+), 1546 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/9934f752/config_admin/CMakeLists.txt
----------------------------------------------------------------------