celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [01/50] [abbrv] celix git commit: CELIX-370: Adds -fno-rtti and -fno-exception to the C++ dep man + examples. Adds (using ifdef) no exception no rtti support.
Date Tue, 18 Oct 2016 19:26:03 GMT
Repository: celix
Updated Branches:
  refs/heads/release/celix-2.0.0 3a3795429 -> 2a958a310


CELIX-370: Adds -fno-rtti and -fno-exception to the C++ dep man + examples. Adds (using ifdef)
no exception no rtti support.

Small updates:
- Documents that C++11 is required
- Updates dm command, now also prints provided properties for the dm component services
- Adds adding properties/filter for service.lang to C dep man.
- Adds CELIX_FRAMEWORK_SERVICE_LANGUAGE to constants.h (also value for C and C++)
- For some services (shell, log_services) add properties 'service.lang=C'.


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

Branch: refs/heads/release/celix-2.0.0
Commit: b5e05854062fedef8e44ab8cda47974e0bb281d0
Parents: 5f3a825
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Thu Aug 4 17:18:46 2016 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Thu Aug 4 17:22:08 2016 +0200

----------------------------------------------------------------------
 README.md                                       |  2 +-
 .../include/dm_service_dependency_impl.h        |  1 +
 .../private/src/dm_component_impl.c             | 62 ++++++++++-----
 .../private/src/dm_service_dependency.c         | 23 ++++++
 .../private/src/dm_shell_activator.c            |  2 +
 .../private/src/dm_shell_list_command.c         | 11 ++-
 .../public/include/dm_component.h               |  8 ++
 dependency_manager/public/include/dm_info.h     | 19 +++--
 .../public/include/dm_service_dependency.h      |  7 ++
 dependency_manager_cxx/CMakeLists.txt           |  2 +-
 .../include/celix/dm/Component_Impl.h           | 19 +++--
 .../include/celix/dm/DependencyManager.h        | 12 +++
 .../include/celix/dm/ServiceDependency.h        | 27 ++++++-
 .../include/celix/dm/ServiceDependency_Impl.h   | 84 +++++++++++++++-----
 dependency_manager_cxx/include/celix/dm/types.h | 36 ++++++++-
 dependency_manager_cxx/readme.md                |  3 +-
 .../src/dm_activator_base_cxx.cc                | 17 +++-
 examples/dm_example_cxx/CMakeLists.txt          |  2 +-
 .../dm_example_cxx/phase2a/src/Phase2aCmp.cc    |  4 +-
 .../dm_example_cxx/phase2b/src/Phase2bCmp.cc    |  4 +-
 framework/private/src/filter.c                  |  4 +-
 framework/public/include/constants.h            |  4 +
 log_service/private/src/log_service_activator.c | 12 ++-
 shell/private/src/activator.c                   |  6 +-
 24 files changed, 300 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index fe7910e..a2bfe43 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 #Apache Celix [![Build Status](https://travis-ci.org/apache/celix.svg?branch=develop)](https://travis-ci.org/apache/celix)
[![Coverage Status](https://coveralls.io/repos/apache/celix/badge.svg?branch=develop&service=github)](https://coveralls.io/github/apache/celix?branch=develop)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/6685/badge.svg)](https://scan.coverity.com/projects/6685)
-Apache Celix is an implementation of the OSGi specification] adapted to C and C++. It is
a provides a framework to develop (dynamic) modular software applications using component
and/or service-oriented programming.
+Apache Celix is an implementation of the OSGi specification] adapted to C and C++ (C++11).
It is a provides a framework to develop (dynamic) modular software applications using component
and/or service-oriented programming.
 
 ##Building
 For information how to build Apache Celix see [Building Apache Celix](documents/building/readme.md)

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager/private/include/dm_service_dependency_impl.h
----------------------------------------------------------------------
diff --git a/dependency_manager/private/include/dm_service_dependency_impl.h b/dependency_manager/private/include/dm_service_dependency_impl.h
index c565b2f..7026ebf 100644
--- a/dependency_manager/private/include/dm_service_dependency_impl.h
+++ b/dependency_manager/private/include/dm_service_dependency_impl.h
@@ -65,6 +65,7 @@ struct dm_service_dependency {
 
 	bool isStarted;
 
+	bool addCLanguageFilter;
 	char *tracked_service;
 	char *tracked_filter_unmodified;
 	char *tracked_filter;

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/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 d556c35..211a655 100644
--- a/dependency_manager/private/src/dm_component_impl.c
+++ b/dependency_manager/private/src/dm_component_impl.c
@@ -55,6 +55,8 @@ struct dm_component_struct {
     bool isStarted;
     bool active;
 
+    bool setCLanguageProperty;
+
     hash_map_pt dependencyEvents; //protected by mutex
 
     dm_executor_pt executor;
@@ -155,6 +157,8 @@ celix_status_t component_create(bundle_context_pt context, const char
*name, dm_
         component->isStarted = false;
         component->active = false;
 
+        component->setCLanguageProperty = true;
+
         component->dependencyEvents = hashMap_create(NULL, NULL, NULL, NULL);
 
         component->executor = NULL;
@@ -326,6 +330,11 @@ celix_status_t component_stopTask(dm_component_pt component, void *data
__attrib
     return status;
 }
 
+celix_status_t setCLanguageProperty(dm_component_pt component, bool setCLangProp) {
+    component->setCLanguageProperty = setCLangProp;
+    return CELIX_SUCCESS;
+}
+
 celix_status_t component_addInterface(dm_component_pt component, const char* serviceName,
const char* serviceVersion, const void* service, properties_pt properties) {
     celix_status_t status = CELIX_SUCCESS;
 
@@ -343,6 +352,10 @@ celix_status_t component_addInterface(dm_component_pt component, const
char* ser
             properties_set(properties, CELIX_FRAMEWORK_SERVICE_VERSION, serviceVersion);
         }
 
+        if (component->setCLanguageProperty && properties_get(properties, CELIX_FRAMEWORK_SERVICE_LANGUAGE)
== NULL) { //always set default lang to C
+            properties_set(properties, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
+        }
+
         if (interface && name) {
             interface->serviceName = name;
             interface->service = service;
@@ -367,8 +380,11 @@ celix_status_t component_getInterfaces(dm_component_pt component, array_list_pt
     int size = arrayList_size(component->dm_interfaces);
     int i;
     for (i = 0; i < size; i += 1) {
+        dm_interface_info_pt info = calloc(1, sizeof(*info));
         dm_interface_t *interface = arrayList_get(component->dm_interfaces, i);
-        arrayList_add(names, strdup(interface->serviceName));
+        info->name = strdup(interface->serviceName);
+        properties_copy(interface->properties, &info->properties);
+        arrayList_add(names, info);
     }
     celixThreadMutex_unlock(&component->mutex);
 
@@ -1343,8 +1359,8 @@ celix_status_t component_getComponentInfo(dm_component_pt component,
dm_componen
     dm_component_info_pt info = NULL;
     info = calloc(1, sizeof(*info));
 
-    if(info==NULL){
-	return CELIX_ENOMEM;
+    if (info == NULL) {
+        return CELIX_ENOMEM;
     }
 
     arrayList_create(&info->dependency_list);
@@ -1354,29 +1370,29 @@ celix_status_t component_getComponentInfo(dm_component_pt component,
dm_componen
     memcpy(info->name, component->name, DM_COMPONENT_MAX_NAME_LENGTH);
 
     switch (component->state) {
-    case DM_CMP_STATE_INACTIVE :
-	info->state = strdup("INACTIVE");
-	break;
-    case DM_CMP_STATE_WAITING_FOR_REQUIRED :
-	info->state = strdup("WAITING_FOR_REQUIRED");
-	break;
-    case DM_CMP_STATE_INSTANTIATED_AND_WAITING_FOR_REQUIRED :
-	info->state = strdup("INSTANTIATED_AND_WAITING_FOR_REQUIRED");
-	break;
-    case DM_CMP_STATE_TRACKING_OPTIONAL :
-	info->state = strdup("TRACKING_OPTIONAL");
-	info->active = true;
-	break;
-    default :
-	info->state = strdup("UNKNOWN");
-	break;
+        case DM_CMP_STATE_INACTIVE :
+            info->state = strdup("INACTIVE");
+            break;
+        case DM_CMP_STATE_WAITING_FOR_REQUIRED :
+            info->state = strdup("WAITING_FOR_REQUIRED");
+            break;
+        case DM_CMP_STATE_INSTANTIATED_AND_WAITING_FOR_REQUIRED :
+            info->state = strdup("INSTANTIATED_AND_WAITING_FOR_REQUIRED");
+            break;
+        case DM_CMP_STATE_TRACKING_OPTIONAL :
+            info->state = strdup("TRACKING_OPTIONAL");
+            info->active = true;
+            break;
+        default :
+            info->state = strdup("UNKNOWN");
+            break;
     }
 
     celixThreadMutex_lock(&component->mutex);
     size = arrayList_size(component->dependencies);
     for (i = 0; i < size; i += 1) {
         dm_service_dependency_pt dep = arrayList_get(component->dependencies, i);
-        dm_service_dependency_info_pt depInfo= NULL;
+        dm_service_dependency_info_pt depInfo = NULL;
         status = serviceDependency_getServiceDependencyInfo(dep, &depInfo);
         if (status == CELIX_SUCCESS) {
             arrayList_add(info->dependency_list, depInfo);
@@ -1404,8 +1420,10 @@ void component_destroyComponentInfo(dm_component_info_pt info) {
         if (info->interfaces != NULL) {
             size = arrayList_size(info->interfaces);
             for (i = 0; i < size; i += 1) {
-                char *intf = arrayList_get(info->interfaces, i);
-                free(intf);
+                dm_interface_info_pt intfInfo = arrayList_get(info->interfaces, i);
+                free(intfInfo->name);
+                properties_destroy(intfInfo->properties);
+                free(intfInfo);
             }
             arrayList_destroy(info->interfaces);
         }

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/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 0121c5c..7b4b45e 100644
--- a/dependency_manager/private/src/dm_service_dependency.c
+++ b/dependency_manager/private/src/dm_service_dependency.c
@@ -72,6 +72,7 @@ celix_status_t serviceDependency_create(dm_service_dependency_pt *dependency_ptr
 
 		(*dependency_ptr)->isStarted = false;
 
+        (*dependency_ptr)->addCLanguageFilter = true;
 		(*dependency_ptr)->tracked_service = NULL;
 		(*dependency_ptr)->tracked_filter_unmodified = NULL;
 		(*dependency_ptr)->tracked_filter = NULL;
@@ -125,6 +126,11 @@ celix_status_t serviceDependency_setRequired(dm_service_dependency_pt
dependency
 	return status;
 }
 
+celix_status_t serviceDependency_setAddCLanguageFilter(dm_service_dependency_pt dependency,
bool addCLangFilter) {
+    dependency->addCLanguageFilter = addCLangFilter;
+    return CELIX_SUCCESS;
+}
+
 celix_status_t serviceDependency_setStrategy(dm_service_dependency_pt dependency, dm_service_dependency_strategy_t
strategy) {
 	celix_status_t status = CELIX_SUCCESS;
 
@@ -220,6 +226,23 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt
dependency,
 			arrayList_add(filterElements, strdup(filter));
 		}
 
+
+
+        bool needLangFilter = true;
+		if (filter != NULL) {
+            char needle[128];
+            snprintf(needle, sizeof(needle), "(%s=", CELIX_FRAMEWORK_SERVICE_LANGUAGE);
+            if (strstr(filter, needle) != NULL) {
+                needLangFilter = false;
+            }
+        }
+
+        if (needLangFilter && dependency->addCLanguageFilter) {
+			char langFilter[128];
+			snprintf(langFilter, sizeof(langFilter), "(%s=%s)", CELIX_FRAMEWORK_SERVICE_LANGUAGE,
CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
+            arrayList_add(filterElements, strdup(langFilter));
+		}
+
 		if (arrayList_size(filterElements) > 0) {
 			array_list_iterator_pt filterElementsIter = arrayListIterator_create(filterElements);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager/private/src/dm_shell_activator.c
----------------------------------------------------------------------
diff --git a/dependency_manager/private/src/dm_shell_activator.c b/dependency_manager/private/src/dm_shell_activator.c
index 89234c7..43b8e3e 100644
--- a/dependency_manager/private/src/dm_shell_activator.c
+++ b/dependency_manager/private/src/dm_shell_activator.c
@@ -24,6 +24,7 @@
  *  \copyright  Apache License, Version 2.0
  */
 
+#include <constants.h>
 #include "bundle_context.h"
 #include "service_registration.h"
 #include "command.h"
@@ -64,6 +65,7 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt
context)
         commandService->executeCommand = (void *)dmListCommand_execute;
 
         properties_pt props = properties_create();
+        properties_set(props, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
         properties_set(props, OSGI_SHELL_COMMAND_NAME, "dm");
         properties_set(props, OSGI_SHELL_COMMAND_USAGE, "dm");
         properties_set(props, OSGI_SHELL_COMMAND_DESCRIPTION,

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/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 be4eaf4..c6fe68c 100644
--- a/dependency_manager/private/src/dm_shell_list_command.c
+++ b/dependency_manager/private/src/dm_shell_list_command.c
@@ -77,9 +77,14 @@ void dmListCommand_execute(bundle_context_pt context, char * line, FILE
*out, FI
             int interfCnt;
             fprintf(out, "|- Interfaces (%d):\n", arrayList_size(compInfo->interfaces));
             for(interfCnt = 0 ;interfCnt < arrayList_size(compInfo->interfaces); interfCnt++)
{
-                char * interface;
-                interface = arrayList_get(compInfo->interfaces, interfCnt);
-                fprintf(out, "   |- Interface: %s\n", interface);
+                dm_interface_info_pt intfInfo= arrayList_get(compInfo->interfaces, interfCnt);
+                fprintf(out, "   |- Interface: %s\n", intfInfo->name);
+
+                hash_map_iterator_t iter = hashMapIterator_construct((hash_map_pt) intfInfo->properties);
+                char* key = NULL;
+                while((key = hashMapIterator_nextKey(&iter)) != NULL) {
+                    fprintf(out, "      | %15s = %s\n", key, properties_get(intfInfo->properties,
key));
+                }
             }
 
             int depCnt;

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/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 d4f09a8..54363dd 100644
--- a/dependency_manager/public/include/dm_component.h
+++ b/dependency_manager/public/include/dm_component.h
@@ -64,6 +64,14 @@ celix_status_t component_create(bundle_context_pt context, const char*
name, dm_
  */
 void component_destroy(dm_component_pt component);
 
+
+/**
+ * Specify if a default 'service.lang=C' should be added to the properties of interfaces
if no 'service.lang' has been
+ * provided. Default is true. Note that this should be set before using component_addInterface.
+ */
+celix_status_t setCLanguageProperty(dm_component_pt component, bool setCLangProp);
+
+
 /**
  * Adds a C interface to provide as service to the Celix framework.
  *

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager/public/include/dm_info.h
----------------------------------------------------------------------
diff --git a/dependency_manager/public/include/dm_info.h b/dependency_manager/public/include/dm_info.h
index b56ba91..7fbc434 100644
--- a/dependency_manager/public/include/dm_info.h
+++ b/dependency_manager/public/include/dm_info.h
@@ -37,27 +37,32 @@ extern "C" {
 #define DM_INFO_SERVICE_NAME "dm_info"
 
 
-typedef struct dm_service_dependency_info {
+typedef struct dm_interface_info_struct {
+    char* name;
+    properties_pt properties;
+} * dm_interface_info_pt;
+
+typedef struct dm_service_dependency_info_struct {
     char *filter;
     bool available;
     bool required;
     size_t count;
 } * dm_service_dependency_info_pt;
 
-typedef struct dm_component_info {
+typedef struct dm_component_info_struct {
     char id[64];
     char name[128];
     bool active;
     char * state;
-    array_list_pt interfaces;   // type char*
-    array_list_pt dependency_list;  // type interface_info_pt
+    array_list_pt interfaces;   // type dm_interface_info_pt
+    array_list_pt dependency_list;  // type dm_service_dependency_info_pt
 } * dm_component_info_pt;
 
-typedef struct dm_dependency_manager_info {
+typedef struct dm_dependency_manager_info_struct {
     array_list_pt  components;      // type dm_component_info
 } * dm_dependency_manager_info_pt;
 
-struct dm_info_service {
+struct dm_info_service_struct {
     void *handle;
 
     /*Note: dm_caller has the ownership of the result.*/
@@ -65,7 +70,7 @@ struct dm_info_service {
     void (*destroyInfo)(void *handle, dm_dependency_manager_info_pt info);
 };
 
-typedef struct dm_info_service dm_info_service_t;
+typedef struct dm_info_service_struct dm_info_service_t;
 typedef dm_info_service_t* dm_info_service_pt;
 
 #ifdef __cplusplus

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager/public/include/dm_service_dependency.h
----------------------------------------------------------------------
diff --git a/dependency_manager/public/include/dm_service_dependency.h b/dependency_manager/public/include/dm_service_dependency.h
index 3a9dc73..957f7be 100644
--- a/dependency_manager/public/include/dm_service_dependency.h
+++ b/dependency_manager/public/include/dm_service_dependency.h
@@ -73,6 +73,13 @@ celix_status_t serviceDependency_destroy(dm_service_dependency_pt *dependency_pt
 celix_status_t serviceDependency_setRequired(dm_service_dependency_pt dependency, bool required);
 
 /**
+ * Specify if the servide dependency should add a C language filter for this dependency if
no "service.lang" part if found the in the provided filter.
+ * Default is true
+ */
+celix_status_t serviceDependency_setAddCLanguageFilter(dm_service_dependency_pt dependency,
bool addCLangFilter);
+
+
+/**
  * Specify if the service dependency update strategy.
  *
  * The DM_SERVICE_DEPENDENCY_STRATEGY_LOCKING strategy notifies the component in case the
dependencies set

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/CMakeLists.txt b/dependency_manager_cxx/CMakeLists.txt
index 6a4e852..c2d8076 100644
--- a/dependency_manager_cxx/CMakeLists.txt
+++ b/dependency_manager_cxx/CMakeLists.txt
@@ -19,7 +19,7 @@ celix_subproject(DEPENDENCY_MANAGER_CXX "Option to build the C++ dependency
mana
 if (DEPENDENCY_MANAGER_CXX)
 
     #set -Wall, -Werror locally, currenctly cpputest contains warnings
-    set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
 
     # Add -fPIC for x86_64 Unix platforms; this lib will be linked to a shared lib
     if(UNIX AND NOT WIN32)

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/include/celix/dm/Component_Impl.h
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/include/celix/dm/Component_Impl.h b/dependency_manager_cxx/include/celix/dm/Component_Impl.h
index 5f53992..8f42131 100644
--- a/dependency_manager_cxx/include/celix/dm/Component_Impl.h
+++ b/dependency_manager_cxx/include/celix/dm/Component_Impl.h
@@ -42,14 +42,19 @@ Component<T>& Component<T>::addInterface(const std::string
version) {
 template<class T>
 template<class I>
 Component<T>& Component<T>::addInterface(const std::string version, const
Properties props) {
-    this->addInterface(typeName<I>(), version.c_str(), props);
+    std::string name = typeName<I>();
+    if (name.empty()) {
+        std::cerr << "Cannot add interface, because type name could not be inferred.
function: '" << __PRETTY_FUNCTION__ << "'\n";
+    } else {
+        this->addInterface(name, version.c_str(), props);
+    }
     return *this;
 }
 
 template<class T>
 Component<T>& Component<T>::addInterface(const std::string serviceName, const
std::string version, const Properties properties) {
     properties_pt cProperties = properties_create();
-    properties_set(cProperties, (char*)"lang", (char*)"c++");
+    properties_set(cProperties, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_CXX_LANGUAGE);
     for (auto iter = properties.begin(); iter != properties.end(); iter++) {
         properties_set(cProperties, (char*)iter->first.c_str(), (char*)iter->second.c_str());
     }
@@ -68,7 +73,7 @@ Component<T>& Component<T>::addCInterface(const void* svc,
const std::string ser
 template<class T>
 Component<T>& Component<T>::addCInterface(const void* svc, const std::string
serviceName, const std::string version, const Properties properties) {
     properties_pt cProperties = properties_create();
-    properties_set(cProperties, (char*)"lang", (char*)"c");
+    properties_set(cProperties, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
     for (auto iter = properties.begin(); iter != properties.end(); iter++) {
         properties_set(cProperties, (char*)iter->first.c_str(), (char*)iter->second.c_str());
     }
@@ -98,7 +103,6 @@ template<class T>
 template<typename I>
 Component<T>& Component<T>::add(CServiceDependency<T,I>& dep) {
     component_addServiceDependency(cComponent(), dep.cServiceDependency());
-
     dep.setComponentInstance(&getInstance());
     return *this;
 }
@@ -114,9 +118,14 @@ template<class T>
 T& Component<T>::getInstance() {
     if (this->refInstance.size() == 1) {
         return refInstance.front();
-    } else {
+    } else {  //TODO check if we can use move??
         if (this->instance.get() == nullptr) {
+#ifdef __EXCEPTIONS
             this->instance = std::shared_ptr<T> {new T()};
+#else
+            this->instance = std::shared_ptr<T> {new(std::nothrow) T()};
+#endif
+            //TODO check needed, how to handle nullptr ?
         }
         return *this->instance.get();
     }

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/include/celix/dm/DependencyManager.h
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/include/celix/dm/DependencyManager.h b/dependency_manager_cxx/include/celix/dm/DependencyManager.h
index 410e04a..c453457 100644
--- a/dependency_manager_cxx/include/celix/dm/DependencyManager.h
+++ b/dependency_manager_cxx/include/celix/dm/DependencyManager.h
@@ -82,7 +82,13 @@ namespace celix { namespace dm {
          */
         template<class T, class I>
         ServiceDependency<T,I>& createServiceDependency() {
+#ifdef __EXCEPTIONS
             auto dep = std::shared_ptr<ServiceDependency<T,I>> {new ServiceDependency<T,I>()};
+#else
+            auto dep = std::shared_ptr<ServiceDependency<T,I>> {new(std::nothrow)
ServiceDependency<T,I>()};
+            //TODO handle nullptr, how? Note that in modern operating system a null return
for a alloc is virtually impossible.
+#endif
+
             dependencies.push_back(dep);
             return *dep;
         };
@@ -95,7 +101,13 @@ namespace celix { namespace dm {
          */
         template<class T, typename I>
         CServiceDependency<T,I>& createCServiceDependency() {
+#ifdef __EXCEPTIONS
             auto dep = std::shared_ptr<CServiceDependency<T,I>> {new CServiceDependency<T,I>()};
+#else
+            auto dep = std::shared_ptr<CServiceDependency<T,I>> {new(std::nothrow)
CServiceDependency<T,I>()};
+            //TODO handle nullptr, how?
+#endif
+
             dependencies.push_back(dep);
             return *dep;
         }

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/include/celix/dm/ServiceDependency.h
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/include/celix/dm/ServiceDependency.h b/dependency_manager_cxx/include/celix/dm/ServiceDependency.h
index 8d08d9b..f0d715a 100644
--- a/dependency_manager_cxx/include/celix/dm/ServiceDependency.h
+++ b/dependency_manager_cxx/include/celix/dm/ServiceDependency.h
@@ -30,11 +30,14 @@
 #include <memory>
 #include <iostream>
 
+/**
+ * TODO add a dependency for a whiteboard pattern or marker service. e.g. a service where
the type is irrelevant.
+ */
+
 namespace celix { namespace dm {
 
     class DependencyManager; //forward declaration
 
-
     enum class DependencyUpdateStrategy {
         suspend,
         locking
@@ -43,9 +46,11 @@ namespace celix { namespace dm {
     class BaseServiceDependency {
     protected:
         dm_service_dependency_pt cServiceDep {nullptr};
+
         void setDepStrategy(DependencyUpdateStrategy strategy);
     public:
         BaseServiceDependency();
+
         virtual ~BaseServiceDependency() = default;
 
         /**
@@ -71,6 +76,10 @@ namespace celix { namespace dm {
     template<class T, typename I>
     class CServiceDependency : public TypedServiceDependency<T> {
     private:
+        std::string name {};
+        std::string filter {};
+        std::string versionRange {};
+
         void (T::*setFp)(const I* service) {nullptr};
         void (T::*setFpWithProperties)(const I* service, Properties&& properties)
{nullptr};
 
@@ -83,6 +92,8 @@ namespace celix { namespace dm {
         void setupCallbacks();
         int invokeCallback(void(T::*fp)(const I*), const void* service);
         int invokeCallbackWithProperties(void(T::*fp)(const I*, Properties&&), service_reference_pt
 ref, const void* service);
+
+        void setupService();
     public:
         CServiceDependency() : TypedServiceDependency<T>() {};
         virtual ~CServiceDependency() = default;
@@ -141,11 +152,18 @@ namespace celix { namespace dm {
                 void (T::*add)(const I* service, Properties&& properties),
                 void (T::*remove)(const I* service, Properties&& properties)
         );
+
+        /**
+         * Specify if the service dependency should add a service.lang filter part if it
is not already present
+         * For C service dependencies 'service.lang=C' will be added.
+         */
+        CServiceDependency<T,I>& setAddLanguageFilter(bool addLang);
     };
 
     template<class T, class I>
     class ServiceDependency : public TypedServiceDependency<T> {
     private:
+        bool addCxxLanguageFilter {true};
         std::string name {};
         std::string filter {};
         std::string versionRange {};
@@ -233,6 +251,13 @@ namespace celix { namespace dm {
          * @return the C service dependency reference for chaining (fluent API)
          */
         ServiceDependency<T,I>& setStrategy(DependencyUpdateStrategy strategy);
+
+        /**
+         * Specify if the service dependency should add a service.lang filter part if it
is not already present
+         * For C++ service dependencies 'service.lang=C++' will be added.
+         * Should be called before
+         */
+        ServiceDependency<T,I>& setAddLanguageFilter(bool addLang);
     };
 }}
 

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h b/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
index 2eabecc..ccd4d01 100644
--- a/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
+++ b/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
@@ -19,18 +19,34 @@
 
 #include <vector>
 #include <iostream>
+#include "constants.h"
 
 using namespace celix::dm;
 
 template<class T, typename I>
 CServiceDependency<T,I>& CServiceDependency<T,I>::setCService(const std::string
serviceName, const std::string serviceVersionRange, const std::string filter) {
-    const char* cversion = serviceVersionRange.empty() ? nullptr : serviceVersionRange.c_str();
-    const char* cfilter = filter.empty() ? nullptr : filter.c_str();
-    serviceDependency_setService(this->cServiceDependency(), serviceName.c_str(), cversion,
cfilter);
+    this->name = serviceName;
+    this->versionRange = serviceVersionRange;
+    this->filter = filter;
+    this->setupService();
     return *this;
 }
 
 template<class T, typename I>
+void CServiceDependency<T,I>::setupService() {
+    const char* cversion = this->versionRange.empty() ? nullptr : versionRange.c_str();
+    const char* cfilter = filter.empty() ? nullptr : filter.c_str();
+    serviceDependency_setService(this->cServiceDependency(), this->name.c_str(), cversion,
cfilter);
+};
+
+template<class T, typename I>
+CServiceDependency<T,I>& CServiceDependency<T,I>::setAddLanguageFilter(bool
addLang) {
+    serviceDependency_setAddCLanguageFilter(this->cServiceDependency(), addLang);
+    this->setupService();
+    return *this;
+};
+
+template<class T, typename I>
 CServiceDependency<T,I>& CServiceDependency<T,I>::setRequired(bool req) {
     serviceDependency_setRequired(this->cServiceDependency(), req);
     return *this;
@@ -169,7 +185,6 @@ int CServiceDependency<T,I>::invokeCallbackWithProperties(void(T::*fp)(const
I*,
     return 0;
 }
 
-
 template<class T, class I>
 ServiceDependency<T,I>::ServiceDependency() : TypedServiceDependency<T>() {
     setupService();
@@ -177,24 +192,49 @@ ServiceDependency<T,I>::ServiceDependency() : TypedServiceDependency<T>()
{
 
 template<class T, class I>
 void ServiceDependency<T,I>::setupService() {
-    std::string n = name.empty() ? typeName<I>() : name;
-    const char* v =  versionRange.empty() ? nullptr : versionRange.c_str();
+    std::string n = name;
 
-    //setting modified filter. which is in a filter including a lang=c++
-    modifiedFilter = std::string("(lang=c++)");
-    if (!filter.empty()) {
-        if (strncmp(filter.c_str(), "(&", 2) == 0 && filter[filter.size()-1]
== ')') {
-            modifiedFilter = filter.substr(0, filter.size()-1);
-            modifiedFilter = modifiedFilter.append("(lang=c++))");
-        } else if (filter[0] == '(' && filter[filter.size()-1] == ')') {
-            modifiedFilter = "(&";
-            modifiedFilter = modifiedFilter.append(filter);
-            modifiedFilter = modifiedFilter.append("(lang=c++))");
-        } else {
-            std::cerr << "Unexpected filter layout: '" << filter << "'\n";
+    if (n.empty()) {
+        n = typeName<I>();
+        if (n.empty()) {
+            std::cerr << "Error in service dependency. Type name cannot be inferred,
using '<TYPE_NAME_ERROR>'. function: '" << __PRETTY_FUNCTION__ << "'\n";
+            n = "<TYPE_NAME_ERROR>";
         }
     }
 
+    const char* v =  versionRange.empty() ? nullptr : versionRange.c_str();
+
+
+    if (this->addCxxLanguageFilter) {
+
+        char langFilter[128];
+        snprintf(langFilter, sizeof(langFilter), "(%s=%s)", CELIX_FRAMEWORK_SERVICE_LANGUAGE,
+                 CELIX_FRAMEWORK_SERVICE_CXX_LANGUAGE);
+
+        //setting modified filter. which is in a filter including a lang=c++
+        modifiedFilter = std::string{langFilter};
+        if (!filter.empty()) {
+            char needle[128];
+            snprintf(needle, sizeof(needle), "(%s=", CELIX_FRAMEWORK_SERVICE_LANGUAGE);
+            size_t langFilterPos = filter.find(needle);
+            if (langFilterPos != std::string::npos) {
+                //do nothing filter already contains a language part.
+            } else if (strncmp(filter.c_str(), "(&", 2) == 0 && filter[filter.size()
- 1] == ')') {
+                modifiedFilter = filter.substr(0, filter.size() - 1); //remove closing ')'
+                modifiedFilter = modifiedFilter.append(langFilter);
+                modifiedFilter = modifiedFilter.append(")"); //add closing ')'
+            } else if (filter[0] == '(' && filter[filter.size() - 1] == ')') {
+                modifiedFilter = "(&";
+                modifiedFilter = modifiedFilter.append(filter);
+                modifiedFilter = modifiedFilter.append(langFilter);
+                modifiedFilter = modifiedFilter.append(")");
+            } else {
+                std::cerr << "Unexpected filter layout: '" << filter <<
"'\n";
+            }
+        }
+    } else {
+        this->modifiedFilter = this->filter;
+    }
 
     serviceDependency_setService(this->cServiceDependency(), n.c_str(), v, this->modifiedFilter.c_str());
 }
@@ -220,6 +260,14 @@ ServiceDependency<T,I>& ServiceDependency<T,I>::setVersion(std::string
versionRa
     return *this;
 };
 
+
+template<class T, class I>
+ServiceDependency<T,I>& ServiceDependency<T,I>::setAddLanguageFilter(bool
addLang) {
+    this->addCxxLanguageFilter = addLang;
+    setupService();
+    return *this;
+};
+
 //set callbacks
 template<class T, class I>
 ServiceDependency<T,I>& ServiceDependency<T,I>::setCallbacks(void (T::*set)(I*
service)) {

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/include/celix/dm/types.h
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/include/celix/dm/types.h b/dependency_manager_cxx/include/celix/dm/types.h
index d4efeee..7ed4bd7 100644
--- a/dependency_manager_cxx/include/celix/dm/types.h
+++ b/dependency_manager_cxx/include/celix/dm/types.h
@@ -30,6 +30,7 @@
 #include <string.h>
 #include "celix/dm/Properties.h"
 #include <stdlib.h>
+#include <iostream>
 
 namespace celix { namespace dm {
     //forward declarations
@@ -47,15 +48,44 @@ namespace celix { namespace dm {
     /**
      * Returns the deferred type name for the template I
      */
-    template<typename I>
+    template<typename INTERFACE_TYPENAME>
     const std::string typeName() {
-        std::string result = std::string(typeid(I).name());
+        std::string result;
+
+#ifdef __GXX_RTTI
+        result = typeid(I);
         int status = 0;
         char* demangled_name {abi::__cxa_demangle(result.c_str(), NULL, NULL, &status)};
         if(status == 0) {
-            result = std::string(demangled_name);
+            result = std::string{demangled_name};
             free(demangled_name);
         }
+#else
+        const char *templateStr = "INTERFACE_TYPENAME =";
+        const size_t templateStrLen = strlen(templateStr);
+
+        result = __PRETTY_FUNCTION__; //USING pretty function to retrieve the filled in template
argument without using typeid()
+
+        size_t bpos = result.find(templateStr) + templateStrLen + 1; //find begin pos after
INTERFACE_TYPENAME = entry
+        size_t epos = bpos;
+        while (isalnum(result[epos]) || result[epos] == '_' || result[epos] == ';') {
+            epos += 1;
+        }
+        size_t len = epos - bpos - 1;
+        if (len < 0) {
+            len = 0;
+        }
+        result = result.substr(bpos, len);
+#endif
+
+        //std::cout << "PRETTY IS '" << __PRETTY_FUNCTION__ << "'\n";
+        //std::cout << "RESULT IS '" << result << "'\n";
+
+        if (result.empty()) {
+            std::cerr << "Cannot infer type name in function call '" << __PRETTY_FUNCTION__
<< "'\n'";
+        }
+
+
         return result;
     }
 

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/readme.md
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/readme.md b/dependency_manager_cxx/readme.md
index 9915d47..4bb429c 100644
--- a/dependency_manager_cxx/readme.md
+++ b/dependency_manager_cxx/readme.md
@@ -5,7 +5,8 @@
 The C++ Dependency Manager contains a static library which can be used to manage (dynamic)
services on a higher abstraction level in a declarative style. 
 The Apache Celix C++ Dependency Manager is inspired by the [Apache Felix Dependency Manager](http://felix.apache.org/documentation/subprojects/apache-felix-dependency-manager.html).
 
-The C++ Dependency Manager uses fluent interface to make specifying DM components and service
dependencies very concise.
+The C++ Dependency Manager uses fluent interface to make specifying DM components and service
dependencies very concise and relies on features introduced in C++11.
+
 
 
 ## C++ and C Dependency Manager

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/dependency_manager_cxx/src/dm_activator_base_cxx.cc
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/src/dm_activator_base_cxx.cc b/dependency_manager_cxx/src/dm_activator_base_cxx.cc
index 8cc8d85..f2b6328 100644
--- a/dependency_manager_cxx/src/dm_activator_base_cxx.cc
+++ b/dependency_manager_cxx/src/dm_activator_base_cxx.cc
@@ -44,9 +44,16 @@ typedef struct dm_dependency_activator_base *dependency_activator_base_pt;
 celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
     celix_status_t status = CELIX_SUCCESS;
 
+#ifdef __EXCEPTIONS
     auto man = std::shared_ptr<celix::dm::DependencyManager>{new celix::dm::DependencyManager(context)};
     auto dmAct = std::shared_ptr<celix::dm::DmActivator> {DmActivator::create(*man)};
     dependency_activator_base_pt act = new dm_dependency_activator_base(man, dmAct);
+#else
+    auto man = std::shared_ptr<celix::dm::DependencyManager>{new(std::nothrow) celix::dm::DependencyManager(context)};
+    auto dmAct = std::shared_ptr<celix::dm::DmActivator> {DmActivator::create(*man)};
+    dependency_activator_base_pt act = new(std::nothrow) dm_dependency_activator_base(man,
dmAct);
+#endif
+
 
     if (act != nullptr) {
         act->context = context;
@@ -71,6 +78,10 @@ celix_status_t bundleActivator_start(void *userData, bundle_context_pt
context)
     celix_status_t status = CELIX_SUCCESS;
     dependency_activator_base_pt act = (dependency_activator_base_pt) userData;
 
+    if (act == nullptr || act->manager == nullptr) {
+        return CELIX_ILLEGAL_STATE;
+    }
+
     act->activator->init(*act->manager);
     act->manager->start();
 
@@ -90,6 +101,10 @@ celix_status_t bundleActivator_stop(void *userData, bundle_context_pt
context __
     celix_status_t status = CELIX_SUCCESS;
     dependency_activator_base_pt act = (dependency_activator_base_pt) userData;
 
+    if (act == nullptr || act->manager == nullptr) {
+        return CELIX_ILLEGAL_STATE;
+    }
+
     // Remove the service
     status = serviceRegistration_unregister(act->reg);
     dependencyManager_removeAllComponents(act->manager->cDependencyManager());
@@ -102,7 +117,7 @@ celix_status_t bundleActivator_destroy(void *userData, bundle_context_pt
context
     dependency_activator_base_pt act = (dependency_activator_base_pt) userData;
 
     if (act == NULL) {
-        return CELIX_ILLEGAL_ARGUMENT;
+        return CELIX_ILLEGAL_STATE;
     }
 
     act->activator->deinit(*act->manager);

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/examples/dm_example_cxx/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/CMakeLists.txt b/examples/dm_example_cxx/CMakeLists.txt
index e0d9b6d..88e1a89 100644
--- a/examples/dm_example_cxx/CMakeLists.txt
+++ b/examples/dm_example_cxx/CMakeLists.txt
@@ -16,7 +16,7 @@
 # under the License.
 if (BUILD_DEPENDENCY_MANAGER_CXX)
     #set -Wall, -Werror locally, currenctly cpputest contains warnings
-    set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
 
     include_directories(
             ${PROJECT_SOURCE_DIR}/dependency_manager/public/include

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc b/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
index f2af7ec..8523ebe 100644
--- a/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
+++ b/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
@@ -38,6 +38,8 @@ void Phase2Cmp::setLogService(const log_service_t* logSrv) {
 }
 
 double Phase2Cmp::getData() {
-    logSrv->log(logSrv->logger, OSGI_LOGSERVICE_DEBUG, (char*)"getting data from phase2cmp
A\n");
+    if (this->logSrv != NULL) {
+        this->logSrv->log(this->logSrv->logger, OSGI_LOGSERVICE_DEBUG, (char
*) "getting data from phase2cmp A\n");
+    }
     return phase1->getData() * 42.0;
 };

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/examples/dm_example_cxx/phase2b/src/Phase2bCmp.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase2b/src/Phase2bCmp.cc b/examples/dm_example_cxx/phase2b/src/Phase2bCmp.cc
index cdb69c6..b6260af 100644
--- a/examples/dm_example_cxx/phase2b/src/Phase2bCmp.cc
+++ b/examples/dm_example_cxx/phase2b/src/Phase2bCmp.cc
@@ -32,6 +32,8 @@ void Phase2Cmp::setLogService(const log_service_t* logSrv) {
 }
 
 double Phase2Cmp::getData() {
-    logSrv->log(logSrv->logger, OSGI_LOGSERVICE_DEBUG, (char*)"getting data from phase2cmp
B\n");
+    if (this->logSrv != NULL) {
+        this->logSrv->log(this->logSrv->logger, OSGI_LOGSERVICE_DEBUG, (char
*) "getting data from phase2cmp B\n");
+    }
     return phase1->getData() * 24.0;
 };

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/framework/private/src/filter.c
----------------------------------------------------------------------
diff --git a/framework/private/src/filter.c b/framework/private/src/filter.c
index 671a1e0..f06d6e8 100644
--- a/framework/private/src/filter.c
+++ b/framework/private/src/filter.c
@@ -108,7 +108,7 @@ static filter_pt filter_parseFilter(char * filterString, int * pos) {
 	filter_pt filter;
 	filter_skipWhiteSpace(filterString, pos);
 	if (filterString[*pos] != '(') {
-		fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error: Missing '('.");
+		fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error: Missing '(' in filter string '%s'.", filterString);
 		return NULL;
 	}
 	(*pos)++;
@@ -118,7 +118,7 @@ static filter_pt filter_parseFilter(char * filterString, int * pos) {
 	filter_skipWhiteSpace(filterString, pos);
 
 	if (filterString[*pos] != ')') {
-		fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error: Missing ')'.");
+		fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error: Missing ')' in filter string '%s'.", filterString);
 		if(filter!=NULL){
 			filter_destroy(filter);
 		}

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/framework/public/include/constants.h
----------------------------------------------------------------------
diff --git a/framework/public/include/constants.h b/framework/public/include/constants.h
index 1064752..48eb376 100644
--- a/framework/public/include/constants.h
+++ b/framework/public/include/constants.h
@@ -33,6 +33,10 @@ static const char * const OSGI_FRAMEWORK_SERVICE_PID = "service.pid";
 static const char * const OSGI_FRAMEWORK_SERVICE_RANKING = "service.ranking";
 
 static const char * const CELIX_FRAMEWORK_SERVICE_VERSION = "service.version";
+static const char * const CELIX_FRAMEWORK_SERVICE_LANGUAGE = "service.lang";
+static const char * const CELIX_FRAMEWORK_SERVICE_C_LANGUAGE = "C";
+static const char * const CELIX_FRAMEWORK_SERVICE_CXX_LANGUAGE = "C++";
+static const char * const CELIX_FRAMEWORK_SERVICE_SHARED_LANGUAGE = "shared"; //e.g. marker
services
 
 static const char * const OSGI_FRAMEWORK_BUNDLE_ACTIVATOR = "Bundle-Activator";
 static const char * const OSGI_FRAMEWORK_BUNDLE_ACTIVATOR_CREATE = "bundleActivator_create";

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/log_service/private/src/log_service_activator.c
----------------------------------------------------------------------
diff --git a/log_service/private/src/log_service_activator.c b/log_service/private/src/log_service_activator.c
index 4f45153..8c72fb1 100644
--- a/log_service/private/src/log_service_activator.c
+++ b/log_service/private/src/log_service_activator.c
@@ -26,6 +26,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <constants.h>
 
 #include "bundle_activator.h"
 #include "log_service_impl.h"
@@ -107,7 +108,11 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt
context)
 
     logFactory_create(activator->logger, &activator->factory);
 
-    bundleContext_registerServiceFactory(context, (char *) OSGI_LOGSERVICE_NAME, activator->factory,
NULL, &activator->logServiceFactoryReg);
+	properties_pt props = properties_create();
+	properties_set(props, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
+
+
+	bundleContext_registerServiceFactory(context, (char *) OSGI_LOGSERVICE_NAME, activator->factory,
props, &activator->logServiceFactoryReg);
 
     logReaderService_create(activator->logger, &activator->reader);
 
@@ -118,7 +123,10 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt
context)
     activator->reader_service->removeLogListener = logReaderService_removeLogListener;
     activator->reader_service->removeAllLogListener = logReaderService_removeAllLogListener;
 
-    bundleContext_registerService(context, (char *) OSGI_LOGSERVICE_READER_SERVICE_NAME,
activator->reader_service, NULL, &activator->logReaderServiceReg);
+	props = properties_create();
+	properties_set(props, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
+
+    bundleContext_registerService(context, (char *) OSGI_LOGSERVICE_READER_SERVICE_NAME,
activator->reader_service, props, &activator->logReaderServiceReg);
 
     return status;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/b5e05854/shell/private/src/activator.c
----------------------------------------------------------------------
diff --git a/shell/private/src/activator.c b/shell/private/src/activator.c
index b98cb26..3dddf07 100644
--- a/shell/private/src/activator.c
+++ b/shell/private/src/activator.c
@@ -29,6 +29,7 @@
 #include "bundle_activator.h"
 #include "std_commands.h"
 #include "service_tracker.h"
+#include "constants.h"
 
 #define NUMBER_OF_COMMANDS 10
 
@@ -150,6 +151,7 @@ celix_status_t bundleActivator_create(bundle_context_pt context_ptr, void
**_ppt
             properties_set(instance_ptr->std_commands[i].props, OSGI_SHELL_COMMAND_NAME,
instance_ptr->std_commands[i].name);
             properties_set(instance_ptr->std_commands[i].props, OSGI_SHELL_COMMAND_USAGE,
instance_ptr->std_commands[i].usage);
             properties_set(instance_ptr->std_commands[i].props, OSGI_SHELL_COMMAND_DESCRIPTION,
instance_ptr->std_commands[i].description);
+            properties_set(instance_ptr->std_commands[i].props, CELIX_FRAMEWORK_SERVICE_LANGUAGE,
CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
 
             instance_ptr->std_commands[i].service = calloc(1, sizeof(*instance_ptr->std_commands[i].service));
             if (!instance_ptr->std_commands[i].service) {
@@ -186,7 +188,9 @@ celix_status_t bundleActivator_start(void *_ptr, bundle_context_pt context_ptr)
     }
 
     if (status == CELIX_SUCCESS) {
-        status = bundleContext_registerService(context_ptr, (char *) OSGI_SHELL_SERVICE_NAME,
instance_ptr->shellService, NULL, &instance_ptr->registration);
+        properties_pt props = properties_create();
+        properties_set(props, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE);
+        status = bundleContext_registerService(context_ptr, (char *) OSGI_SHELL_SERVICE_NAME,
instance_ptr->shellService, props, &instance_ptr->registration);
     }
 
 	if (status == CELIX_SUCCESS) {


Mime
View raw message