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 2013/10/15 10:40:45 UTC
svn commit: r1532245 - in /incubator/celix/trunk/remote_services: ./
calc_shell/ calc_shell/private/include/ calc_shell/private/src/
calculator_endpoint/ calculator_endpoint/private/
calculator_endpoint/private/include/ calculator_endpoint/private/src/...
Author: abroekhuis
Date: Tue Oct 15 08:40:44 2013
New Revision: 1532245
URL: http://svn.apache.org/r1532245
Log:
CELIX-89: Renamed RSA Example to Calculator
Added:
incubator/celix/trunk/remote_services/calculator_endpoint/
incubator/celix/trunk/remote_services/calculator_endpoint/CMakeLists.txt
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_endpoint/CMakeLists.txt
incubator/celix/trunk/remote_services/calculator_endpoint/private/
incubator/celix/trunk/remote_services/calculator_endpoint/private/include/
incubator/celix/trunk/remote_services/calculator_endpoint/private/include/calculator_endpoint_impl.h
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_endpoint/private/include/example_endpoint_impl.h
incubator/celix/trunk/remote_services/calculator_endpoint/private/src/
incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_activator.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_activator.c
incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_impl.c
incubator/celix/trunk/remote_services/calculator_proxy/
incubator/celix/trunk/remote_services/calculator_proxy/CMakeLists.txt
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_proxy/CMakeLists.txt
incubator/celix/trunk/remote_services/calculator_proxy/private/
incubator/celix/trunk/remote_services/calculator_proxy/private/include/
incubator/celix/trunk/remote_services/calculator_proxy/private/include/calculator_proxy_impl.h
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_proxy/private/include/example_proxy_impl.h
incubator/celix/trunk/remote_services/calculator_proxy/private/src/
incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_activator.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_activator.c
incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_impl.c
incubator/celix/trunk/remote_services/calculator_service/
incubator/celix/trunk/remote_services/calculator_service/CMakeLists.txt
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_service/CMakeLists.txt
incubator/celix/trunk/remote_services/calculator_service/private/
incubator/celix/trunk/remote_services/calculator_service/private/include/
incubator/celix/trunk/remote_services/calculator_service/private/include/calculator_impl.h
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_service/private/include/example_impl.h
incubator/celix/trunk/remote_services/calculator_service/private/src/
incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_activator.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_service/private/src/example_activator.c
incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_impl.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c
incubator/celix/trunk/remote_services/calculator_service/public/
incubator/celix/trunk/remote_services/calculator_service/public/include/
incubator/celix/trunk/remote_services/calculator_service/public/include/calculator_service.h
- copied, changed from r1530579, incubator/celix/trunk/remote_services/example_service/public/include/example_service.h
incubator/celix/trunk/remote_services/calculator_shell/
incubator/celix/trunk/remote_services/calculator_shell/CMakeLists.txt
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/CMakeLists.txt
incubator/celix/trunk/remote_services/calculator_shell/private/
incubator/celix/trunk/remote_services/calculator_shell/private/include/
incubator/celix/trunk/remote_services/calculator_shell/private/include/add_command.h
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/include/add_command.h
incubator/celix/trunk/remote_services/calculator_shell/private/include/sqrt_command.h
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/include/sqrt_command.h
incubator/celix/trunk/remote_services/calculator_shell/private/include/sub_command.h
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/include/sub_command.h
incubator/celix/trunk/remote_services/calculator_shell/private/src/
incubator/celix/trunk/remote_services/calculator_shell/private/src/add_command.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/add_command.c
incubator/celix/trunk/remote_services/calculator_shell/private/src/calculator_shell_activator.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/calc_shell_activator.c
incubator/celix/trunk/remote_services/calculator_shell/private/src/sqrt_command.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/sqrt_command.c
incubator/celix/trunk/remote_services/calculator_shell/private/src/sub_command.c
- copied, changed from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/sub_command.c
Removed:
incubator/celix/trunk/remote_services/calc_shell/CMakeLists.txt
incubator/celix/trunk/remote_services/calc_shell/private/include/add_command.h
incubator/celix/trunk/remote_services/calc_shell/private/include/sqrt_command.h
incubator/celix/trunk/remote_services/calc_shell/private/include/sub_command.h
incubator/celix/trunk/remote_services/calc_shell/private/src/add_command.c
incubator/celix/trunk/remote_services/calc_shell/private/src/calc_shell_activator.c
incubator/celix/trunk/remote_services/calc_shell/private/src/sqrt_command.c
incubator/celix/trunk/remote_services/calc_shell/private/src/sub_command.c
incubator/celix/trunk/remote_services/example_endpoint/CMakeLists.txt
incubator/celix/trunk/remote_services/example_endpoint/private/include/example_endpoint_impl.h
incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_activator.c
incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_impl.c
incubator/celix/trunk/remote_services/example_proxy/CMakeLists.txt
incubator/celix/trunk/remote_services/example_proxy/private/include/example_proxy_impl.h
incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_activator.c
incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_impl.c
incubator/celix/trunk/remote_services/example_service/CMakeLists.txt
incubator/celix/trunk/remote_services/example_service/private/include/example_impl.h
incubator/celix/trunk/remote_services/example_service/private/src/example_activator.c
incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c
incubator/celix/trunk/remote_services/example_service/public/include/example_service.h
Modified:
incubator/celix/trunk/remote_services/CMakeLists.txt
incubator/celix/trunk/remote_services/deploy.cmake
incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c
incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_endpoint.h
Modified: incubator/celix/trunk/remote_services/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/CMakeLists.txt?rev=1532245&r1=1532244&r2=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/CMakeLists.txt (original)
+++ incubator/celix/trunk/remote_services/CMakeLists.txt Tue Oct 15 08:40:44 2013
@@ -34,8 +34,8 @@ if (REMOTE_SERVICE_ADMIN)
add_subdirectory(discovery_slp)
add_subdirectory(discovery_bonjour)
- add_subdirectory(example_service)
- add_subdirectory(example_endpoint)
- add_subdirectory(example_proxy)
- add_subdirectory(calc_shell)
+ add_subdirectory(calculator_service)
+ add_subdirectory(calculator_endpoint)
+ add_subdirectory(calculator_proxy)
+ add_subdirectory(calculator_shell)
endif (REMOTE_SERVICE_ADMIN)
Copied: incubator/celix/trunk/remote_services/calculator_endpoint/CMakeLists.txt (from r1530579, incubator/celix/trunk/remote_services/example_endpoint/CMakeLists.txt)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_endpoint/CMakeLists.txt?p2=incubator/celix/trunk/remote_services/calculator_endpoint/CMakeLists.txt&p1=incubator/celix/trunk/remote_services/example_endpoint/CMakeLists.txt&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_endpoint/CMakeLists.txt (original)
+++ incubator/celix/trunk/remote_services/calculator_endpoint/CMakeLists.txt Tue Oct 15 08:40:44 2013
@@ -20,14 +20,14 @@ find_package(Jansson REQUIRED)
include_directories(${JANSSON_INCLUDE_DIRS})
include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
include_directories("${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_endpoint/private/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_service/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_endpoint/private/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_service/public/include")
-bundle(example_endpoint SOURCES
- private/src/example_endpoint_activator
- private/src/example_endpoint_impl.c
+bundle(calculator_endpoint SOURCES
+ private/src/calculator_endpoint_activator
+ private/src/calculator_endpoint_impl.c
- private/include/example_endpoint_impl.h
+ private/include/calculator_endpoint_impl.h
)
-target_link_libraries(example_endpoint celix_framework ${JANSSON_LIBRARIES})
+target_link_libraries(calculator_endpoint celix_framework ${JANSSON_LIBRARIES})
Copied: incubator/celix/trunk/remote_services/calculator_endpoint/private/include/calculator_endpoint_impl.h (from r1530579, incubator/celix/trunk/remote_services/example_endpoint/private/include/example_endpoint_impl.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_endpoint/private/include/calculator_endpoint_impl.h?p2=incubator/celix/trunk/remote_services/calculator_endpoint/private/include/calculator_endpoint_impl.h&p1=incubator/celix/trunk/remote_services/example_endpoint/private/include/example_endpoint_impl.h&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_endpoint/private/include/example_endpoint_impl.h (original)
+++ incubator/celix/trunk/remote_services/calculator_endpoint/private/include/calculator_endpoint_impl.h Tue Oct 15 08:40:44 2013
@@ -17,29 +17,29 @@
*under the License.
*/
/*
- * example_endpoint.h
+ * calculator_endpoint.h
*
* \date Oct 7, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
* \copyright Apache License, Version 2.0
*/
-#ifndef EXAMPLE_ENDPOINT_IMPL_H_
-#define EXAMPLE_ENDPOINT_IMPL_H_
+#ifndef CALCULATOR_ENDPOINT_IMPL_H_
+#define CALCULATOR_ENDPOINT_IMPL_H_
#include <apr_general.h>
#include "celix_errno.h"
#include "remote_endpoint_impl.h"
-celix_status_t exampleEndpoint_create(apr_pool_t *pool, remote_endpoint_pt *endpoint);
+celix_status_t calculatorEndpoint_create(apr_pool_t *pool, remote_endpoint_pt *endpoint);
-celix_status_t exampleEndpoint_setService(remote_endpoint_pt endpoint, void *service);
+celix_status_t calculatorEndpoint_setService(remote_endpoint_pt endpoint, void *service);
-celix_status_t exampleEndpoint_handleRequest(remote_endpoint_pt ep, char *request, char *data, char **reply);
+celix_status_t calculatorEndpoint_handleRequest(remote_endpoint_pt endpoint, char *request, char *data, char **reply);
-celix_status_t exampleEndpoint_add(remote_endpoint_pt ep, char *data, char **reply);
-celix_status_t exampleEndpoint_sub(remote_endpoint_pt ep, char *data, char **reply);
-celix_status_t exampleEndpoint_sqrt(remote_endpoint_pt ep, char *data, char **reply);
+celix_status_t calculatorEndpoint_add(remote_endpoint_pt endpoint, char *data, char **reply);
+celix_status_t calculatorEndpoint_sub(remote_endpoint_pt endpoint, char *data, char **reply);
+celix_status_t calculatorEndpoint_sqrt(remote_endpoint_pt endpoint, char *data, char **reply);
-#endif /* EXAMPLE_ENDPOINT_IMPL_H_ */
+#endif /* CALCULATOR_ENDPOINT_IMPL_H_ */
Copied: incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_activator.c (from r1530579, incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_activator.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_activator.c?p2=incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_activator.c&p1=incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_activator.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_activator.c (original)
+++ incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_activator.c Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * example_endpoint_activator.c
+ * calculator_endpoint_activator.c
*
* \date Oct 10, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
@@ -27,7 +27,7 @@
#include "bundle_activator.h"
-#include "example_endpoint_impl.h"
+#include "calculator_endpoint_impl.h"
#include "service_registration.h"
struct activator {
@@ -69,11 +69,11 @@ celix_status_t bundleActivator_start(voi
remote_endpoint_pt endpoint;
remote_endpoint_service_pt endpointService;
- exampleEndpoint_create(activator->pool, &endpoint);
+ calculatorEndpoint_create(activator->pool, &endpoint);
endpointService = apr_palloc(activator->pool, sizeof(*endpointService));
endpointService->endpoint = endpoint;
- endpointService->handleRequest = exampleEndpoint_handleRequest;
- endpointService->setService = exampleEndpoint_setService;
+ endpointService->handleRequest = calculatorEndpoint_handleRequest;
+ endpointService->setService = calculatorEndpoint_setService;
bundleContext_registerService(context, REMOTE_ENDPOINT, endpointService, NULL, &activator->endpoint);
Copied: incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c (from r1530579, incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_impl.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c?p2=incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c&p1=incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_impl.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_endpoint/private/src/example_endpoint_impl.c (original)
+++ incubator/celix/trunk/remote_services/calculator_endpoint/private/src/calculator_endpoint_impl.c Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * example_endpoint.c
+ * calculator_endpoint_impl.c
*
* \date Oct 7, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
@@ -27,11 +27,11 @@
#include "celix_errno.h"
-#include "example_endpoint_impl.h"
+#include "calculator_endpoint_impl.h"
-#include "example_service.h"
+#include "calculator_service.h"
-celix_status_t exampleEndpoint_create(apr_pool_t *pool, remote_endpoint_pt *endpoint) {
+celix_status_t calculatorEndpoint_create(apr_pool_t *pool, remote_endpoint_pt *endpoint) {
celix_status_t status = CELIX_SUCCESS;
*endpoint = apr_palloc(pool, sizeof(**endpoint));
if (!*endpoint) {
@@ -44,7 +44,7 @@ celix_status_t exampleEndpoint_create(ap
return status;
}
-celix_status_t exampleEndpoint_setService(remote_endpoint_pt endpoint, void *service) {
+celix_status_t calculatorEndpoint_setService(remote_endpoint_pt endpoint, void *service) {
celix_status_t status = CELIX_SUCCESS;
endpoint->service = service;
return status;
@@ -53,16 +53,16 @@ celix_status_t exampleEndpoint_setServic
/**
* Request: http://host:port/services/{service}/{request}
*/
-celix_status_t exampleEndpoint_handleRequest(remote_endpoint_pt ep, char *request, char *data, char **reply) {
+celix_status_t calculatorEndpoint_handleRequest(remote_endpoint_pt endpoint, char *request, char *data, char **reply) {
celix_status_t status = CELIX_SUCCESS;
- printf("EXAMPLE ENDPOINT: Handle request \"%s\" with data \"%s\"\n", request, data);
+ printf("CALCULATOR_ENDPOINT: Handle request \"%s\" with data \"%s\"\n", request, data);
if (strcmp(request, "add") == 0) {
- exampleEndpoint_add(ep, data, reply);
+ calculatorEndpoint_add(endpoint, data, reply);
} else if (strcmp(request, "sub") == 0) {
- exampleEndpoint_sub(ep, data, reply);
+ calculatorEndpoint_sub(endpoint, data, reply);
} else if (strcmp(request, "sqrt") == 0) {
- exampleEndpoint_sqrt(ep, data, reply);
+ calculatorEndpoint_sqrt(endpoint, data, reply);
} else {
status = CELIX_ILLEGAL_ARGUMENT;
}
@@ -74,7 +74,7 @@ celix_status_t exampleEndpoint_handleReq
* data = { "a" : 1.1, "b" : 2.4 }
* reply = 3.5
*/
-celix_status_t exampleEndpoint_add(remote_endpoint_pt ep, char *data, char **reply) {
+celix_status_t calculatorEndpoint_add(remote_endpoint_pt endpoint, char *data, char **reply) {
celix_status_t status = CELIX_SUCCESS;
json_error_t jsonError;
json_t *root;
@@ -87,17 +87,17 @@ celix_status_t exampleEndpoint_add(remot
double b;
json_unpack(root, "{s:f, s:f}", "arg0", &a, "arg1", &b);
- if (ep->service != NULL) {
+ if (endpoint->service != NULL) {
double result;
json_t *resultRoot;
- example_service_pt service = ep->service;
- service->add(service->example, a, b, &result);
+ calculator_service_pt service = endpoint->service;
+ service->add(service->calculator, a, b, &result);
resultRoot = json_pack("[f]", result);
char *c = json_dumps(resultRoot, JSON_ENCODE_ANY);
*reply = c;
} else {
- printf("EXAMPLE Endpoint: No service available");
+ printf("CALCULATOR_ENDPOINT: No service available");
status = CELIX_BUNDLE_EXCEPTION;
}
}
@@ -105,7 +105,7 @@ celix_status_t exampleEndpoint_add(remot
return status;
}
-celix_status_t exampleEndpoint_sub(remote_endpoint_pt ep, char *data, char **reply) {
+celix_status_t calculatorEndpoint_sub(remote_endpoint_pt endpoint, char *data, char **reply) {
celix_status_t status = CELIX_SUCCESS;
json_error_t jsonError;
json_t *root;
@@ -118,17 +118,17 @@ celix_status_t exampleEndpoint_sub(remot
double b;
json_unpack(root, "{s:f, s:f}", "arg0", &a, "arg1", &b);
- if (ep->service != NULL) {
+ if (endpoint->service != NULL) {
double result;
json_t *resultRoot;
- example_service_pt service = ep->service;
- service->sub(service->example, a, b, &result);
+ calculator_service_pt service = endpoint->service;
+ service->sub(service->calculator, a, b, &result);
resultRoot = json_pack("[f]", result);
char *c = json_dumps(resultRoot, JSON_ENCODE_ANY);
*reply = c;
} else {
- printf("EXAMPLE Endpoint: No service available");
+ printf("CALCULATOR_ENDPOINT: No service available");
status = CELIX_BUNDLE_EXCEPTION;
}
}
@@ -136,7 +136,7 @@ celix_status_t exampleEndpoint_sub(remot
return status;
}
-celix_status_t exampleEndpoint_sqrt(remote_endpoint_pt ep, char *data, char **reply) {
+celix_status_t calculatorEndpoint_sqrt(remote_endpoint_pt endpoint, char *data, char **reply) {
celix_status_t status = CELIX_SUCCESS;
json_error_t jsonError;
json_t *root;
@@ -148,17 +148,17 @@ celix_status_t exampleEndpoint_sqrt(remo
double a;
json_unpack(root, "{s:f}", "arg0", &a);
- if (ep->service != NULL) {
+ if (endpoint->service != NULL) {
double result;
json_t *resultRoot;
- example_service_pt service = ep->service;
- service->sqrt(service->example, a, &result);
+ calculator_service_pt service = endpoint->service;
+ service->sqrt(service->calculator, a, &result);
resultRoot = json_pack("[f]", result);
char *c = json_dumps(resultRoot, JSON_ENCODE_ANY);
*reply = c;
} else {
- printf("EXAMPLE Endpoint: No service available");
+ printf("CALCULATOR_ENDPOINT: No service available");
status = CELIX_BUNDLE_EXCEPTION;
}
}
Copied: incubator/celix/trunk/remote_services/calculator_proxy/CMakeLists.txt (from r1530579, incubator/celix/trunk/remote_services/example_proxy/CMakeLists.txt)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_proxy/CMakeLists.txt?p2=incubator/celix/trunk/remote_services/calculator_proxy/CMakeLists.txt&p1=incubator/celix/trunk/remote_services/example_proxy/CMakeLists.txt&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_proxy/CMakeLists.txt (original)
+++ incubator/celix/trunk/remote_services/calculator_proxy/CMakeLists.txt Tue Oct 15 08:40:44 2013
@@ -22,16 +22,15 @@ include_directories(${CURL_INCLUDE_DIRS}
include_directories(${JANSSON_INCLUDE_DIRS})
include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
include_directories("${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_endpoint/private/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_proxy/private/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_service/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_proxy/private/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_service/public/include")
include_directories("${PROJECT_SOURCE_DIR}/remote_services/endpoint_listener/public/include")
-bundle(example_proxy SOURCES
- private/src/example_proxy_activator
- private/src/example_proxy_impl.c
+bundle(calculator_proxy SOURCES
+ private/src/calculator_proxy_activator
+ private/src/calculator_proxy_impl.c
- private/include/example_proxy_impl.h
+ private/include/calculator_proxy_impl.h
)
-target_link_libraries(example_proxy celix_framework ${JANSSON_LIBRARIES} ${CURL_LIBRARIES})
+target_link_libraries(calculator_proxy celix_framework ${JANSSON_LIBRARIES} ${CURL_LIBRARIES})
Copied: incubator/celix/trunk/remote_services/calculator_proxy/private/include/calculator_proxy_impl.h (from r1530579, incubator/celix/trunk/remote_services/example_proxy/private/include/example_proxy_impl.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_proxy/private/include/calculator_proxy_impl.h?p2=incubator/celix/trunk/remote_services/calculator_proxy/private/include/calculator_proxy_impl.h&p1=incubator/celix/trunk/remote_services/example_proxy/private/include/example_proxy_impl.h&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_proxy/private/include/example_proxy_impl.h (original)
+++ incubator/celix/trunk/remote_services/calculator_proxy/private/include/calculator_proxy_impl.h Tue Oct 15 08:40:44 2013
@@ -17,35 +17,35 @@
*under the License.
*/
/*
- * example_proxy_impl.h
+ * calculator_proxy_impl.h
*
* \date Oct 13, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
* \copyright Apache License, Version 2.0
*/
-#ifndef EXAMPLE_PROXY_IMPL_H_
-#define EXAMPLE_PROXY_IMPL_H_
+#ifndef CALCULATOR_PROXY_IMPL_H_
+#define CALCULATOR_PROXY_IMPL_H_
#include <apr_general.h>
#include "celix_errno.h"
-#include "example_service.h"
+#include "calculator_service.h"
#include "remote_proxy.h"
#include "endpoint_listener.h"
-struct example {
+struct calculator {
apr_pool_t *pool;
endpoint_description_pt endpoint;
};
-celix_status_t exampleProxy_create(apr_pool_t *pool, example_pt *example);
-celix_status_t exampleProxy_add(example_pt example, double a, double b, double *result);
-celix_status_t exampleProxy_sub(example_pt example, double a, double b, double *result);
-celix_status_t exampleProxy_sqrt(example_pt example, double a, double *result);
+celix_status_t calculatorProxy_create(apr_pool_t *pool, calculator_pt *calculator);
+celix_status_t calculatorProxy_add(calculator_pt calculator, double a, double b, double *result);
+celix_status_t calculatorProxy_sub(calculator_pt calculator, double a, double b, double *result);
+celix_status_t calculatorProxy_sqrt(calculator_pt calculator, double a, double *result);
-celix_status_t exampleProxy_setEndpointDescription(void *proxy, endpoint_description_pt endpoint);
+celix_status_t calculatorProxy_setEndpointDescription(void *proxy, endpoint_description_pt endpoint);
-#endif /* EXAMPLE_PROXY_IMPL_H_ */
+#endif /* CALCULATOR_PROXY_IMPL_H_ */
Copied: incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_activator.c (from r1530579, incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_activator.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_activator.c?p2=incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_activator.c&p1=incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_activator.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_activator.c (original)
+++ incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_activator.c Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * example_endpoint_activator.c
+ * calculator_proxy_activator.c
*
* \date Oct 10, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
@@ -27,7 +27,7 @@
#include "bundle_activator.h"
-#include "example_proxy_impl.h"
+#include "calculator_proxy_impl.h"
#include "service_registration.h"
@@ -69,29 +69,29 @@ celix_status_t bundleActivator_create(bu
celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) {
celix_status_t status = CELIX_SUCCESS;
struct activator *activator = userData;
- example_pt example;
- example_service_pt exampleService;
- remote_proxy_service_pt exampleProxy;
-
- exampleProxy_create(activator->pool, &example);
- exampleService = apr_palloc(activator->pool, sizeof(*exampleService));
- exampleService->example = example;
- exampleService->add = exampleProxy_add;
- exampleService->sub = exampleProxy_sub;
- exampleService->sqrt = exampleProxy_sqrt;
- exampleProxy = apr_palloc(activator->pool, sizeof(*exampleProxy));
- exampleProxy->proxy = example;
- exampleProxy->setEndpointDescription = exampleProxy_setEndpointDescription;
+ calculator_pt calculator;
+ calculator_service_pt calculatorService;
+ remote_proxy_service_pt calculatorProxy;
+
+ calculatorProxy_create(activator->pool, &calculator);
+ calculatorService = apr_palloc(activator->pool, sizeof(*calculatorService));
+ calculatorService->calculator = calculator;
+ calculatorService->add = calculatorProxy_add;
+ calculatorService->sub = calculatorProxy_sub;
+ calculatorService->sqrt = calculatorProxy_sqrt;
+ calculatorProxy = apr_palloc(activator->pool, sizeof(*calculatorProxy));
+ calculatorProxy->proxy = calculator;
+ calculatorProxy->setEndpointDescription = calculatorProxy_setEndpointDescription;
char **services = malloc(2);
- services[0] = EXAMPLE_SERVICE;
+ services[0] = CALCULATOR_SERVICE;
services[1] = REMOTE_PROXY;
- bundleContext_registerService(context, EXAMPLE_SERVICE, exampleService, NULL, &activator->service);
+ bundleContext_registerService(context, CALCULATOR_SERVICE, calculatorService, NULL, &activator->service);
properties_pt props = properties_create();
- properties_set(props, (char *) "proxy.interface", (char *) EXAMPLE_SERVICE);
- bundleContext_registerService(context, REMOTE_PROXY, exampleProxy, props, &activator->proxy);
+ properties_set(props, (char *) "proxy.interface", (char *) CALCULATOR_SERVICE);
+ bundleContext_registerService(context, REMOTE_PROXY, calculatorProxy, props, &activator->proxy);
return status;
}
Copied: incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c (from r1530579, incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_impl.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c?p2=incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c&p1=incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_impl.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_proxy/private/src/example_proxy_impl.c (original)
+++ incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * example_endpoint.c
+ * calculator_proxy_impl.c
*
* \date Oct 7, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
@@ -34,7 +34,7 @@
#include "celix_errno.h"
-#include "example_proxy_impl.h"
+#include "calculator_proxy_impl.h"
struct post {
const char *readptr;
@@ -46,11 +46,11 @@ struct get {
int size;
};
-celix_status_t exampleProxy_postRequest(example_pt example, char *url, struct post post, struct get *get);
+celix_status_t calculatorProxy_postRequest(calculator_pt calculator, char *url, struct post post, struct get *get);
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp);
-static size_t exampleProxy_write(void *contents, size_t size, size_t nmemb, void *userp);
+static size_t calculatorProxy_write(void *contents, size_t size, size_t nmemb, void *userp);
-celix_status_t exampleProxy_create(apr_pool_t *pool, example_pt *endpoint) {
+celix_status_t calculatorProxy_create(apr_pool_t *pool, calculator_pt *endpoint) {
celix_status_t status = CELIX_SUCCESS;
*endpoint = apr_palloc(pool, sizeof(**endpoint));
if (!*endpoint) {
@@ -63,13 +63,13 @@ celix_status_t exampleProxy_create(apr_p
return status;
}
-celix_status_t exampleProxy_add(example_pt example, double a, double b, double *result) {
+celix_status_t calculatorProxy_add(calculator_pt calculator, double a, double b, double *result) {
celix_status_t status = CELIX_SUCCESS;
- if (example->endpoint != NULL) {
- char *serviceUrl = properties_get(example->endpoint->properties, ".ars.alias");
+ if (calculator->endpoint != NULL) {
+ char *serviceUrl = properties_get(calculator->endpoint->properties, ".ars.alias");
printf("CALCULATOR_PROXY: URL: %s\n", serviceUrl);
- char *url = apr_pstrcat(example->pool, serviceUrl, "/add", NULL);
+ char *url = apr_pstrcat(calculator->pool, serviceUrl, "/add", NULL);
json_t *root;
root = json_pack("{s:f, s:f}", "arg0", a, "arg1", b);
@@ -83,7 +83,7 @@ celix_status_t exampleProxy_add(example_
get.size = 0;
get.writeptr = malloc(1);
- status = exampleProxy_postRequest(example, url, post, &get);
+ status = calculatorProxy_postRequest(calculator, url, post, &get);
if (status == CELIX_SUCCESS) {
json_error_t jsonError;
json_t *reply = json_loads(get.writeptr, 0, &jsonError);
@@ -96,11 +96,11 @@ celix_status_t exampleProxy_add(example_
return status;
}
-celix_status_t exampleProxy_sub(example_pt example, double a, double b, double *result) {
+celix_status_t calculatorProxy_sub(calculator_pt calculator, double a, double b, double *result) {
celix_status_t status = CELIX_SUCCESS;
- if (example->endpoint != NULL) {
- printf("CALCULATOR_PROXY: URL: %s\n", example->endpoint->id);
- char *url = apr_pstrcat(example->pool, example->endpoint->id, "/sub", NULL);
+ if (calculator->endpoint != NULL) {
+ printf("CALCULATOR_PROXY: URL: %s\n", calculator->endpoint->id);
+ char *url = apr_pstrcat(calculator->pool, calculator->endpoint->id, "/sub", NULL);
json_t *root;
root = json_pack("{s:f, s:f}", "arg0", a, "arg1", b);
@@ -114,7 +114,7 @@ celix_status_t exampleProxy_sub(example_
get.size = 0;
get.writeptr = malloc(1);
- status = exampleProxy_postRequest(example, url, post, &get);
+ status = calculatorProxy_postRequest(calculator, url, post, &get);
if (status == CELIX_SUCCESS) {
json_error_t jsonError;
json_t *reply = json_loads(get.writeptr, 0, &jsonError);
@@ -127,11 +127,11 @@ celix_status_t exampleProxy_sub(example_
return status;
}
-celix_status_t exampleProxy_sqrt(example_pt example, double a, double *result) {
+celix_status_t calculatorProxy_sqrt(calculator_pt calculator, double a, double *result) {
celix_status_t status = CELIX_SUCCESS;
- if (example->endpoint != NULL) {
- printf("CALCULATOR_PROXY: URL: %s\n", example->endpoint->id);
- char *url = apr_pstrcat(example->pool, example->endpoint->id, "/sqrt", NULL);
+ if (calculator->endpoint != NULL) {
+ printf("CALCULATOR_PROXY: URL: %s\n", calculator->endpoint->id);
+ char *url = apr_pstrcat(calculator->pool, calculator->endpoint->id, "/sqrt", NULL);
json_t *root;
root = json_pack("{s:f}", "arg0", a);
@@ -145,7 +145,7 @@ celix_status_t exampleProxy_sqrt(example
get.size = 0;
get.writeptr = malloc(1);
- status = exampleProxy_postRequest(example, url, post, &get);
+ status = calculatorProxy_postRequest(calculator, url, post, &get);
if (status == CELIX_SUCCESS) {
json_error_t jsonError;
json_t *reply = json_loads(get.writeptr, 0, &jsonError);
@@ -158,7 +158,7 @@ celix_status_t exampleProxy_sqrt(example
return status;
}
-celix_status_t exampleProxy_postRequest(example_pt example, char *url, struct post post, struct get *get) {
+celix_status_t calculatorProxy_postRequest(calculator_pt calculator, char *url, struct post post, struct get *get) {
celix_status_t status = CELIX_SUCCESS;
CURL *curl;
CURLcode res;
@@ -171,7 +171,7 @@ celix_status_t exampleProxy_postRequest(
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
curl_easy_setopt(curl, CURLOPT_READDATA, &post);
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, exampleProxy_write);
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, calculatorProxy_write);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)get);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (curl_off_t)post.size);
res = curl_easy_perform(curl);
@@ -196,7 +196,7 @@ static size_t read_callback(void *ptr, s
return 0;
}
-static size_t exampleProxy_write(void *contents, size_t size, size_t nmemb, void *userp) {
+static size_t calculatorProxy_write(void *contents, size_t size, size_t nmemb, void *userp) {
size_t realsize = size * nmemb;
struct get *mem = (struct get *)userp;
@@ -214,11 +214,11 @@ static size_t exampleProxy_write(void *c
return realsize;
}
-celix_status_t exampleProxy_setEndpointDescription(void *proxy, endpoint_description_pt endpoint) {
+celix_status_t calculatorProxy_setEndpointDescription(void *proxy, endpoint_description_pt endpoint) {
celix_status_t status = CELIX_SUCCESS;
- example_pt example = proxy;
- example->endpoint = endpoint;
+ calculator_pt calculator = proxy;
+ calculator->endpoint = endpoint;
return status;
}
Copied: incubator/celix/trunk/remote_services/calculator_service/CMakeLists.txt (from r1530579, incubator/celix/trunk/remote_services/example_service/CMakeLists.txt)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_service/CMakeLists.txt?p2=incubator/celix/trunk/remote_services/calculator_service/CMakeLists.txt&p1=incubator/celix/trunk/remote_services/example_service/CMakeLists.txt&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_service/CMakeLists.txt (original)
+++ incubator/celix/trunk/remote_services/calculator_service/CMakeLists.txt Tue Oct 15 08:40:44 2013
@@ -18,14 +18,14 @@
include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
include_directories("${PROJECT_SOURCE_DIR}/remote_services/utils/public/include")
include_directories("${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_service/private/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_service/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_service/private/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_service/public/include")
-bundle(example SOURCES
- private/src/example_impl
- private/src/example_activator
+bundle(calculator SOURCES
+ private/src/calculator_impl
+ private/src/calculator_activator
- private/include/example_impl.h
+ private/include/calculator_impl.h
)
-target_link_libraries(example celix_framework)
+target_link_libraries(calculator celix_framework)
Copied: incubator/celix/trunk/remote_services/calculator_service/private/include/calculator_impl.h (from r1530579, incubator/celix/trunk/remote_services/example_service/private/include/example_impl.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_service/private/include/calculator_impl.h?p2=incubator/celix/trunk/remote_services/calculator_service/private/include/calculator_impl.h&p1=incubator/celix/trunk/remote_services/example_service/private/include/example_impl.h&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_service/private/include/example_impl.h (original)
+++ incubator/celix/trunk/remote_services/calculator_service/private/include/calculator_impl.h Tue Oct 15 08:40:44 2013
@@ -17,29 +17,29 @@
*under the License.
*/
/*
- * example_impl.h
+ * calculator_impl.h
*
* \date Oct 5, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
* \copyright Apache License, Version 2.0
*/
-#ifndef EXAMPLE_IMPL_H_
-#define EXAMPLE_IMPL_H_
+#ifndef CALCULATOR_IMPL_H_
+#define CALCULATOR_IMPL_H_
#include <apr_general.h>
#include "celix_errno.h"
-#include "example_service.h"
+#include "calculator_service.h"
-struct example {
+struct calculator {
apr_pool_t *pool;
};
-celix_status_t example_create(apr_pool_t *pool, example_pt *example);
-celix_status_t example_add(example_pt example, double a, double b, double *result);
-celix_status_t example_sub(example_pt example, double a, double b, double *result);
-celix_status_t example_sqrt(example_pt example, double a, double *result);
+celix_status_t calculator_create(apr_pool_t *pool, calculator_pt *calcuator);
+celix_status_t calculator_add(calculator_pt calcuator, double a, double b, double *result);
+celix_status_t calculator_sub(calculator_pt calcuator, double a, double b, double *result);
+celix_status_t calculator_sqrt(calculator_pt calcuator, double a, double *result);
-#endif /* EXAMPLE_IMPL_H_ */
+#endif /* CALCULATOR_IMPL_H_ */
Copied: incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_activator.c (from r1530579, incubator/celix/trunk/remote_services/example_service/private/src/example_activator.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_activator.c?p2=incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_activator.c&p1=incubator/celix/trunk/remote_services/example_service/private/src/example_activator.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_service/private/src/example_activator.c (original)
+++ incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_activator.c Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * example_activator.c
+ * calculator_activator.c
*
* \date Oct 5, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
@@ -29,12 +29,12 @@
#include "bundle_context.h"
#include "service_registration.h"
-#include "example_impl.h"
+#include "calculator_impl.h"
#include "remote_constants.h"
struct activator {
apr_pool_t *pool;
- service_registration_pt exampleReg;
+ service_registration_pt calculatorReg;
};
celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
@@ -50,7 +50,7 @@ celix_status_t bundleActivator_create(bu
} else {
activator = apr_palloc(pool, sizeof(*activator));
activator->pool = pool;
- activator->exampleReg = NULL;
+ activator->calculatorReg = NULL;
*userData = activator;
}
@@ -62,25 +62,25 @@ celix_status_t bundleActivator_create(bu
celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) {
celix_status_t status = CELIX_SUCCESS;
struct activator *activator = userData;
- example_pt example = NULL;
- example_service_pt service = NULL;
+ calculator_pt calculator = NULL;
+ calculator_service_pt service = NULL;
properties_pt properties = NULL;
- status = example_create(activator->pool, &example);
+ status = calculator_create(activator->pool, &calculator);
if (status == CELIX_SUCCESS) {
service = apr_palloc(activator->pool, sizeof(*service));
if (!service) {
status = CELIX_ENOMEM;
} else {
- service->example = example;
- service->add = example_add;
- service->sub = example_sub;
- service->sqrt = example_sqrt;
+ service->calculator = calculator;
+ service->add = calculator_add;
+ service->sub = calculator_sub;
+ service->sqrt = calculator_sqrt;
properties = properties_create();
- properties_set(properties, (char *) SERVICE_EXPORTED_INTERFACES, (char *) EXAMPLE_SERVICE);
+ properties_set(properties, (char *) SERVICE_EXPORTED_INTERFACES, (char *) CALCULATOR_SERVICE);
- bundleContext_registerService(context, (char *) EXAMPLE_SERVICE, service, properties, &activator->exampleReg);
+ bundleContext_registerService(context, (char *) CALCULATOR_SERVICE, service, properties, &activator->calculatorReg);
}
}
@@ -91,7 +91,7 @@ celix_status_t bundleActivator_stop(void
celix_status_t status = CELIX_SUCCESS;
struct activator *activator = userData;
- serviceRegistration_unregister(activator->exampleReg);
+ serviceRegistration_unregister(activator->calculatorReg);
return status;
}
Copied: incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_impl.c (from r1530579, incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_impl.c?p2=incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_impl.c&p1=incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_service/private/src/example_impl.c (original)
+++ incubator/celix/trunk/remote_services/calculator_service/private/src/calculator_impl.c Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * example_impl.c
+ * calculator_impl.c
*
* \date Oct 5, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
@@ -27,22 +27,22 @@
#include <stdio.h>
-#include "example_impl.h"
+#include "calculator_impl.h"
-celix_status_t example_create(apr_pool_t *pool, example_pt *example) {
+celix_status_t calculator_create(apr_pool_t *pool, calculator_pt *calculator) {
celix_status_t status = CELIX_SUCCESS;
- *example = apr_palloc(pool, sizeof(**example));
- if (!*example) {
+ *calculator = apr_palloc(pool, sizeof(**calculator));
+ if (!*calculator) {
status = CELIX_ENOMEM;
} else {
- (*example)->pool = pool;
+ (*calculator)->pool = pool;
}
return status;
}
-celix_status_t example_add(example_pt example, double a, double b, double *result) {
+celix_status_t calculator_add(calculator_pt calculator, double a, double b, double *result) {
celix_status_t status = CELIX_SUCCESS;
*result = a + b;
@@ -51,7 +51,7 @@ celix_status_t example_add(example_pt ex
return status;
}
-celix_status_t example_sub(example_pt example, double a, double b, double *result) {
+celix_status_t calculator_sub(calculator_pt calculator, double a, double b, double *result) {
celix_status_t status = CELIX_SUCCESS;
*result = a - b;
@@ -60,7 +60,7 @@ celix_status_t example_sub(example_pt ex
return status;
}
-celix_status_t example_sqrt(example_pt example, double a, double *result) {
+celix_status_t calculator_sqrt(calculator_pt calculator, double a, double *result) {
celix_status_t status = CELIX_SUCCESS;
if (a > 0) {
Copied: incubator/celix/trunk/remote_services/calculator_service/public/include/calculator_service.h (from r1530579, incubator/celix/trunk/remote_services/example_service/public/include/example_service.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_service/public/include/calculator_service.h?p2=incubator/celix/trunk/remote_services/calculator_service/public/include/calculator_service.h&p1=incubator/celix/trunk/remote_services/example_service/public/include/example_service.h&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/example_service/public/include/example_service.h (original)
+++ incubator/celix/trunk/remote_services/calculator_service/public/include/calculator_service.h Tue Oct 15 08:40:44 2013
@@ -17,36 +17,36 @@
*under the License.
*/
/*
- * example_service.h
+ * calculator_service.h
*
* \date Oct 5, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
* \copyright Apache License, Version 2.0
*/
-#ifndef EXAMPLE_SERVICE_H_
-#define EXAMPLE_SERVICE_H_
+#ifndef CALCULATOR_SERVICE_H_
+#define CALCULATOR_SERVICE_H_
-#define EXAMPLE_SERVICE "org.example.api.Calculator"
+#define CALCULATOR_SERVICE "org.example.api.Calculator"
-typedef struct example *example_pt;
+typedef struct calculator *calculator_pt;
-typedef struct example_service *example_service_pt;
+typedef struct calculator_service *calculator_service_pt;
-struct example_service {
- example_pt example;
- celix_status_t (*add)(example_pt example, double a, double b, double *result);
- celix_status_t (*sub)(example_pt example, double a, double b, double *result);
- celix_status_t (*sqrt)(example_pt example, double a, double *result);
+struct calculator_service {
+ calculator_pt calculator;
+ celix_status_t (*add)(calculator_pt calculator, double a, double b, double *result);
+ celix_status_t (*sub)(calculator_pt calculator, double a, double b, double *result);
+ celix_status_t (*sqrt)(calculator_pt calculator, double a, double *result);
};
/*
- * interface example_service {
+ * interface calculator_service {
* double add(double a, double b);
* double sub(double a, double b);
* double sqrt(double a);
* }
*/
-#endif /* EXAMPLE_SERVICE_H_ */
+#endif /* CALCULATOR_SERVICE_H_ */
Copied: incubator/celix/trunk/remote_services/calculator_shell/CMakeLists.txt (from r1530579, incubator/celix/trunk/remote_services/calc_shell/CMakeLists.txt)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/CMakeLists.txt?p2=incubator/celix/trunk/remote_services/calculator_shell/CMakeLists.txt&p1=incubator/celix/trunk/remote_services/calc_shell/CMakeLists.txt&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/calc_shell/CMakeLists.txt (original)
+++ incubator/celix/trunk/remote_services/calculator_shell/CMakeLists.txt Tue Oct 15 08:40:44 2013
@@ -15,11 +15,11 @@
# specific language governing permissions and limitations
# under the License.
-bundle(calc_shell SOURCES
+bundle(calculator_shell SOURCES
private/src/add_command
private/src/sub_command
private/src/sqrt_command
- private/src/calc_shell_activator
+ private/src/calculator_shell_activator
private/include/add_command.h
private/include/sqrt_command.h
@@ -27,9 +27,9 @@ bundle(calc_shell SOURCES
${PROJECT_SOURCE_DIR}/shell/public/src/command.c
)
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/calc_shell/private/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_shell/private/include")
include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-include_directories("${PROJECT_SOURCE_DIR}/remote_services/example_service/public/include")
+include_directories("${PROJECT_SOURCE_DIR}/remote_services/calculator_service/public/include")
include_directories("${PROJECT_SOURCE_DIR}/shell/public/include")
-target_link_libraries(calc_shell celix_framework)
+target_link_libraries(calculator_shell celix_framework)
Copied: incubator/celix/trunk/remote_services/calculator_shell/private/include/add_command.h (from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/include/add_command.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/private/include/add_command.h?p2=incubator/celix/trunk/remote_services/calculator_shell/private/include/add_command.h&p1=incubator/celix/trunk/remote_services/calc_shell/private/include/add_command.h&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/remote_services/calculator_shell/private/include/sqrt_command.h (from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/include/sqrt_command.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/private/include/sqrt_command.h?p2=incubator/celix/trunk/remote_services/calculator_shell/private/include/sqrt_command.h&p1=incubator/celix/trunk/remote_services/calc_shell/private/include/sqrt_command.h&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/remote_services/calculator_shell/private/include/sub_command.h (from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/include/sub_command.h)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/private/include/sub_command.h?p2=incubator/celix/trunk/remote_services/calculator_shell/private/include/sub_command.h&p1=incubator/celix/trunk/remote_services/calc_shell/private/include/sub_command.h&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
(empty)
Copied: incubator/celix/trunk/remote_services/calculator_shell/private/src/add_command.c (from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/add_command.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/private/src/add_command.c?p2=incubator/celix/trunk/remote_services/calculator_shell/private/src/add_command.c&p1=incubator/celix/trunk/remote_services/calc_shell/private/src/add_command.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/calc_shell/private/src/add_command.c (original)
+++ incubator/celix/trunk/remote_services/calculator_shell/private/src/add_command.c Tue Oct 15 08:40:44 2013
@@ -32,7 +32,7 @@
#include "array_list.h"
#include "bundle_context.h"
#include "add_command.h"
-#include "example_service.h"
+#include "calculator_service.h"
void addCommand_execute(command_pt command, char * line, void (*out)(char *), void (*err)(char *));
@@ -58,9 +58,9 @@ void addCommand_destroy(command_pt comma
void addCommand_execute(command_pt command, char *line, void (*out)(char *), void (*err)(char *)) {
celix_status_t status = CELIX_SUCCESS;
- service_reference_pt exampleService = NULL;
+ service_reference_pt calculatorService = NULL;
- status = bundleContext_getServiceReference(command->bundleContext, (char *) EXAMPLE_SERVICE, &exampleService);
+ status = bundleContext_getServiceReference(command->bundleContext, (char *) CALCULATOR_SERVICE, &calculatorService);
if (status == CELIX_SUCCESS) {
char *token;
char *commandStr = apr_strtok(line, " ", &token);
@@ -71,13 +71,13 @@ void addCommand_execute(command_pt comma
char *bStr = apr_strtok(NULL, " ", &token);
addCommand_isNumeric(command, bStr, &numeric);
if (bStr != NULL && numeric) {
- example_service_pt example = NULL;
- status = bundleContext_getService(command->bundleContext, exampleService, (void *) &example);
+ calculator_service_pt calculator = NULL;
+ status = bundleContext_getService(command->bundleContext, calculatorService, (void *) &calculator);
if (status == CELIX_SUCCESS) {
double a = atof(aStr);
double b = atof(bStr);
double result = 0;
- status = example->add(example->example, a, b, &result);
+ status = calculator->add(calculator->calculator, a, b, &result);
if (status == CELIX_SUCCESS) {
char line[256];
sprintf(line, "CALCULATOR_SHELL: Add: %f + %f = %f\n", a, b, result);
Copied: incubator/celix/trunk/remote_services/calculator_shell/private/src/calculator_shell_activator.c (from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/calc_shell_activator.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/private/src/calculator_shell_activator.c?p2=incubator/celix/trunk/remote_services/calculator_shell/private/src/calculator_shell_activator.c&p1=incubator/celix/trunk/remote_services/calc_shell/private/src/calc_shell_activator.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/calc_shell/private/src/calc_shell_activator.c (original)
+++ incubator/celix/trunk/remote_services/calculator_shell/private/src/calculator_shell_activator.c Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * calc_shell_activator.c
+ * calculator_shell_activator.c
*
* \date Oct 13, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
@@ -49,7 +49,7 @@ struct activator {
command_service_pt sqrtCmdSrv;
};
-static celix_status_t calcShell_createCommandService(apr_pool_t *pool, command_pt command, command_service_pt *commandService);
+static celix_status_t calculatorShell_createCommandService(apr_pool_t *pool, command_pt command, command_service_pt *commandService);
celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
celix_status_t status = CELIX_SUCCESS;
@@ -86,21 +86,21 @@ celix_status_t bundleActivator_start(voi
bundleContext_getMemoryPool(context, &pool);
activator->addCmd = addCommand_create(context);
- calcShell_createCommandService(pool, activator->addCmd, &activator->addCmdSrv);
+ calculatorShell_createCommandService(pool, activator->addCmd, &activator->addCmdSrv);
bundleContext_registerService(context, (char *) COMMAND_SERVICE_NAME, activator->addCmdSrv, NULL, &activator->addCommand);
activator->subCmd = subCommand_create(context);
- calcShell_createCommandService(pool, activator->subCmd, &activator->subCmdSrv);
+ calculatorShell_createCommandService(pool, activator->subCmd, &activator->subCmdSrv);
bundleContext_registerService(context, (char *) COMMAND_SERVICE_NAME, activator->subCmdSrv, NULL, &activator->subCommand);
activator->sqrtCmd = sqrtCommand_create(context);
- calcShell_createCommandService(pool, activator->sqrtCmd, &activator->sqrtCmdSrv);
+ calculatorShell_createCommandService(pool, activator->sqrtCmd, &activator->sqrtCmdSrv);
bundleContext_registerService(context, (char *) COMMAND_SERVICE_NAME, activator->sqrtCmdSrv, NULL, &activator->sqrtCommand);
return status;
}
-static celix_status_t calcShell_createCommandService(apr_pool_t *pool, command_pt command, command_service_pt *commandService) {
+static celix_status_t calculatorShell_createCommandService(apr_pool_t *pool, command_pt command, command_service_pt *commandService) {
*commandService = apr_palloc(pool, sizeof(**commandService));
(*commandService)->command = command;
(*commandService)->executeCommand = command->executeCommand;
Copied: incubator/celix/trunk/remote_services/calculator_shell/private/src/sqrt_command.c (from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/sqrt_command.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/private/src/sqrt_command.c?p2=incubator/celix/trunk/remote_services/calculator_shell/private/src/sqrt_command.c&p1=incubator/celix/trunk/remote_services/calc_shell/private/src/sqrt_command.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/calc_shell/private/src/sqrt_command.c (original)
+++ incubator/celix/trunk/remote_services/calculator_shell/private/src/sqrt_command.c Tue Oct 15 08:40:44 2013
@@ -32,7 +32,7 @@
#include "array_list.h"
#include "bundle_context.h"
#include "sqrt_command.h"
-#include "example_service.h"
+#include "calculator_service.h"
void sqrtCommand_execute(command_pt command, char * line, void (*out)(char *), void (*err)(char *));
@@ -58,11 +58,11 @@ void sqrtCommand_destroy(command_pt comm
void sqrtCommand_execute(command_pt command, char *line, void (*out)(char *), void (*err)(char *)) {
celix_status_t status = CELIX_SUCCESS;
- service_reference_pt exampleService = NULL;
+ service_reference_pt calculatorService = NULL;
apr_pool_t *memory_pool = NULL;
apr_pool_t *bundle_memory_pool = NULL;
- status = bundleContext_getServiceReference(command->bundleContext, (char *) EXAMPLE_SERVICE, &exampleService);
+ status = bundleContext_getServiceReference(command->bundleContext, (char *) CALCULATOR_SERVICE, &calculatorService);
if (status == CELIX_SUCCESS) {
char *token;
char *commandStr = apr_strtok(line, " ", &token);
@@ -70,12 +70,12 @@ void sqrtCommand_execute(command_pt comm
bool numeric;
sqrtCommand_isNumeric(command, aStr, &numeric);
if (aStr != NULL && numeric) {
- example_service_pt example = NULL;
- status = bundleContext_getService(command->bundleContext, exampleService, (void *) &example);
+ calculator_service_pt calculator = NULL;
+ status = bundleContext_getService(command->bundleContext, calculatorService, (void *) &calculator);
if (status == CELIX_SUCCESS) {
double a = atof(aStr);
double result = 0;
- status = example->sqrt(example->example, a, &result);
+ status = calculator->sqrt(calculator->calculator, a, &result);
if (status == CELIX_SUCCESS) {
char line[256];
sprintf(line, "CALCULATOR_SHELL: Sqrt: %f = %f\n", a, result);
Copied: incubator/celix/trunk/remote_services/calculator_shell/private/src/sub_command.c (from r1530579, incubator/celix/trunk/remote_services/calc_shell/private/src/sub_command.c)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_shell/private/src/sub_command.c?p2=incubator/celix/trunk/remote_services/calculator_shell/private/src/sub_command.c&p1=incubator/celix/trunk/remote_services/calc_shell/private/src/sub_command.c&r1=1530579&r2=1532245&rev=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/calc_shell/private/src/sub_command.c (original)
+++ incubator/celix/trunk/remote_services/calculator_shell/private/src/sub_command.c Tue Oct 15 08:40:44 2013
@@ -32,7 +32,7 @@
#include "array_list.h"
#include "bundle_context.h"
#include "sub_command.h"
-#include "example_service.h"
+#include "calculator_service.h"
void subCommand_execute(command_pt command, char * line, void (*out)(char *), void (*err)(char *));
@@ -58,11 +58,11 @@ void subCommand_destroy(command_pt comma
void subCommand_execute(command_pt command, char *line, void (*out)(char *), void (*err)(char *)) {
celix_status_t status = CELIX_SUCCESS;
- service_reference_pt exampleService = NULL;
+ service_reference_pt calculatorService = NULL;
apr_pool_t *memory_pool = NULL;
apr_pool_t *bundle_memory_pool = NULL;
- status = bundleContext_getServiceReference(command->bundleContext, (char *) EXAMPLE_SERVICE, &exampleService);
+ status = bundleContext_getServiceReference(command->bundleContext, (char *) CALCULATOR_SERVICE, &calculatorService);
if (status == CELIX_SUCCESS) {
char *token;
char *commandStr = apr_strtok(line, " ", &token);
@@ -73,13 +73,13 @@ void subCommand_execute(command_pt comma
char *bStr = apr_strtok(NULL, " ", &token);
subCommand_isNumeric(command, bStr, &numeric);
if (bStr != NULL && numeric) {
- example_service_pt example = NULL;
- status = bundleContext_getService(command->bundleContext, exampleService, (void *) &example);
+ calculator_service_pt calculator = NULL;
+ status = bundleContext_getService(command->bundleContext, calculatorService, (void *) &calculator);
if (status == CELIX_SUCCESS) {
double a = atof(aStr);
double b = atof(bStr);
double result = 0;
- status = example->sub(example->example, a, b, &result);
+ status = calculator->sub(calculator->calculator, a, b, &result);
if (status == CELIX_SUCCESS) {
char line[256];
sprintf(line, "CALCULATOR_SHELL: Sub: %f - %f = %f\n", a, b, result);
Modified: incubator/celix/trunk/remote_services/deploy.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/deploy.cmake?rev=1532245&r1=1532244&r2=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/deploy.cmake (original)
+++ incubator/celix/trunk/remote_services/deploy.cmake Tue Oct 15 08:40:44 2013
@@ -16,11 +16,11 @@
# under the License.
is_enabled(REMOTE_SERVICE_ADMIN)
if (REMOTE_SERVICE_ADMIN)
- deploy("remote-services-bj" BUNDLES discovery_bonjour topology_manager remote_service_admin example example_endpoint shell shell_tui log_service log_writer)
- deploy("remote-services-bj-client" BUNDLES topology_manager remote_service_admin example_proxy shell shell_tui log_service log_writer calc_shell discovery_bonjour)
+ deploy("remote-services-bj" BUNDLES discovery_bonjour topology_manager remote_service_admin calculator calculator_endpoint shell shell_tui log_service log_writer)
+ deploy("remote-services-bj-client" BUNDLES topology_manager remote_service_admin calculator_proxy shell shell_tui log_service log_writer calculator_shell discovery_bonjour)
- deploy("remote-services" BUNDLES discovery_slp topology_manager remote_service_admin example example_endpoint shell shell_tui log_service log_writer)
- deploy("remote-services-client" BUNDLES topology_manager remote_service_admin example_proxy shell shell_tui log_service log_writer calc_shell discovery_slp)
+ deploy("remote-services" BUNDLES discovery_slp topology_manager remote_service_admin calculator calculator_endpoint shell shell_tui log_service log_writer)
+ deploy("remote-services-client" BUNDLES topology_manager remote_service_admin calculator_proxy shell shell_tui log_service log_writer calculator_shell discovery_slp)
#TODO for remote-service-client the discovery should be added as last. If this is not done,
#discovery will discover services before the topology manager is registered as
Modified: incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c?rev=1532245&r1=1532244&r2=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/private/src/export_registration_impl.c Tue Oct 15 08:40:44 2013
@@ -31,7 +31,6 @@
#include "export_registration_impl.h"
#include "remote_service_admin_impl.h"
-#include "remote_endpoint.h"
#include "service_tracker.h"
#include "bundle_context.h"
#include "bundle.h"
Modified: incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_endpoint.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_endpoint.h?rev=1532245&r1=1532244&r2=1532245&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_endpoint.h (original)
+++ incubator/celix/trunk/remote_services/remote_service_admin/public/include/remote_endpoint.h Tue Oct 15 08:40:44 2013
@@ -17,7 +17,7 @@
*under the License.
*/
/*
- * endpoint.h
+ * remote_endpoint.h
*
* \date Oct 7, 2011
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>