You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2014/12/22 17:12:18 UTC
svn commit: r1647344 - in /celix/trunk/remote_services:
remote_service_admin/private/include/ remote_service_admin/private/src/
remote_service_admin_http/private/src/
Author: abroekhuis
Date: Mon Dec 22 16:12:18 2014
New Revision: 1647344
URL: http://svn.apache.org/r1647344
Log:
CELIX-182: Updated RSA to reuse loghelper instead of creating a new one.
Modified:
celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h
celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h
celix/trunk/remote_services/remote_service_admin/private/src/remote_proxy_factory_impl.c
celix/trunk/remote_services/remote_service_admin_http/private/src/export_registration_impl.c
celix/trunk/remote_services/remote_service_admin_http/private/src/import_registration_impl.c
celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
Modified: celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h?rev=1647344&r1=1647343&r2=1647344&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h (original)
+++ celix/trunk/remote_services/remote_service_admin/private/include/export_registration_impl.h Mon Dec 22 16:12:18 2014
@@ -51,7 +51,7 @@ struct export_registration {
bool closed;
};
-celix_status_t exportRegistration_create(apr_pool_t *pool, service_reference_pt reference, endpoint_description_pt endpoint, remote_service_admin_pt rsa, bundle_context_pt context, export_registration_pt *registration);
+celix_status_t exportRegistration_create(apr_pool_t *pool, log_helper_pt helper, service_reference_pt reference, endpoint_description_pt endpoint, remote_service_admin_pt rsa, bundle_context_pt context, export_registration_pt *registration);
celix_status_t exportRegistration_destroy(export_registration_pt *registration);
celix_status_t exportRegistration_open(export_registration_pt registration);
celix_status_t exportRegistration_close(export_registration_pt registration);
Modified: celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h?rev=1647344&r1=1647343&r2=1647344&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h (original)
+++ celix/trunk/remote_services/remote_service_admin/private/include/import_registration_impl.h Mon Dec 22 16:12:18 2014
@@ -77,7 +77,7 @@ celix_status_t importRegistration_create
celix_status_t importRegistrationFactory_destroy(import_registration_factory_pt* registration_factory);
//celix_status_t importRegistrationFactory_open(import_registration_factory_pt registration_factory);
celix_status_t importRegistrationFactory_close(import_registration_factory_pt registration_factory);
-celix_status_t importRegistrationFactory_install(apr_pool_t *pool, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory);
+celix_status_t importRegistrationFactory_install(apr_pool_t *pool, log_helper_pt helper, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory);
Modified: celix/trunk/remote_services/remote_service_admin/private/src/remote_proxy_factory_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin/private/src/remote_proxy_factory_impl.c?rev=1647344&r1=1647343&r2=1647344&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin/private/src/remote_proxy_factory_impl.c (original)
+++ celix/trunk/remote_services/remote_service_admin/private/src/remote_proxy_factory_impl.c Mon Dec 22 16:12:18 2014
@@ -110,6 +110,7 @@ celix_status_t remoteProxyFactory_unregi
if (status == CELIX_SUCCESS) {
if (remote_proxy_factory_ptr->registration) {
status = serviceRegistration_unregister(remote_proxy_factory_ptr->registration);
+ remote_proxy_factory_ptr->properties = NULL;
}
if (remote_proxy_factory_ptr->properties) {
properties_destroy(remote_proxy_factory_ptr->properties);
Modified: celix/trunk/remote_services/remote_service_admin_http/private/src/export_registration_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin_http/private/src/export_registration_impl.c?rev=1647344&r1=1647343&r2=1647344&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin_http/private/src/export_registration_impl.c (original)
+++ celix/trunk/remote_services/remote_service_admin_http/private/src/export_registration_impl.c Mon Dec 22 16:12:18 2014
@@ -45,7 +45,7 @@ celix_status_t exportRegistration_endpoi
celix_status_t exportRegistration_createEndpointTracker(export_registration_pt registration, service_tracker_pt *tracker);
-celix_status_t exportRegistration_create(apr_pool_t *pool, service_reference_pt reference, endpoint_description_pt endpoint, remote_service_admin_pt rsa, bundle_context_pt context, export_registration_pt *registration) {
+celix_status_t exportRegistration_create(apr_pool_t *pool, log_helper_pt helper, service_reference_pt reference, endpoint_description_pt endpoint, remote_service_admin_pt rsa, bundle_context_pt context, export_registration_pt *registration) {
celix_status_t status = CELIX_SUCCESS;
apr_pool_t *mypool = NULL;
apr_pool_create(&mypool, pool);
@@ -65,7 +65,7 @@ celix_status_t exportRegistration_create
(*registration)->endpointTracker = NULL;
(*registration)->exportReference = NULL;
(*registration)->bundle = NULL;
- (*registration)->loghelper = NULL;
+ (*registration)->loghelper = helper;
}
return status;
@@ -184,10 +184,6 @@ celix_status_t exportRegistration_open(e
celix_status_t status = CELIX_SUCCESS;
char *bundleStore = NULL;
- if(logHelper_create(registration->context, ®istration->loghelper) == CELIX_SUCCESS) {
- logHelper_start(registration->loghelper);
- }
-
bundleContext_getProperty(registration->context, BUNDLE_STORE_PROPERTY_NAME, &bundleStore);
if (bundleStore == NULL) {
@@ -212,9 +208,6 @@ celix_status_t exportRegistration_close(
bundle_uninstall(registration->bundle);
remoteServiceAdmin_removeExportedService(registration);
- logHelper_stop(registration->loghelper);
- logHelper_destroy(®istration->loghelper);
-
exportRegistration_destroy(®istration);
return status;
Modified: celix/trunk/remote_services/remote_service_admin_http/private/src/import_registration_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin_http/private/src/import_registration_impl.c?rev=1647344&r1=1647343&r2=1647344&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin_http/private/src/import_registration_impl.c (original)
+++ celix/trunk/remote_services/remote_service_admin_http/private/src/import_registration_impl.c Mon Dec 22 16:12:18 2014
@@ -73,7 +73,7 @@ celix_status_t importRegistration_destro
}
-celix_status_t importRegistrationFactory_create(apr_pool_t *pool, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory) {
+celix_status_t importRegistrationFactory_create(apr_pool_t *pool, log_helper_pt helper, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory) {
celix_status_t status = CELIX_SUCCESS;
apr_pool_t *mypool = NULL;
apr_pool_create(&mypool, pool);
@@ -86,12 +86,9 @@ celix_status_t importRegistrationFactory
(*registration_factory)->pool = mypool;
(*registration_factory)->context = context;
(*registration_factory)->bundle = NULL;
+ (*registration_factory)->loghelper = helper;
arrayList_create(&(*registration_factory)->registrations);
-
- if (logHelper_create(context, &(*registration_factory)->loghelper) == CELIX_SUCCESS) {
- logHelper_start((*registration_factory)->loghelper);
- }
}
return status;
@@ -102,9 +99,6 @@ celix_status_t importRegistrationFactory
celix_status_t importRegistrationFactory_destroy(import_registration_factory_pt* registration_factory) {
celix_status_t status = CELIX_SUCCESS;
- logHelper_stop((*registration_factory)->loghelper);
- logHelper_destroy(&(*registration_factory)->loghelper);
-
if (*registration_factory != NULL)
{
free((*registration_factory)->serviceName);
@@ -218,11 +212,11 @@ celix_status_t importRegistration_proxyF
-celix_status_t importRegistrationFactory_install(apr_pool_t *pool, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory)
+celix_status_t importRegistrationFactory_install(apr_pool_t *pool, log_helper_pt helper, char* serviceName, bundle_context_pt context, import_registration_factory_pt *registration_factory)
{
celix_status_t status = CELIX_BUNDLE_EXCEPTION;
- if ( (status = importRegistrationFactory_create(pool, serviceName, context, registration_factory)) == CELIX_SUCCESS) {
+ if ( (status = importRegistrationFactory_create(pool, helper, serviceName, context, registration_factory)) == CELIX_SUCCESS) {
// starting the proxy tracker first allows us to pick up already available proxy factories
importRegistration_createProxyFactoryTracker(*registration_factory, &((*registration_factory)->proxyFactoryTracker));
logHelper_log((*registration_factory)->loghelper, OSGI_LOGSERVICE_INFO, "remoteServiceAdmin_importService: new registration_factory added for %s at %p", serviceName, (*registration_factory)->proxyFactoryTracker);
Modified: celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c?rev=1647344&r1=1647343&r2=1647344&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c (original)
+++ celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c Mon Dec 22 16:12:18 2014
@@ -413,7 +413,7 @@ celix_status_t remoteServiceAdmin_export
char *interface = arrayList_get(interfaces, iter);
export_registration_pt registration = NULL;
- exportRegistration_create(admin->pool, reference, NULL, admin, admin->context, ®istration);
+ exportRegistration_create(admin->pool, admin->loghelper, reference, NULL, admin, admin->context, ®istration);
arrayList_add(*registrations, registration);
remoteServiceAdmin_installEndpoint(admin, registration, reference, interface);
@@ -576,7 +576,7 @@ celix_status_t remoteServiceAdmin_getImp
celix_status_t remoteServiceAdmin_importService(remote_service_admin_pt admin, endpoint_description_pt endpointDescription, import_registration_pt *registration) {
celix_status_t status = CELIX_SUCCESS;
-// logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "RSA: Import service %s", endpointDescription->service);
+ logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "RSA: Import service %s", endpointDescription->service);
celixThreadMutex_lock(&admin->importedServicesLock);
@@ -585,7 +585,7 @@ celix_status_t remoteServiceAdmin_import
// check whether we already have a registration_factory registered in the hashmap
if (registration_factory == NULL)
{
- status = importRegistrationFactory_install(admin->pool, endpointDescription->service, admin->context, ®istration_factory);
+ status = importRegistrationFactory_install(admin->pool, admin->loghelper, endpointDescription->service, admin->context, ®istration_factory);
if (status == CELIX_SUCCESS) {
hashMap_put(admin->importedServices, endpointDescription->service, registration_factory);
}
@@ -594,8 +594,7 @@ celix_status_t remoteServiceAdmin_import
// factory available
if (status != CELIX_SUCCESS || (registration_factory->trackedFactory == NULL))
{
- // #TODO Why does this fail here?
-// logHelper_log(admin->loghelper, OSGI_LOGSERVICE_WARNING, "RSA: no proxyFactory available.");
+ logHelper_log(admin->loghelper, OSGI_LOGSERVICE_WARNING, "RSA: no proxyFactory available.");
}
else
{