http://git-wip-us.apache.org/repos/asf/celix/blob/81804e00/remote_services/rsa_spi/include/remote_endpoint.h ---------------------------------------------------------------------- diff --git a/remote_services/rsa_spi/include/remote_endpoint.h b/remote_services/rsa_spi/include/remote_endpoint.h new file mode 100644 index 0000000..ab80abb --- /dev/null +++ b/remote_services/rsa_spi/include/remote_endpoint.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. + */ +/* + * remote_endpoint.h + * + * \date Oct 7, 2011 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ + +#ifndef REMOTE_ENDPOINT_H_ +#define REMOTE_ENDPOINT_H_ + +#define OSGI_RSA_REMOTE_ENDPOINT "remote_endpoint" + +typedef struct remote_endpoint remote_endpoint_t; +typedef remote_endpoint_t* remote_endpoint_pt; + +struct remote_endpoint_service { + remote_endpoint_pt endpoint; + celix_status_t (*setService)(remote_endpoint_pt endpoint, void *service); + celix_status_t (*handleRequest)(remote_endpoint_pt endpoint, char *data, char **reply); +}; + +typedef struct remote_endpoint_service *remote_endpoint_service_pt; + + +#endif /* REMOTE_ENDPOINT_H_ */
http://git-wip-us.apache.org/repos/asf/celix/blob/81804e00/remote_services/rsa_spi/include/remote_endpoint_impl.h ---------------------------------------------------------------------- diff --git a/remote_services/rsa_spi/include/remote_endpoint_impl.h b/remote_services/rsa_spi/include/remote_endpoint_impl.h new file mode 100644 index 0000000..3782d62 --- /dev/null +++ b/remote_services/rsa_spi/include/remote_endpoint_impl.h @@ -0,0 +1,38 @@ +/** + *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_endpoint_impl.h + * + * \date Oct 11, 2011 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ + +#ifndef REMOTE_ENDPOINT_IMPL_H_ +#define REMOTE_ENDPOINT_IMPL_H_ + +#include "remote_endpoint.h" +#include "celix_threads.h" + +struct remote_endpoint { + celix_thread_mutex_t serviceLock; + void *service; +}; + +#endif /* REMOTE_ENDPOINT_IMPL_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/81804e00/remote_services/rsa_spi/include/remote_proxy.h ---------------------------------------------------------------------- diff --git a/remote_services/rsa_spi/include/remote_proxy.h b/remote_services/rsa_spi/include/remote_proxy.h new file mode 100644 index 0000000..4c3f5c3 --- /dev/null +++ b/remote_services/rsa_spi/include/remote_proxy.h @@ -0,0 +1,76 @@ +/** + *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_proxy.h + * + * \date Oct 13, 2011 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ + +#ifndef REMOTE_PROXY_H_ +#define REMOTE_PROXY_H_ + +#include "endpoint_listener.h" +#include "remote_service_admin.h" + +#define OSGI_RSA_REMOTE_PROXY_FACTORY "remote_proxy_factory" +#define OSGI_RSA_REMOTE_PROXY_TIMEOUT "remote_proxy_timeout" + +typedef celix_status_t (*sendToHandle)(remote_service_admin_pt remote_service_admin_ptr, endpoint_description_pt endpointDescription, char *request, char **reply, int* replyStatus); +typedef celix_status_t (*createProxyService)(void *handle, endpoint_description_pt endpointDescription, remote_service_admin_pt rsa, sendToHandle sendToCallback, properties_pt properties, void **service); +typedef celix_status_t (*destroyProxyService)(void *handle, void *service); + +typedef struct remote_proxy_factory *remote_proxy_factory_pt; +typedef struct remote_proxy_factory_service *remote_proxy_factory_service_pt; + +struct remote_proxy_factory { + bundle_context_pt context_ptr; + char *service; + + remote_proxy_factory_service_pt remote_proxy_factory_service_ptr; + properties_pt properties; + service_registration_pt registration; + + hash_map_pt proxy_instances; + + void *handle; + + createProxyService create_proxy_service_ptr; + destroyProxyService destroy_proxy_service_ptr; +}; + +struct remote_proxy_factory_service { + remote_proxy_factory_pt factory; + celix_status_t (*registerProxyService)(remote_proxy_factory_pt proxyFactoryService, endpoint_description_pt endpoint, remote_service_admin_pt remote_service_admin_ptr, sendToHandle callback); + celix_status_t (*unregisterProxyService)(remote_proxy_factory_pt proxyFactoryService, endpoint_description_pt endpoint); +}; + +celix_status_t remoteProxyFactory_create(bundle_context_pt context, char *service, void *handle, + createProxyService create, destroyProxyService destroy, + remote_proxy_factory_pt *remote_proxy_factory_ptr); +celix_status_t remoteProxyFactory_destroy(remote_proxy_factory_pt *remote_proxy_factory_ptr); + +celix_status_t remoteProxyFactory_register(remote_proxy_factory_pt remote_proxy_factory_ptr); +celix_status_t remoteProxyFactory_unregister(remote_proxy_factory_pt remote_proxy_factory_ptr); + + + + +#endif /* REMOTE_PROXY_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/81804e00/remote_services/rsa_spi/include/remote_service_admin.h ---------------------------------------------------------------------- diff --git a/remote_services/rsa_spi/include/remote_service_admin.h b/remote_services/rsa_spi/include/remote_service_admin.h new file mode 100644 index 0000000..cc7fd98 --- /dev/null +++ b/remote_services/rsa_spi/include/remote_service_admin.h @@ -0,0 +1,73 @@ +/** + *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.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_H_ +#define REMOTE_SERVICE_ADMIN_H_ + +#include "endpoint_listener.h" +#include "service_reference.h" +#include "export_registration.h" +#include "import_registration.h" + +#define OSGI_RSA_REMOTE_SERVICE_ADMIN "remote_service_admin" + +typedef struct import_registration_factory import_registration_factory_t; +typedef import_registration_factory_t* import_registration_factory_pt; + +typedef struct remote_service_admin remote_service_admin_t; +typedef remote_service_admin_t* remote_service_admin_pt; + +struct remote_service_admin_service { + remote_service_admin_pt admin; + celix_status_t (*exportService)(remote_service_admin_pt admin, char *serviceId, properties_pt properties, array_list_pt *registrations); + celix_status_t (*removeExportedService)(remote_service_admin_pt admin, export_registration_pt registration); + celix_status_t (*getExportedServices)(remote_service_admin_pt admin, array_list_pt *services); + celix_status_t (*getImportedEndpoints)(remote_service_admin_pt admin, array_list_pt *services); + celix_status_t (*importService)(remote_service_admin_pt admin, endpoint_description_pt endpoint, import_registration_pt *registration); + + celix_status_t (*exportReference_getExportedEndpoint)(export_reference_pt reference, endpoint_description_pt *endpoint); + celix_status_t (*exportReference_getExportedService)(export_reference_pt reference, service_reference_pt *service); + + celix_status_t (*exportRegistration_close)(remote_service_admin_pt admin, export_registration_pt registration); + celix_status_t (*exportRegistration_getException)(export_registration_pt registration); + celix_status_t (*exportRegistration_getExportReference)(export_registration_pt registration, export_reference_pt *reference); + celix_status_t (*exportRegistration_freeExportReference)(export_reference_pt *reference); + celix_status_t (*exportRegistration_getEndpointDescription)(export_registration_pt registration, endpoint_description_pt endpointDescription); + + celix_status_t (*importReference_getImportedEndpoint)(import_reference_pt reference); + celix_status_t (*importReference_getImportedService)(import_reference_pt reference); + + celix_status_t (*importRegistration_close)(remote_service_admin_pt admin, import_registration_pt registration); + celix_status_t (*importRegistration_getException)(import_registration_pt registration); + celix_status_t (*importRegistration_getImportReference)(import_registration_pt registration, import_reference_pt *reference); + +}; + +typedef struct remote_service_admin_service remote_service_admin_service_t; +typedef remote_service_admin_service_t* remote_service_admin_service_pt; + + +#endif /* REMOTE_SERVICE_ADMIN_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/81804e00/remote_services/topology_manager/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/remote_services/topology_manager/CMakeLists.txt b/remote_services/topology_manager/CMakeLists.txt index 568054e..6050229 100644 --- a/remote_services/topology_manager/CMakeLists.txt +++ b/remote_services/topology_manager/CMakeLists.txt @@ -28,7 +28,7 @@ if (RSA_TOPOLOGY_MANAGER) ) target_include_directories(rsa_topology_manager PRIVATE src) target_include_directories(rsa_topology_manager PUBLIC include) - target_link_libraries(rsa_topology_manager PRIVATE Celix::log_helper Celix::rsa_api) + target_link_libraries(rsa_topology_manager PRIVATE Celix::log_helper Celix::rsa_spi) install_bundle(rsa_topology_manager) http://git-wip-us.apache.org/repos/asf/celix/blob/81804e00/remote_services/topology_manager/tms_tst/bundle/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/remote_services/topology_manager/tms_tst/bundle/CMakeLists.txt b/remote_services/topology_manager/tms_tst/bundle/CMakeLists.txt index eaf0a26..dc5dea5 100644 --- a/remote_services/topology_manager/tms_tst/bundle/CMakeLists.txt +++ b/remote_services/topology_manager/tms_tst/bundle/CMakeLists.txt @@ -32,4 +32,4 @@ bundle_files(topology_manager_test_bundle DESTINATION . ) -target_link_libraries(topology_manager_test_bundle PRIVATE ${CPPUTEST_LIBRARY} Celix::rsa_api calculator_api) +target_link_libraries(topology_manager_test_bundle PRIVATE ${CPPUTEST_LIBRARY} Celix::rsa_spi calculator_api) http://git-wip-us.apache.org/repos/asf/celix/blob/81804e00/utils/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index e0c187f..1826902 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -19,7 +19,8 @@ set(MEMSTREAM_SOURCES ) set(MEMSTREAM_INCLUDES ) if (APPLE OR ANDROID) set(MEMSTREAM_SOURCES src/memstream/open_memstream.c src/memstream/fmemopen.c) - set(MEMSTREAM_INCLUDE_DIR include/memstream) + set(MEMSTREAM_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/include/memstream) + install(DIRECTORY include/memstream/ DESTINATION include/celix/memstream COMPONENT framework) endif() add_library(utils SHARED @@ -41,7 +42,11 @@ if (ANDROID) target_compile_definitions(utils PRIVATE -DUSE_FILE32API) endif () -target_include_directories(utils PUBLIC include ${MEMSTREAM_INCLUDE_DIR}) +target_include_directories(utils PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> + $<BUILD_INTERFACE:${MEMSTREAM_INCLUDE_DIR}> + $<INSTALL_INTERFACE:include/celix> +) target_include_directories(utils PRIVATE src) set_target_properties(utils PROPERTIES "SOVERSION" 2) @@ -51,7 +56,9 @@ ELSEIF(ANDROID) target_link_libraries(utils PRIVATE m) ENDIF() -install(TARGETS utils DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework) +install(TARGETS utils EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework) +install(DIRECTORY include/ DESTINATION include/celix COMPONENT framework + PATTERN memstream* EXCLUDE) #Alias setup to match external usage add_library(Celix::utils ALIAS utils)
