This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/develop by this push:
     new 19a2595  Adds support for logging call (in serialized form) for the 
RSA DFI.
19a2595 is described below

commit 19a25951ef383415eab618b535bb85aa50c1ad0c
Author: Pepijn Noltes <[email protected]>
AuthorDate: Tue Mar 12 22:23:49 2019 +0100

    Adds support for logging call (in serialized form) for the RSA DFI.
---
 .../src/endpoint_discovery_poller.c                |   2 +-
 .../src/endpoint_discovery_server.c                |   2 +-
 .../remote_service_admin_dfi/README.md             |  33 +++++++
 .../src/export_registration_dfi.c                  |  26 +++--
 .../src/export_registration_dfi.h                  |   2 +-
 .../src/import_registration_dfi.c                  |  31 +++++-
 .../src/import_registration_dfi.h                  |   2 +-
 .../src/remote_service_admin_dfi.c                 | 108 +++++++++------------
 .../src/remote_service_admin_dfi.h                 |  14 ++-
 .../src/remote_service_admin_dfi_constants.h       |  44 +++++++++
 .../rsa_common/src/import_registration_impl.c      |   3 +-
 .../rsa_spi/include/import_registration.h          |   1 +
 12 files changed, 179 insertions(+), 89 deletions(-)

diff --git 
a/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c 
b/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
index e3f9cd4..06ffc42 100644
--- a/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
+++ b/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
@@ -377,7 +377,7 @@ static celix_status_t 
endpointDiscoveryPoller_getEndpoints(endpoint_discovery_po
                        endpointDescriptorReader_destroy(reader);
                }
        } else {
-               logHelper_log(*poller->loghelper, OSGI_LOGSERVICE_ERROR, 
"ENDPOINT_POLLER: unable to read endpoints from %s, reason: %s", url, 
curl_easy_strerror(res));
+               logHelper_log(*poller->loghelper, OSGI_LOGSERVICE_WARNING, 
"ENDPOINT_POLLER: unable to read endpoints from %s, reason: %s", url, 
curl_easy_strerror(res));
        }
 
        // clean up endpoints file
diff --git 
a/bundles/remote_services/discovery_common/src/endpoint_discovery_server.c 
b/bundles/remote_services/discovery_common/src/endpoint_discovery_server.c
index ce23179..b047cf6 100644
--- a/bundles/remote_services/discovery_common/src/endpoint_discovery_server.c
+++ b/bundles/remote_services/discovery_common/src/endpoint_discovery_server.c
@@ -187,7 +187,7 @@ celix_status_t endpointDiscoveryServer_create(
                        port_counter++;
                        snprintf(&newPort[0], 10,  "%ld", (currentPort+1));
 
-                       logHelper_log(discovery->loghelper, 
OSGI_LOGSERVICE_ERROR, "Error while starting discovery server on port %s - 
retrying on port %s...", port, newPort);
+                       logHelper_log(discovery->loghelper, 
OSGI_LOGSERVICE_WARNING, "Error while starting discovery server on port %s - 
retrying on port %s...", port, newPort);
                        port = newPort;
 
                }
diff --git a/bundles/remote_services/remote_service_admin_dfi/README.md 
b/bundles/remote_services/remote_service_admin_dfi/README.md
new file mode 100644
index 0000000..6a3ded4
--- /dev/null
+++ b/bundles/remote_services/remote_service_admin_dfi/README.md
@@ -0,0 +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.
+-->
+
+## Remote Service Admin DFI
+
+The Celix Remote Service Admin DFI bundle realizes OSGi remote service using 
HTTP and JSON.
+The serialization is done using libdfi to json. 
+Libffi is configured using descriptor files in the bundles. 
+
+###### Properties
+    RSA_PORT                    The RSA HTTP port to use (default 8888)
+    RSA_IP                      The RSA ip address to use for discovery 
(default 127.0.0.1)
+    RSA_INTERFACE               If specified, the ip adress of interface (i.g. 
eth0) will be used.
+    
+    RSA_LOG_CALLS              If set to true, the RSA will Log calls info 
(including serialized data) to the file in RSA_DUMP_CALLS_FILE. Default is 
false.
+    RSA_LOG_CALLS_FILE         If RSA_DUMP_CALLS is enabled to file to dump to 
(starting rsa will truncate file). Default is stdout.          
+
+###### CMake option
+    RSA_REMOTE_SERVICE_ADMIN_DFI=ON
diff --git 
a/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.c
 
b/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.c
index b83b5a8..bd027c9 100644
--- 
a/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.c
+++ 
b/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.c
@@ -46,12 +46,14 @@ struct export_registration {
 
     //TODO add tracker and lock
     bool closed;
+
+    FILE *logFile;
 };
 
 static void exportRegistration_addServ(export_registration_pt reg, 
service_reference_pt ref, void *service);
 static void exportRegistration_removeServ(export_registration_pt reg, 
service_reference_pt ref, void *service);
 
-celix_status_t exportRegistration_create(log_helper_pt helper, 
service_reference_pt reference, endpoint_description_pt endpoint, 
bundle_context_pt context, export_registration_pt *out) {
+celix_status_t exportRegistration_create(log_helper_pt helper, 
service_reference_pt reference, endpoint_description_pt endpoint, 
bundle_context_pt context, FILE *logFile, export_registration_pt *out) {
     celix_status_t status = CELIX_SUCCESS;
 
     const char *servId = NULL;
@@ -74,6 +76,8 @@ celix_status_t exportRegistration_create(log_helper_pt 
helper, service_reference
         reg->exportReference.endpoint = endpoint;
         reg->exportReference.reference = reference;
         reg->closed = false;
+        reg->logFile = logFile;
+        reg->servId = strndup(servId, 1024);
 
         celixThreadMutex_create(&reg->mutex, NULL);
     }
@@ -141,13 +145,21 @@ celix_status_t exportRegistration_create(log_helper_pt 
helper, service_reference
 celix_status_t exportRegistration_call(export_registration_pt export, char 
*data, int datalength, char **responseOut, int *responseLength) {
     int status = CELIX_SUCCESS;
 
-    //printf("calling for '%s'\n");
-
     *responseLength = -1;
     celixThreadMutex_lock(&export->mutex);
     status = jsonRpc_call(export->intf, export->service, data, responseOut);
     celixThreadMutex_unlock(&export->mutex);
 
+    //printf("calling for '%s'\n");
+    if (export->logFile != NULL) {
+        static int callCount = 0;
+        char *name = NULL;
+        dynInterface_getName(export->intf, &name);
+        fprintf(export->logFile, "REMOTE CALL 
%i\n\tservice=%s\n\tservice_id=%s\n\trequest_payload=%s\n\tstatus=%i\n", 
callCount, name, export->servId, data, status);
+        fflush(export->logFile);
+        callCount += 1;
+    }
+
     return status;
 }
 
@@ -167,6 +179,9 @@ void exportRegistration_destroy(export_registration_pt reg) 
{
         if (reg->tracker != NULL) {
             serviceTracker_destroy(reg->tracker);
         }
+        if (reg->servId != NULL) {
+            free(reg->servId);
+        }
         celixThreadMutex_destroy(&reg->mutex);
 
         free(reg);
@@ -245,7 +260,4 @@ celix_status_t 
exportReference_getExportedService(export_reference_pt reference,
     celix_status_t status = CELIX_SUCCESS;
     *ref = reference->reference;
     return status;
-}
-
-
-
+}
\ No newline at end of file
diff --git 
a/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.h
 
b/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.h
index 93f37ba..fb126ae 100644
--- 
a/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.h
+++ 
b/bundles/remote_services/remote_service_admin_dfi/src/export_registration_dfi.h
@@ -25,7 +25,7 @@
 #include "log_helper.h"
 #include "endpoint_description.h"
 
-celix_status_t exportRegistration_create(log_helper_pt helper, 
service_reference_pt reference, endpoint_description_pt endpoint, 
bundle_context_pt context, export_registration_pt *registration);
+celix_status_t exportRegistration_create(log_helper_pt helper, 
service_reference_pt reference, endpoint_description_pt endpoint, 
bundle_context_pt context, FILE *logFile, export_registration_pt *registration);
 celix_status_t exportRegistration_close(export_registration_pt registration);
 void exportRegistration_destroy(export_registration_pt registration);
 
diff --git 
a/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.c
 
b/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.c
index 0b8dcf7..af3339f 100644
--- 
a/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.c
+++ 
b/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.c
@@ -26,6 +26,8 @@
 #include "dyn_interface.h"
 #include "import_registration.h"
 #include "import_registration_dfi.h"
+#include "remote_service_admin_dfi.h"
+#include "remote_service_admin_dfi_constants.h"
 
 struct import_registration {
     bundle_context_pt context;
@@ -42,6 +44,8 @@ struct import_registration {
 
     hash_map_pt proxies; //key -> bundle, value -> service_proxy
     celix_thread_mutex_t proxiesMutex; //protects proxies
+
+    FILE *logFile;
 };
 
 struct service_proxy {
@@ -55,9 +59,10 @@ static celix_status_t 
importRegistration_createProxy(import_registration_pt impo
 static void importRegistration_proxyFunc(void *userData, void *args[], void 
*returnVal);
 static void importRegistration_destroyProxy(struct service_proxy *proxy);
 static void importRegistration_clearProxies(import_registration_pt import);
+static const char* importRegistration_getUrl(import_registration_pt reg);
+static const char* importRegistration_getServiceName(import_registration_pt 
reg);
 
-celix_status_t importRegistration_create(bundle_context_pt context, 
endpoint_description_pt endpoint, const char *classObject, const char* 
serviceVersion,
-                                         import_registration_pt *out) {
+celix_status_t importRegistration_create(bundle_context_pt context, 
endpoint_description_pt endpoint, const char *classObject, const char* 
serviceVersion, FILE *logFile, import_registration_pt *out) {
     celix_status_t status = CELIX_SUCCESS;
     import_registration_pt reg = calloc(1, sizeof(*reg));
 
@@ -78,15 +83,16 @@ celix_status_t importRegistration_create(bundle_context_pt 
context, endpoint_des
         reg->factory->handle = reg;
         reg->factory->getService = (void *)importRegistration_getService;
         reg->factory->ungetService = (void *)importRegistration_ungetService;
+        reg->logFile = logFile;
     } else {
         status = CELIX_ENOMEM;
     }
 
+
     if (status == CELIX_SUCCESS) {
         //printf("IMPORT REGISTRATION IS %p\n", reg);
         *out = reg;
-    }
-    else{
+    } else {
        importRegistration_destroy(reg);
     }
 
@@ -324,6 +330,15 @@ static void importRegistration_proxyFunc(void *userData, 
void *args[], void *ret
 
         *(int *) returnVal = rc;
 
+        if (import->logFile != NULL) {
+            static int callCount = 0;
+            const char *url = importRegistration_getUrl(import);
+            const char *svcName = importRegistration_getServiceName(import);
+            fprintf(import->logFile, "REMOTE CALL NR 
%i\n\turl=%s\n\tservice=%s\n\tpayload=%s\n\treturn_code=%i\n\treply=%s\n",
+                                       callCount, url, svcName, invokeRequest, 
rc, reply);
+            fflush(import->logFile);
+            callCount += 1;
+        }
         free(invokeRequest); //Allocated by json_dumps in 
jsonRpc_prepareInvokeRequest
         free(reply); //Allocated by json_dumps in remoteServiceAdmin_send 
through curl call
     }
@@ -400,3 +415,11 @@ celix_status_t 
importReference_getImportedService(import_reference_pt reference)
     celix_status_t status = CELIX_SUCCESS;
     return status;
 }
+
+static const char* importRegistration_getUrl(import_registration_pt reg) {
+    return celix_properties_get(reg->endpoint->properties, 
RSA_DFI_ENDPOINT_URL, "!Error!");
+}
+
+static const char* importRegistration_getServiceName(import_registration_pt 
reg) {
+    return reg->endpoint->service;
+}
diff --git 
a/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.h
 
b/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.h
index aac4bc7..01777e9 100644
--- 
a/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.h
+++ 
b/bundles/remote_services/remote_service_admin_dfi/src/import_registration_dfi.h
@@ -27,7 +27,7 @@
 
 typedef void (*send_func_type)(void *handle, endpoint_description_pt 
endpointDescription, char *request, char **reply, int* replyStatus);
 
-celix_status_t importRegistration_create(bundle_context_pt context, 
endpoint_description_pt description, const char *classObject, const char* 
serviceVersion,
+celix_status_t importRegistration_create(bundle_context_pt context, 
endpoint_description_pt description, const char *classObject, const char* 
serviceVersion, FILE *logFile,
                                          import_registration_pt *import);
 celix_status_t importRegistration_close(import_registration_pt import);
 void importRegistration_destroy(import_registration_pt import);
diff --git 
a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
 
b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
index 147aa54..9ecea65 100644
--- 
a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
+++ 
b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
@@ -16,13 +16,7 @@
  *specific language governing permissions and limitations
  *under the License.
  */
-/*
- * remote_service_admin_impl.c
- *
- *  \date       May 21, 2015
- *  \author            <a href="mailto:[email protected]";>Apache Celix 
Project Team</a>
- *  \copyright Apache License, Version 2.0
- */
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -46,6 +40,9 @@
 #include "constants.h"
 #include "civetweb.h"
 
+#include "remote_service_admin_dfi_constants.h"
+#include "celix_bundle_context.h"
+
 // defines how often the webserver is restarted (with an increased port number)
 #define MAX_NUMBER_OF_RESTARTS         5
 
@@ -73,6 +70,8 @@ struct remote_service_admin {
     char *ip;
 
     struct mg_context *ctx;
+
+    FILE *logFile;
 };
 
 struct post {
@@ -97,13 +96,6 @@ static const char *data_response_headers =
 static const char *no_content_response_headers =
         "HTTP/1.1 204 OK\r\n";
 
-// TODO do we need to specify a non-Amdatu specific configuration type?!
-static const char * const CONFIGURATION_TYPE = "org.amdatu.remote.admin.http";
-static const char * const ENDPOINT_URL = "org.amdatu.remote.admin.http.url";
-
-static const char *DEFAULT_PORT = "8888";
-static const char *DEFAULT_IP = "127.0.0.1";
-
 static const unsigned int DEFAULT_TIMEOUT = 0;
 
 static int remoteServiceAdmin_callback(struct mg_connection *conn);
@@ -122,10 +114,6 @@ celix_status_t remoteServiceAdmin_create(bundle_context_pt 
context, remote_servi
     if (!*admin) {
         status = CELIX_ENOMEM;
     } else {
-        unsigned int port_counter = 0;
-        const char *port = NULL;
-        const char *ip = NULL;
-        char *detectedIp = NULL;
         (*admin)->context = context;
         (*admin)->exportedServices = hashMap_create(NULL, NULL, NULL, NULL);
          arrayList_create(&(*admin)->importedServices);
@@ -143,35 +131,22 @@ celix_status_t 
remoteServiceAdmin_create(bundle_context_pt context, remote_servi
             jsonRpc_logSetup((void *)remoteServiceAdmin_log, *admin, 1);
         }
 
-        bundleContext_getProperty(context, "RSA_PORT", &port);
-        if (port == NULL) {
-            port = (char *)DEFAULT_PORT;
-        }
-
-        bundleContext_getProperty(context, "RSA_IP", &ip);
-        if (ip == NULL) {
-            const char *interface = NULL;
-
-            bundleContext_getProperty(context, "RSA_INTERFACE", &interface);
-            if ((interface != NULL) && 
(remoteServiceAdmin_getIpAddress((char*)interface, &detectedIp) != 
CELIX_SUCCESS)) {
-                logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_WARNING, 
"RSA: Could not retrieve IP address for interface %s", interface);
-            }
-
-            if (ip == NULL) {
-                remoteServiceAdmin_getIpAddress(NULL, &detectedIp);
-            }
+        long port = celix_bundleContext_getPropertyAsLong(context, 
RSA_PORT_KEY, RSA_PORT_DEFAULT);
+        const char *ip = celix_bundleContext_getProperty(context, RSA_IP_KEY, 
RSA_IP_DEFAULT);
+        const char *interface = celix_bundleContext_getProperty(context, 
RSA_INTERFACE_KEY, NULL);
 
+        char *detectedIp = NULL;
+        if ((interface != NULL) && 
(remoteServiceAdmin_getIpAddress((char*)interface, &detectedIp) != 
CELIX_SUCCESS)) {
+            logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_WARNING, "RSA: 
Could not retrieve IP address for interface %s", interface);
+        }
+        if (detectedIp != NULL) {
             ip = detectedIp;
         }
 
         if (ip != NULL) {
-            logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_INFO, "RSA: 
Using %s for service annunciation", ip);
+            logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_DEBUG, "RSA: 
Using %s for service annunciation", ip);
             (*admin)->ip = strdup(ip);
         }
-        else {
-            logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_WARNING, "RSA: 
No IP address for service annunciation set. Using %s", DEFAULT_IP);
-            (*admin)->ip = strdup((char*) DEFAULT_IP);
-        }
 
         if (detectedIp != NULL) {
             free(detectedIp);
@@ -183,35 +158,38 @@ celix_status_t 
remoteServiceAdmin_create(bundle_context_pt context, remote_servi
         callbacks.begin_request = remoteServiceAdmin_callback;
 
         char newPort[10];
+        snprintf(newPort, 10, "%li", port);
 
+        unsigned int port_counter = 0;
         do {
 
-            const char *options[] = { "listening_ports", port, "num_threads", 
"5", NULL};
+            const char *options[] = { "listening_ports", newPort, 
"num_threads", "5", NULL};
 
             (*admin)->ctx = mg_start(&callbacks, (*admin), options);
 
             if ((*admin)->ctx != NULL) {
-                logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_INFO, "RSA: 
Start webserver: %s", port);
-                (*admin)->port = strdup(port);
+                logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_INFO, "RSA: 
Start webserver: %s", newPort);
+                (*admin)->port = strdup(newPort);
 
+            } else {
+                logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_ERROR, 
"Error while starting rsa server on port %s - retrying on port %li...", 
newPort, port + port_counter);
+                snprintf(newPort, 10,  "%li", port + port_counter++);
             }
-            else {
-               errno = 0;
-                char* endptr = (char*)port;
-                int currentPort = strtol(port, &endptr, 10);
-
-                if (*endptr || errno != 0) {
-                    currentPort = strtol(DEFAULT_PORT, NULL, 10);
-                }
+        } while (((*admin)->ctx == NULL) && (port_counter < 
MAX_NUMBER_OF_RESTARTS));
 
-                port_counter++;
-                snprintf(&newPort[0], 6,  "%d", (currentPort+1));
+    }
 
-                logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_ERROR, 
"Error while starting rsa server on port %s - retrying on port %s...", port, 
newPort);
-                port = newPort;
+    bool logCalls = celix_bundleContext_getPropertyAsBool(context, 
RSA_LOG_CALLS_KEY, RSA_LOG_CALLS_DEFAULT);
+    if (logCalls) {
+        const char *f = celix_bundleContext_getProperty(context, 
RSA_LOG_CALLS_FILE_KEY, RSA_LOG_CALLS_FILE_DEFAULT);
+        if (strncmp(f, "stdout", strlen("stdout")) == 0) {
+            (*admin)->logFile = stdout;
+        } else {
+            (*admin)->logFile = fopen(f, "w");
+            if ( (*admin)->logFile == NULL) {
+                logHelper_log((*admin)->loghelper, OSGI_LOGSERVICE_WARNING, 
"Error opening file '%s' for logging calls. %s", f, strerror(errno));
             }
-        } while(((*admin)->ctx == NULL) && (port_counter < 
MAX_NUMBER_OF_RESTARTS));
-
+        }
     }
 
     return status;
@@ -222,12 +200,14 @@ celix_status_t 
remoteServiceAdmin_destroy(remote_service_admin_pt *admin)
 {
     celix_status_t status = CELIX_SUCCESS;
 
+    if ( (*admin)->logFile != NULL && (*admin)->logFile != stdout) {
+        fclose((*admin)->logFile);
+    }
+
     free((*admin)->ip);
     free((*admin)->port);
     free(*admin);
 
-    //TODO destroy exports/imports
-
     *admin = NULL;
 
     return status;
@@ -424,7 +404,7 @@ celix_status_t 
remoteServiceAdmin_exportService(remote_service_admin_pt admin, c
 
         remoteServiceAdmin_createEndpointDescription(admin, reference, 
properties, (char*)interface, &endpoint);
         //TODO precheck if descriptor exists
-        status = exportRegistration_create(admin->loghelper, reference, 
endpoint, admin->context, &registration);
+        status = exportRegistration_create(admin->loghelper, reference, 
endpoint, admin->context, admin->logFile, &registration);
         if (status == CELIX_SUCCESS) {
             status = exportRegistration_start(registration);
             if (status == CELIX_SUCCESS) {
@@ -523,8 +503,8 @@ static celix_status_t 
remoteServiceAdmin_createEndpointDescription(remote_servic
     properties_set(endpointProperties, (char*) OSGI_RSA_ENDPOINT_SERVICE_ID, 
serviceId);
     properties_set(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID, 
endpoint_uuid);
     properties_set(endpointProperties, (char*) OSGI_RSA_SERVICE_IMPORTED, 
"true");
-    properties_set(endpointProperties, (char*) 
OSGI_RSA_SERVICE_IMPORTED_CONFIGS, (char*) CONFIGURATION_TYPE);
-    properties_set(endpointProperties, (char*) ENDPOINT_URL, url);
+    properties_set(endpointProperties, (char*) 
OSGI_RSA_SERVICE_IMPORTED_CONFIGS, (char*) RSA_DFI_CONFIGURATION_TYPE);
+    properties_set(endpointProperties, (char*) RSA_DFI_ENDPOINT_URL, url);
 
     if (props != NULL) {
         hash_map_iterator_pt propIter = hashMapIterator_create(props);
@@ -620,7 +600,7 @@ celix_status_t 
remoteServiceAdmin_importService(remote_service_admin_pt admin, e
     logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "Registering service 
factory (proxy) for service '%s'\n", objectClass);
 
     if (objectClass != NULL) {
-        status = importRegistration_create(admin->context, 
endpointDescription, objectClass, serviceVersion, &import);
+        status = importRegistration_create(admin->context, 
endpointDescription, objectClass, serviceVersion, admin->logFile, &import);
     }
     if (status == CELIX_SUCCESS && import != NULL) {
         importRegistration_setSendFn(import, (send_func_type) 
remoteServiceAdmin_send, admin);
@@ -675,7 +655,7 @@ static celix_status_t remoteServiceAdmin_send(void *handle, 
endpoint_description
     get.size = 0;
     get.writeptr = malloc(1);
 
-    char *serviceUrl = (char*)properties_get(endpointDescription->properties, 
(char*) ENDPOINT_URL);
+    char *serviceUrl = (char*)properties_get(endpointDescription->properties, 
(char*) RSA_DFI_ENDPOINT_URL);
     char url[256];
     snprintf(url, 256, "%s", serviceUrl);
 
diff --git 
a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.h
 
b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.h
index 8b282f1..dfadf8a 100644
--- 
a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.h
+++ 
b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.h
@@ -16,13 +16,7 @@
  *specific language governing permissions and limitations
  *under the License.
  */
-/*
- * remote_service_admin_http_impl.h
- *
- *  \date       Sep 30, 2011
- *  \author            <a href="mailto:[email protected]";>Apache Celix 
Project Team</a>
- *  \copyright Apache License, Version 2.0
- */
+
 
 #ifndef REMOTE_SERVICE_ADMIN_HTTP_IMPL_H_
 #define REMOTE_SERVICE_ADMIN_HTTP_IMPL_H_
@@ -31,7 +25,11 @@
 #include "bundle_context.h"
 #include "endpoint_description.h"
 
-//typedef struct remote_service_admin *remote_service_admin_pt;
+
+//forward declaration
+typedef struct remote_service_admin *remote_service_admin_pt;
+typedef struct export_registration *export_registration_pt;
+typedef struct export_reference *export_reference_pt;
 
 celix_status_t remoteServiceAdmin_create(bundle_context_pt context, 
remote_service_admin_pt *admin);
 celix_status_t remoteServiceAdmin_destroy(remote_service_admin_pt *admin);
diff --git 
a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi_constants.h
 
b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi_constants.h
new file mode 100644
index 0000000..763a8c5
--- /dev/null
+++ 
b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi_constants.h
@@ -0,0 +1,44 @@
+/**
+ *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 CELIX_REMOTE_SERVICE_ADMIN_DFI_CONSTANTS_H
+#define CELIX_REMOTE_SERVICE_ADMIN_DFI_CONSTANTS_H
+
+#define RSA_PORT_KEY                "RSA_PORT"
+#define RSA_PORT_DEFAULT                8888
+
+#define RSA_IP_KEY                      "RSA_IP"
+#define RSA_IP_DEFAULT                  "127.0.0.1"
+
+#define RSA_INTERFACE_KEY               "RSA_INTERFACE"
+
+#define RSA_LOG_CALLS_KEY               "RSA_LOG_CALLS"
+#define RSA_LOG_CALLS_DEFAULT           false
+#define RSA_LOG_CALLS_FILE_KEY          "RSA_LOG_CALLS_FILE"
+#define RSA_LOG_CALLS_FILE_DEFAULT      "stdout"
+
+
+
+
+#define RSA_DFI_CONFIGURATION_TYPE      "org.amdatu.remote.admin.http"
+#define RSA_DFI_ENDPOINT_URL            "org.amdatu.remote.admin.http.url"
+
+
+
+#endif //CELIX_REMOTE_SERVICE_ADMIN_DFI_CONSTANTS_H
diff --git a/bundles/remote_services/rsa_common/src/import_registration_impl.c 
b/bundles/remote_services/rsa_common/src/import_registration_impl.c
index 9a84327..eccd288 100644
--- a/bundles/remote_services/rsa_common/src/import_registration_impl.c
+++ b/bundles/remote_services/rsa_common/src/import_registration_impl.c
@@ -262,7 +262,6 @@ celix_status_t 
importRegistration_getImportReference(import_registration_pt regi
        return status;
 }
 
-
 celix_status_t importReference_getImportedEndpoint(import_reference_pt 
reference) {
        celix_status_t status = CELIX_SUCCESS;
        return status;
@@ -271,4 +270,4 @@ celix_status_t 
importReference_getImportedEndpoint(import_reference_pt reference
 celix_status_t importReference_getImportedService(import_reference_pt 
reference) {
        celix_status_t status = CELIX_SUCCESS;
        return status;
-}
+}
\ No newline at end of file
diff --git a/bundles/remote_services/rsa_spi/include/import_registration.h 
b/bundles/remote_services/rsa_spi/include/import_registration.h
index ef8193f..a03819c 100644
--- a/bundles/remote_services/rsa_spi/include/import_registration.h
+++ b/bundles/remote_services/rsa_spi/include/import_registration.h
@@ -19,4 +19,5 @@ celix_status_t 
importRegistration_getImportReference(import_registration_pt regi
 celix_status_t importReference_getImportedEndpoint(import_reference_pt 
reference);
 celix_status_t importReference_getImportedService(import_reference_pt 
reference);
 
+
 #endif //CELIX_IMPORT_REGISTRATION_H

Reply via email to