Author: pnoltes
Date: Tue Oct 28 19:10:04 2014
New Revision: 1634952
URL: http://svn.apache.org/r1634952
Log:
CELIX-77: fixed compilation errors. config admin still need to be review and
checked runtime
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test/private/include/example_managed_service_impl.h
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/activator.c
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/example_managed_service_impl.c
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c
celix/branches/celix_config_admin/config_admin/service/private/src/activator.c
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_admin_impl.c
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_impl.c
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_store.c
celix/branches/celix_config_admin/config_admin/service/private/src/managed_service_tracker.c
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test/private/include/example_managed_service_impl.h
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/examples/example_test/private/include/example_managed_service_impl.h?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/examples/example_test/private/include/example_managed_service_impl.h
(original)
+++
celix/branches/celix_config_admin/config_admin/examples/example_test/private/include/example_managed_service_impl.h
Tue Oct 28 19:10:04 2014
@@ -43,14 +43,14 @@
struct managed_service{
apr_pool_t *pool;
- BUNDLE_CONTEXT context;
+ bundle_context_pt context;
- SERVICE_REGISTRATION registration;
- PROPERTIES properties;
+ service_registration_pt registration;
+ properties_pt properties;
};
-celix_status_t managedServiceImpl_create(BUNDLE_CONTEXT context,
managed_service_t *instance);
-celix_status_t managedServiceImpl_updated(managed_service_t instance,
PROPERTIES properties);
+celix_status_t managedServiceImpl_create(bundle_context_pt context,
managed_service_pt *instance);
+celix_status_t managedServiceImpl_updated(managed_service_pt instance,
properties_pt properties);
#endif /* MANAGED_SERVICE_IMPL_H_ */
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/activator.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/activator.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/activator.c
(original)
+++
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/activator.c
Tue Oct 28 19:10:04 2014
@@ -44,17 +44,17 @@
#include "example_managed_service_impl.h"
-static void test_debugConfiguration(configuration_t configuration, char* pid);
+static void test_debugConfiguration(configuration_pt configuration, char* pid);
-celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData)
{
+celix_status_t bundleActivator_create(bundle_context_pt context, void
**userData) {
*userData = NULL;
return CELIX_SUCCESS;
}
-celix_status_t bundleActivator_start(void * userData, BUNDLE_CONTEXT ctx) {
+celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
- SERVICE_REFERENCE ref = NULL;
+ service_reference_pt ref = NULL;
celix_status_t status = bundleContext_getServiceReference(ctx, (char *)
CONFIGURATION_ADMIN_SERVICE_NAME, &ref);
if (status == CELIX_SUCCESS) {
@@ -67,7 +67,7 @@ celix_status_t bundleActivator_start(voi
printf("------------------- DEMO ----------------------
\n");
- configuration_admin_service_t confAdminServ = NULL;
+ configuration_admin_service_pt confAdminServ = NULL;
bundleContext_getService(ctx, ref, (void *)
&confAdminServ);
if (confAdminServ == NULL){
@@ -84,7 +84,7 @@ celix_status_t bundleActivator_start(voi
printf("------------------- TEST01
-------------------- \n");
printf("[ TEST ]: getConfiguration(pid=%s) -
It's new \n",pid);
- configuration_t configuration;
+ configuration_pt configuration;
(*confAdminServ->getConfiguration)(confAdminServ->configAdmin,pid,
&configuration);
test_debugConfiguration(configuration, pid);
@@ -95,7 +95,7 @@ celix_status_t bundleActivator_start(voi
printf("-------------------
TEST02--------------------- \n");
printf("[ TEST ]: getConfiguration(pid=%s) -
Looking for it in Cache \n",pid2);
- configuration_t configuration2;
+ configuration_pt configuration2;
(*confAdminServ->getConfiguration)(confAdminServ->configAdmin,pid2,
&configuration2);
test_debugConfiguration(configuration2, pid2);
@@ -106,13 +106,13 @@ celix_status_t bundleActivator_start(voi
printf("[ TEST ]: register
ManagedService(pid=%s) \n",pid);
- managed_service_t instance;
+ managed_service_pt instance;
status = managedServiceImpl_create(ctx,
&instance);
if (status != CELIX_SUCCESS){
return status;
}
- managed_service_service_t managedService;
+ managed_service_service_pt managedService;
status = managedService_create(ctx,
&managedService);
if (status != CELIX_SUCCESS){
return status;
@@ -121,9 +121,9 @@ celix_status_t bundleActivator_start(voi
managedService->managedService = instance;
managedService->updated =
managedServiceImpl_updated;
- PROPERTIES dictionary;
+ properties_pt dictionary;
dictionary = properties_create();
- properties_set(dictionary, (char *)
SERVICE_PID, pid);
+ properties_set(dictionary, (char *)
OSGI_FRAMEWORK_SERVICE_PID, pid);
status = bundleContext_registerService(ctx,
(char *) MANAGED_SERVICE_SERVICE_NAME,
managedService, dictionary,
&instance->registration);
@@ -146,7 +146,7 @@ celix_status_t bundleActivator_start(voi
printf("[ TEST ]: configuration update New
Properties \n");
char *prop1 = "type";
char *value1 = "printer";
- PROPERTIES properties = properties_create();
+ properties_pt properties = properties_create();
properties_set(properties, prop1, value1);
configuration_update(configuration ,
properties);
@@ -155,10 +155,10 @@ celix_status_t bundleActivator_start(voi
printf("------------------- TEST06
-------------------- \n");
printf("[ TEST ]: configuration get properties
\n");
- PROPERTIES propsRx = properties_create();
+ properties_pt propsRx = properties_create();
configuration_getProperties(configuration,
&propsRx);
- printf("[ TEST ]: PROP=%s - VALUE=%s \n",
(char*)SERVICE_PID, properties_get(propsRx,(char*)SERVICE_PID));
+ printf("[ TEST ]: PROP=%s - VALUE=%s \n",
(char*)OSGI_FRAMEWORK_SERVICE_PID,
properties_get(propsRx,(char*)OSGI_FRAMEWORK_SERVICE_PID));
printf("[ TEST ]: PROP=%s - VALUE=%s \n",
prop1, properties_get(propsRx,prop1));
printf("/////////////////// END TESTS
///////////////// \n");
@@ -169,15 +169,15 @@ celix_status_t bundleActivator_start(voi
return status;
}
-celix_status_t bundleActivator_stop(void * userData, BUNDLE_CONTEXT context) {
+celix_status_t bundleActivator_stop(void * userData, bundle_context_pt
context) {
return CELIX_SUCCESS;
}
-celix_status_t bundleActivator_destroy(void * userData, BUNDLE_CONTEXT
context) {
+celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt
context) {
return CELIX_SUCCESS;
}
-void test_debugConfiguration(configuration_t configuration, char* pid){
+void test_debugConfiguration(configuration_pt configuration, char* pid){
if (configuration == NULL){
printf("[ TEST ]: Configuration(pid=%s) is NULL \n", pid);
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/example_managed_service_impl.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/example_managed_service_impl.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/example_managed_service_impl.c
(original)
+++
celix/branches/celix_config_admin/config_admin/examples/example_test/private/src/example_managed_service_impl.c
Tue Oct 28 19:10:04 2014
@@ -32,7 +32,7 @@
/* ------------------------ Constructor -------------------------------------*/
-celix_status_t managedServiceImpl_create(BUNDLE_CONTEXT context,
managed_service_t *instance){
+celix_status_t managedServiceImpl_create(bundle_context_pt context,
managed_service_pt *instance){
celix_status_t status;
@@ -43,7 +43,7 @@ celix_status_t managedServiceImpl_create
return status;
}
- managed_service_t managedService =
apr_palloc(pool,sizeof(*managedService));
+ managed_service_pt managedService =
apr_palloc(pool,sizeof(*managedService));
if(!managedService){
printf("[ ERROR ]: ManagedServiceImpl - Not initialized
(ENOMEM) \n");
return CELIX_ENOMEM;
@@ -62,7 +62,7 @@ celix_status_t managedServiceImpl_create
/* -------------------- Implementation --------------------------------------*/
-celix_status_t managedServiceImpl_updated(managed_service_t managedService,
PROPERTIES properties){
+celix_status_t managedServiceImpl_updated(managed_service_pt managedService,
properties_pt properties){
if (properties == NULL){
printf("[ managedServiceImpl ]: updated - Received NULL
properties \n");
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c
(original)
+++
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_configuring/private/src/activator.c
Tue Oct 28 19:10:04 2014
@@ -28,14 +28,14 @@
#include "configuration.h"
-celix_status_t bundleActivator_create(BUNDLE_CONTEXT context, void **userData)
{
+celix_status_t bundleActivator_create(bundle_context_pt context, void
**userData) {
*userData = NULL;
return CELIX_SUCCESS;
}
-celix_status_t bundleActivator_start(void * userData, BUNDLE_CONTEXT ctx) {
+celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
- SERVICE_REFERENCE ref = NULL;
+ service_reference_pt ref = NULL;
celix_status_t status = bundleContext_getServiceReference(ctx, (char *)
CONFIGURATION_ADMIN_SERVICE_NAME, &ref);
if (status == CELIX_SUCCESS) {
@@ -46,7 +46,7 @@ celix_status_t bundleActivator_start(voi
} else {
- configuration_admin_service_t confAdminServ = NULL;
+ configuration_admin_service_pt confAdminServ = NULL;
bundleContext_getService(ctx, ref, (void *)
&confAdminServ);
if (confAdminServ == NULL){
@@ -57,7 +57,7 @@ celix_status_t bundleActivator_start(voi
char *pid = "base.device1";
- configuration_t configuration;
+ configuration_pt configuration;
char *configurationLocation;
/* ------------------ get Configuration
-------------------*/
@@ -83,11 +83,11 @@ celix_status_t bundleActivator_start(voi
return status;
}
-celix_status_t bundleActivator_stop(void * userData, BUNDLE_CONTEXT context) {
+celix_status_t bundleActivator_stop(void * userData, bundle_context_pt
context) {
return CELIX_SUCCESS;
}
-celix_status_t bundleActivator_destroy(void * userData, BUNDLE_CONTEXT
context) {
+celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt
context) {
return CELIX_SUCCESS;
}
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h
(original)
+++
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/include/example_managed_service_impl.h
Tue Oct 28 19:10:04 2014
@@ -44,15 +44,15 @@
struct managed_service{
apr_pool_t *pool;
- BUNDLE_CONTEXT context;
+ bundle_context_pt context;
- SERVICE_REGISTRATION registration;
- PROPERTIES properties;
+ service_registration_pt registration;
+ properties_pt properties;
};
-celix_status_t managedServiceImpl_create(BUNDLE_CONTEXT context,
managed_service_t *instance);
-celix_status_t managedServiceImpl_updated(managed_service_t instance,
PROPERTIES properties);
+celix_status_t managedServiceImpl_create(bundle_context_pt context,
managed_service_pt *instance);
+celix_status_t managedServiceImpl_updated(managed_service_pt instance,
properties_pt properties);
#endif /* MANAGED_SERVICE_IMPL_H_ */
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c
(original)
+++
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/activator.c
Tue Oct 28 19:10:04 2014
@@ -45,9 +45,9 @@
#include "example_managed_service_impl.h"
-celix_status_t bundleActivator_start(void * userData, BUNDLE_CONTEXT ctx) {
+celix_status_t bundleActivator_start(void * userData, bundle_context_pt ctx) {
- SERVICE_REFERENCE ref = NULL;
+ service_reference_pt ref = NULL;
celix_status_t status = bundleContext_getServiceReference(ctx, (char *)
CONFIGURATION_ADMIN_SERVICE_NAME, &ref);
if (status == CELIX_SUCCESS) {
@@ -60,7 +60,7 @@ celix_status_t bundleActivator_start(voi
printf("------------------- DEMO ----------------------
\n");
- configuration_admin_service_t confAdminServ = NULL;
+ configuration_admin_service_pt confAdminServ = NULL;
bundleContext_getService(ctx, ref, (void *)
&confAdminServ);
if (confAdminServ == NULL){
@@ -75,13 +75,13 @@ celix_status_t bundleActivator_start(voi
printf("[ BUNDLE example_managed_service ]:
register ManagedService(pid=%s) \n",pid);
- managed_service_t instance;
+ managed_service_pt instance;
status = managedServiceImpl_create(ctx,
&instance);
if (status != CELIX_SUCCESS){
return status;
}
- managed_service_service_t managedService;
+ managed_service_service_pt managedService;
status = managedService_create(ctx,
&managedService);
if (status != CELIX_SUCCESS){
return status;
@@ -90,9 +90,9 @@ celix_status_t bundleActivator_start(voi
managedService->managedService = instance;
managedService->updated =
managedServiceImpl_updated;
- PROPERTIES dictionary;
+ properties_pt dictionary;
dictionary = properties_create();
- properties_set(dictionary, (char *)
SERVICE_PID, pid);
+ properties_set(dictionary, (char *)
OSGI_FRAMEWORK_SERVICE_PID, pid);
status = bundleContext_registerService(ctx,
(char *) MANAGED_SERVICE_SERVICE_NAME,
managedService, dictionary,
&instance->registration);
@@ -109,11 +109,11 @@ celix_status_t bundleActivator_start(voi
return status;
}
-celix_status_t bundleActivator_stop(void * userData, BUNDLE_CONTEXT context) {
+celix_status_t bundleActivator_stop(void * userData, bundle_context_pt
context) {
return CELIX_SUCCESS;
}
-celix_status_t bundleActivator_destroy(void * userData, BUNDLE_CONTEXT
context) {
+celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt
context) {
return CELIX_SUCCESS;
}
Modified:
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c
(original)
+++
celix/branches/celix_config_admin/config_admin/examples/example_test2/bundle_managed_service/private/src/example_managed_service_impl.c
Tue Oct 28 19:10:04 2014
@@ -32,7 +32,7 @@
/* ------------------------ Constructor -------------------------------------*/
-celix_status_t managedServiceImpl_create(BUNDLE_CONTEXT context,
managed_service_t *instance){
+celix_status_t managedServiceImpl_create(bundle_context_pt context,
managed_service_pt *instance){
celix_status_t status;
@@ -43,7 +43,7 @@ celix_status_t managedServiceImpl_create
return status;
}
- managed_service_t managedService =
apr_palloc(pool,sizeof(*managedService));
+ managed_service_pt managedService =
apr_palloc(pool,sizeof(*managedService));
if(!managedService){
printf("[ ERROR ]: ManagedServiceImpl - Not initialized
(ENOMEM) \n");
return CELIX_ENOMEM;
@@ -62,7 +62,7 @@ celix_status_t managedServiceImpl_create
/* -------------------- Implementation --------------------------------------*/
-celix_status_t managedServiceImpl_updated(managed_service_t managedService,
PROPERTIES properties){
+celix_status_t managedServiceImpl_updated(managed_service_pt managedService,
properties_pt properties){
if (properties == NULL){
printf("[ managedServiceImpl ]: updated - Received NULL
properties \n");
Modified:
celix/branches/celix_config_admin/config_admin/service/private/src/activator.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/service/private/src/activator.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/service/private/src/activator.c
(original)
+++
celix/branches/celix_config_admin/config_admin/service/private/src/activator.c
Tue Oct 28 19:10:04 2014
@@ -122,7 +122,7 @@ celix_status_t bundleActivator_stop(void
bi->configAdminFactoryReg = NULL;
- return CELIX_SUCCESS;
+ return status;
}
celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt
context) {
Modified:
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_admin_impl.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/service/private/src/configuration_admin_impl.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_admin_impl.c
(original)
+++
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_admin_impl.c
Tue Oct 28 19:10:04 2014
@@ -92,9 +92,6 @@ celix_status_t configurationAdmin_create
}
celix_status_t configurationAdmin_getConfiguration(configuration_admin_pt
configAdmin, char *pid, configuration_pt *configuration){
-
- celix_status_t status;
-
configuration_pt config;
char *configAdminBundleLocation;
@@ -139,7 +136,7 @@ celix_status_t configurationAdmin_getCon
// (4) config.getBundleLocation != NULL ?
if (
configuration_getBundleLocation2(config,false,&configBundleLocation) ==
CELIX_SUCCESS ){
- if (
string_equals(configAdminBundleLocation,configBundleLocation) != 1 ){
+ if ( strcmp(configAdminBundleLocation,configBundleLocation) !=
0 ){
if (
configurationAdminFactory_checkConfigurationPermission(configAdmin->configurationAdminFactory)
!= CELIX_SUCCESS ){
printf("[ ERROR ]: ConfigAdmin - Config.
Permission \n");
Modified:
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_impl.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/service/private/src/configuration_impl.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_impl.c
(original)
+++
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_impl.c
Tue Oct 28 19:10:04 2014
@@ -350,7 +350,7 @@ celix_status_t configuration_bind(config
}
// (3): bundle and configuration have the same location?
- if ( string_equals(configuration->bundleLocation,
bundleLocation) ){ // (3): Yes
+ if ( strcmp(configuration->bundleLocation,
bundleLocation) == 0 ){ // (3): Yes
// bind up configuration with bundle
configuration->boundBundle = bundle;
printf("[ DEBUG ]: Configuration{PID=%s} - bind
(bound with Bundle{%s}) \n",configuration->pid,bundleLocation);
Modified:
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_store.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/service/private/src/configuration_store.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_store.c
(original)
+++
celix/branches/celix_config_admin/config_admin/service/private/src/configuration_store.c
Tue Oct 28 19:10:04 2014
@@ -77,8 +77,6 @@ static celix_status_t configurationStore
celix_status_t configurationStore_create(apr_pool_t *pool, bundle_context_pt
context, configuration_admin_factory_pt factory, configuration_store_pt *store){
- celix_status_t status;
-
*store = apr_palloc(pool, sizeof(**store));
if (!*store){
Modified:
celix/branches/celix_config_admin/config_admin/service/private/src/managed_service_tracker.c
URL:
http://svn.apache.org/viewvc/celix/branches/celix_config_admin/config_admin/service/private/src/managed_service_tracker.c?rev=1634952&r1=1634951&r2=1634952&view=diff
==============================================================================
---
celix/branches/celix_config_admin/config_admin/service/private/src/managed_service_tracker.c
(original)
+++
celix/branches/celix_config_admin/config_admin/service/private/src/managed_service_tracker.c
Tue Oct 28 19:10:04 2014
@@ -42,6 +42,7 @@
#include "constants.h"
#include "properties.h"
#include "utils.h"
+#include "service_reference.h"
/* celix.framework.Patch*/
#include "framework_patch.h"
/* celix.config_admin.public */
@@ -166,29 +167,22 @@ celix_status_t managedServiceTracker_cre
celix_status_t managedServiceTracker_createCustomized(apr_pool_t *pool,
bundle_context_pt context,
managed_service_tracker_t
trackerHandle, service_tracker_pt *tracker){
-
celix_status_t status = CELIX_SUCCESS;
- //TODO use create
- //serviceTrackerCustomizer_create
-
- service_tracker_customizer_pt customizer = apr_palloc(pool,
sizeof(struct serviceTrackerCustomizer));
+ service_tracker_customizer_pt customizer = NULL;
service_tracker_pt managedServiceTracker = NULL;
+ status = serviceTrackerCustomizer_create(trackerHandle,
managedServiceTracker_addingService, managedServiceTracker_addedService,
+ managedServiceTracker_modifiedService,
managedServiceTracker_removedService, &customizer);
- if(!customizer){
+ if(status != CELIX_SUCCESS){
printf("[ ERROR ]: TrackerCustomized - Not initialized(ENOMEM)
\n");
*tracker = NULL;
return CELIX_ENOMEM;
}
- customizer->handle= trackerHandle;
- customizer->addingService=managedServiceTracker_addingService;
- customizer->addedService=managedServiceTracker_addedService;
- customizer->modifiedService=managedServiceTracker_modifiedService;
- customizer->removedService=managedServiceTracker_removedService;
+ serviceTracker_create(context, (char *) MANAGED_SERVICE_SERVICE_NAME,
customizer, &managedServiceTracker);
- status = serviceTracker_create(pool, context, (char *)
MANAGED_SERVICE_SERVICE_NAME, customizer, &managedServiceTracker);
if (status != CELIX_SUCCESS) {
printf("[ ERROR ]: TrackerCustomized - Not created \n");
*tracker = NULL;
@@ -210,7 +204,7 @@ celix_status_t managedServiceTracker_add
celix_status_t status;
- void *pid = NULL;
+ char *pid = NULL;
bundle_context_pt context = NULL;
@@ -219,7 +213,8 @@ celix_status_t managedServiceTracker_add
// (1) reference.getPid
- if ( serviceReference_getProperty(reference, (char *)SERVICE_PID, &pid)
!= CELIX_SUCCESS || pid == NULL){
+ status = serviceReference_getProperty(reference, (char
*)OSGI_FRAMEWORK_SERVICE_ID, &pid);
+ if (status != CELIX_SUCCESS || pid == NULL){
*service = NULL;
printf(" [ ERROR ]: Tracker - PID is NULL \n");
return CELIX_ILLEGAL_ARGUMENT;