celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1628441 - in /celix/trunk/remote_services/remote_service_admin_http/private/src: import_registration_impl.c remote_service_admin_impl.c
Date Tue, 30 Sep 2014 13:28:42 GMT
Author: bpetri
Date: Tue Sep 30 13:28:42 2014
New Revision: 1628441

URL: http://svn.apache.org/r1628441
Log:
CELIX-158: start tracker before starting of endpoint

Modified:
    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_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=1628441&r1=1628440&r2=1628441&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
Tue Sep 30 13:28:42 2014
@@ -142,6 +142,11 @@ celix_status_t importRegistrationFactory
 {
 	celix_status_t status = CELIX_SUCCESS;
 
+
+	if (registration_factory->proxyFactoryTracker != NULL) {
+		serviceTracker_close(registration_factory->proxyFactoryTracker);
+	}
+
 	if (registration_factory->bundle != NULL) {
 		bundle_stop(registration_factory->bundle);
 		bundle_uninstall(registration_factory->bundle);
@@ -214,21 +219,26 @@ celix_status_t importRegistrationFactory
 	{
 		fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "remoteServiceAdmin_importService: error while
creating importRegistrationFactory.");
 	}
-	else if ((status = importRegistrationFactory_open(*registration_factory)) != CELIX_SUCCESS)
-	{
-		fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "remoteServiceAdmin_importService: cannot open
registration_factory for %s.", serviceName);
-		importRegistrationFactory_destroy(registration_factory);
-	}
 	else
 	{
+		// starting the proxy tracker first allows us to pick up already available proxy factories
 		importRegistration_createProxyFactoryTracker(*registration_factory, &((*registration_factory)->proxyFactoryTracker));
 		fw_log(logger, OSGI_FRAMEWORK_LOG_INFO, "remoteServiceAdmin_importService: new registration_factory
added for %s at %p", serviceName, (*registration_factory)->proxyFactoryTracker);
-	}
 
+		// check whether factory is available
+		if (((*registration_factory)->trackedFactory == NULL) && ((status = importRegistrationFactory_open(*registration_factory))
!= CELIX_SUCCESS))
+		{
+			fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "remoteServiceAdmin_importService: cannot open
registration_factory for %s.", serviceName);
+			importRegistrationFactory_destroy(registration_factory);
+			serviceTracker_close((*registration_factory)->proxyFactoryTracker);
+		}
+	}
 	return status;
 }
 
 
+
+
 celix_status_t importRegistration_getException(import_registration_pt registration) {
 	celix_status_t status = CELIX_SUCCESS;
 	return status;

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=1628441&r1=1628440&r2=1628441&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
Tue Sep 30 13:28:42 2014
@@ -434,7 +434,7 @@ celix_status_t remoteServiceAdmin_import
 
    import_registration_factory_pt registration_factory = (import_registration_factory_pt)
hashMap_get(admin->importedServices, endpointDescription->service);
 
-	// check whether we already have a registration_factory
+	// 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, &registration_factory);



Mime
View raw message