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 2012/11/27 12:34:01 UTC
svn commit: r1414132 [1/2] - in /incubator/celix/trunk: cmake/
dependency_manager/private/src/ dependency_manager/public/include/
examples/ framework/ framework/private/src/ framework/public/include/
launcher/private/src/ log_service/private/src/ shell...
Author: abroekhuis
Date: Tue Nov 27 11:33:50 2012
New Revision: 1414132
URL: http://svn.apache.org/viewvc?rev=1414132&view=rev
Log:
CELIX-42: Updated code to work on Windows. This might break Linux support. See the next commit for fixes.
Added:
incubator/celix/trunk/framework/public/include/framework_exports.h
Modified:
incubator/celix/trunk/cmake/Packaging.cmake
incubator/celix/trunk/dependency_manager/private/src/service_component.c
incubator/celix/trunk/dependency_manager/private/src/service_dependency.c
incubator/celix/trunk/dependency_manager/public/include/service_component_private.h
incubator/celix/trunk/dependency_manager/public/include/service_dependency.h
incubator/celix/trunk/examples/CMakeLists.txt
incubator/celix/trunk/framework/CMakeLists.txt
incubator/celix/trunk/framework/private/src/bundle.c
incubator/celix/trunk/framework/private/src/bundle_archive.c
incubator/celix/trunk/framework/private/src/bundle_cache.c
incubator/celix/trunk/framework/private/src/bundle_revision.c
incubator/celix/trunk/framework/private/src/celix_errorcodes.c
incubator/celix/trunk/framework/private/src/framework.c
incubator/celix/trunk/framework/private/src/manifest.c
incubator/celix/trunk/framework/private/src/manifest_parser.c
incubator/celix/trunk/framework/private/src/miniunz.c
incubator/celix/trunk/framework/private/src/service_registration.c
incubator/celix/trunk/framework/private/src/service_registry.c
incubator/celix/trunk/framework/private/src/service_tracker.c
incubator/celix/trunk/framework/private/src/utils.c
incubator/celix/trunk/framework/private/src/version.c
incubator/celix/trunk/framework/public/include/bundle.h
incubator/celix/trunk/framework/public/include/bundle_activator.h
incubator/celix/trunk/framework/public/include/bundle_archive.h
incubator/celix/trunk/framework/public/include/bundle_context.h
incubator/celix/trunk/framework/public/include/framework.h
incubator/celix/trunk/framework/public/include/module.h
incubator/celix/trunk/framework/public/include/properties.h
incubator/celix/trunk/framework/public/include/service_event.h
incubator/celix/trunk/framework/public/include/service_reference.h
incubator/celix/trunk/framework/public/include/service_registration.h
incubator/celix/trunk/framework/public/include/utils.h
incubator/celix/trunk/launcher/private/src/launcher.c
incubator/celix/trunk/log_service/private/src/log.c
incubator/celix/trunk/log_service/private/src/log_reader_service_impl.c
incubator/celix/trunk/log_service/private/src/log_service_activator.c
incubator/celix/trunk/shell/CMakeLists.txt
incubator/celix/trunk/shell/private/src/inspect_command.c
incubator/celix/trunk/shell/private/src/install_command.c
incubator/celix/trunk/shell/private/src/ps_command.c
incubator/celix/trunk/shell/private/src/shell.c
incubator/celix/trunk/shell/private/src/update_command.c
incubator/celix/trunk/shell_tui/CMakeLists.txt
incubator/celix/trunk/shell_tui/private/src/shell_tui.c
incubator/celix/trunk/utils/CMakeLists.txt
incubator/celix/trunk/utils/private/src/array_list.c
incubator/celix/trunk/utils/private/src/hash_map.c
incubator/celix/trunk/utils/private/src/linked_list_iterator.c
incubator/celix/trunk/utils/public/include/array_list.h
incubator/celix/trunk/utils/public/include/exports.h
incubator/celix/trunk/utils/public/include/linked_list_iterator.h
incubator/celix/trunk/utils/public/include/linkedlist.h
Modified: incubator/celix/trunk/cmake/Packaging.cmake
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/Packaging.cmake?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/cmake/Packaging.cmake (original)
+++ incubator/celix/trunk/cmake/Packaging.cmake Tue Nov 27 11:33:50 2012
@@ -1,203 +1,202 @@
-# 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.
-
-GET_FILENAME_COMPONENT(__cmake_path ${CMAKE_COMMAND} PATH)
-FIND_PROGRAM(CPACK_COMMAND cpack ${__cmake_path})
-MESSAGE(STATUS "Found CPack at: ${CPACK_COMMAND}")
-IF(NOT CPACK_COMMAND)
- MESSAGE(FATAL_ERROR "Need CPack!")
-ENDIF(NOT CPACK_COMMAND)
-
-SET(CPACK_GENERATOR "ZIP")
-
-file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/bundles ${PROJECT_BINARY_DIR}/packages)
-
-MACRO(SET_HEADER header content)
- SET(INT_${header} "${content}")
- string(STRIP ${INT_${header}} INT_${header})
-ENDMACRO(SET_HEADER)
-
-MACRO(SET_HEADERS content)
- SET(INT_BUNDLE_EXTRAHEADER "${INT_BUNDLE_EXTRAHEADER}\n${content}")
- string(STRIP ${INT_BUNDLE_EXTRAHEADER} INT_BUNDLE_EXTRAHEADER)
-ENDMACRO(SET_HEADERS)
-
-MACRO(bundle)
- PARSE_ARGUMENTS(BUNDLE "SOURCES;FILES;DIRECTORIES" "" ${ARGN})
- LIST(GET BUNDLE_DEFAULT_ARGS 0 INT_BUNDLE_NAME)
-
- add_library(${INT_BUNDLE_NAME} SHARED ${BUNDLE_SOURCES})
-
- if (NOT INT_BUNDLE_SYMBOLICNAME)
- set(INT_BUNDLE_SYMBOLICNAME ${INT_BUNDLE_NAME})
- endif (NOT INT_BUNDLE_SYMBOLICNAME)
- if (NOT INT_BUNDLE_VERSION)
- set(INT_BUNDLE_VERSION ${DEFAULT_VERSION})
- endif (NOT INT_BUNDLE_VERSION)
- if (NOT INT_BUNDLE_DESCRIPTION)
- set(INT_BUNDLE_DESCRIPTION "${INT_BUNDLE_SYMBOLICNAME} bundle")
- endif (NOT INT_BUNDLE_DESCRIPTION)
-
- SET(__bundleManifest ${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.MF)
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/manifest.in ${__bundleManifest} @ONLY)
- install (FILES ${__bundleManifest} DESTINATION ./META-INF COMPONENT ${INT_BUNDLE_NAME})
-
- install (TARGETS ${INT_BUNDLE_NAME} DESTINATION . COMPONENT ${INT_BUNDLE_NAME})
- if (BUNDLE_FILES)
- install (FILES ${BUNDLE_FILES} DESTINATION . COMPONENT ${INT_BUNDLE_NAME})
- endif(BUNDLE_FILES)
- if (BUNDLE_DIRECTORIES)
- install (DIRECTORY ${BUNDLE_DIRECTORIES} DESTINATION . COMPONENT ${INT_BUNDLE_NAME})
- endif(BUNDLE_DIRECTORIES)
-
- SET(__bundleConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${INT_BUNDLE_NAME}-bundle.cmake)
- SET(BUNDLE_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfig.in ${__bundleConfig} @ONLY)
- ADD_CUSTOM_COMMAND(TARGET ${INT_BUNDLE_NAME}
- POST_BUILD
- COMMAND ${CPACK_COMMAND} ARGS --config ${__bundleConfig}
- COMMAND mkdir -p ${PROJECT_BINARY_DIR}/ziptojar \;
- cd ${PROJECT_BINARY_DIR}/ziptojar \;
- jar -xf ${PROJECT_BINARY_DIR}/bundles/${INT_BUNDLE_NAME}.zip \;
- jar -cfm ${PROJECT_BINARY_DIR}/bundles/${INT_BUNDLE_NAME}.zip META-INF/MANIFEST.MF . \;
- rm -rf ${PROJECT_BINARY_DIR}/ziptojar/*
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bundles
- )
- SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/bundles/${INT_BUNDLE_NAME}.zip)
-ENDMACRO(bundle)
-
-MACRO(package)
- PARSE_ARGUMENTS(PACKAGE "FILES;DIRECTORIES" "" ${ARGN})
- LIST(GET PACKAGE_DEFAULT_ARGS 0 PACKAGE_NAME)
-
- SET(PACKAGE_COMPONENT package_${PACKAGE_NAME})
-
- install (FILES ${PROJECT_BINARY_DIR}/bundles/${PACKAGE_NAME}.zip DESTINATION . COMPONENT ${PACKAGE_COMPONENT})
-
- if (PACKAGE_FILES)
- install (FILES ${PACKAGE_FILES} DESTINATION . COMPONENT ${PACKAGE_COMPONENT})
- endif(PACKAGE_FILES)
- if (PACKAGE_DIRECTORIES)
- install (DIRECTORY ${PACKAGE_DIRECTORIES} DESTINATION . COMPONENT ${PACKAGE_COMPONENT})
- endif(PACKAGE_DIRECTORIES)
-
- SET(__packageConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${PACKAGE_NAME}-pkg.cmake)
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfigPKG.in ${__packageConfig} @ONLY)
- ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_NAME}
- POST_BUILD
- COMMAND mkdir -p ${PROJECT_BINARY_DIR}/packages \;
- cd ${PROJECT_BINARY_DIR}/packages \;
- ${CPACK_COMMAND} --config "${__packageConfig}"
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/packages
- )
-
- GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
- SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROPS};${PROJECT_BINARY_DIR}/packages/${PACKAGE_NAME}_pkg.zip")
-ENDMACRO(package)
-
-
-ADD_CUSTOM_TARGET(deploy)
-MACRO(deploy)
- PARSE_ARGUMENTS(DEPLOY "BUNDLES" "" ${ARGN})
- LIST(GET DEPLOY_DEFAULT_ARGS 0 DEPLOY_NAME)
-
- SET(DEPLOY_COMPONENT deploy_${DEPLOY_NAME})
- SET(__deployTarget deploy_${DEPLOY_NAME})
-
- SET(BUNDLES "")
- SET(DEPS)
- FOREACH(BUNDLE ${DEPLOY_BUNDLES})
- SET(DEP_NAME ${DEPLOY_NAME}_${BUNDLE})
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
- COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/bundles/${BUNDLE}.zip
- ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
- DEPENDS ${BUNDLE}
- COMMENT "Deploying ${BUNDLE} to ${DEPLOY_NAME}"
- )
- SET(BUNDLES "${BUNDLES} bundles/${BUNDLE}.zip")
- SET(DEPS ${DEPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip)
- ENDFOREACH(BUNDLE)
- ADD_CUSTOM_TARGET(${__deployTarget}
- DEPENDS ${DEPS} celix
- COMMENT "Deploy target ${DEPLOY_NAME}")
- ADD_DEPENDENCIES(deploy ${__deployTarget})
-
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config.properties.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/config.properties @ONLY)
-
- set(FW_PATH ${CMAKE_BINARY_DIR}/framework)
- set(UTILS_PATH ${CMAKE_BINARY_DIR}/utils)
- set(LAUNCHER ${CMAKE_BINARY_DIR}/launcher/celix)
-
- IF(UNIX)
- IF(APPLE)
- set(LIBRARY_PATH DYLD_LIBRARY_PATH)
- ELSE(APPLE)
- set(LIBRARY_PATH LD_LIBRARY_PATH)
- ENDIF(APPLE)
- ENDIF(UNIX)
-
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/run.sh.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/run.sh @ONLY)
-
- GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
- SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles")
-
- # Generate an Eclipse launch file to be able to run the deployment from Eclipse
- string(REPLACE "/" ";" LIST ${PROJECT_BINARY_DIR})
- list(LENGTH LIST len)
- MATH(EXPR test "${len} - 1")
- LIST(GET LIST ${test} last)
-
- SET(CONTAINER_NAME ${DEPLOY_NAME})
- SET(PROGRAM_NAME ${LAUNCHER})
- SET(PROJECT_ATTR ${last})
- SET(WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/")
-
- CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/RunConfig.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/${DEPLOY_NAME}.launch @ONLY)
-ENDMACRO(deploy)
-
-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
- SET(DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- SET(larg_names ${arg_names})
- LIST(FIND larg_names "${arg}" is_arg_name)
- IF (is_arg_name GREATER -1)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name GREATER -1)
- SET(loption_names ${option_names})
- LIST(FIND loption_names "${arg}" is_option)
- IF (is_option GREATER -1)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option GREATER -1)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option GREATER -1)
- ENDIF (is_arg_name GREATER -1)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)
-
-
+# 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.
+
+GET_FILENAME_COMPONENT(__cmake_path ${CMAKE_COMMAND} PATH)
+FIND_PROGRAM(CPACK_COMMAND cpack ${__cmake_path})
+MESSAGE(STATUS "Found CPack at: ${CPACK_COMMAND}")
+IF(NOT CPACK_COMMAND)
+ MESSAGE(FATAL_ERROR "Need CPack!")
+ENDIF(NOT CPACK_COMMAND)
+
+SET(CPACK_GENERATOR "ZIP")
+
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/bundles ${PROJECT_BINARY_DIR}/packages)
+
+MACRO(SET_HEADER header content)
+ SET(INT_${header} "${content}")
+ string(STRIP ${INT_${header}} INT_${header})
+ENDMACRO(SET_HEADER)
+
+MACRO(SET_HEADERS content)
+ SET(INT_BUNDLE_EXTRAHEADER "${INT_BUNDLE_EXTRAHEADER}\n${content}")
+ string(STRIP ${INT_BUNDLE_EXTRAHEADER} INT_BUNDLE_EXTRAHEADER)
+ENDMACRO(SET_HEADERS)
+
+MACRO(bundle)
+ PARSE_ARGUMENTS(BUNDLE "SOURCES;FILES;DIRECTORIES" "" ${ARGN})
+ LIST(GET BUNDLE_DEFAULT_ARGS 0 INT_BUNDLE_NAME)
+
+ add_library(${INT_BUNDLE_NAME} SHARED ${BUNDLE_SOURCES})
+
+ if (NOT INT_BUNDLE_SYMBOLICNAME)
+ set(INT_BUNDLE_SYMBOLICNAME ${INT_BUNDLE_NAME})
+ endif (NOT INT_BUNDLE_SYMBOLICNAME)
+ if (NOT INT_BUNDLE_VERSION)
+ set(INT_BUNDLE_VERSION ${DEFAULT_VERSION})
+ endif (NOT INT_BUNDLE_VERSION)
+ if (NOT INT_BUNDLE_DESCRIPTION)
+ set(INT_BUNDLE_DESCRIPTION "${INT_BUNDLE_SYMBOLICNAME} bundle")
+ endif (NOT INT_BUNDLE_DESCRIPTION)
+
+ SET(__bundleManifest ${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.MF)
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/manifest.in ${__bundleManifest} @ONLY)
+ install (FILES ${__bundleManifest} DESTINATION ./META-INF COMPONENT ${INT_BUNDLE_NAME})
+
+ install (TARGETS ${INT_BUNDLE_NAME} DESTINATION . COMPONENT ${INT_BUNDLE_NAME})
+ if (BUNDLE_FILES)
+ install (FILES ${BUNDLE_FILES} DESTINATION . COMPONENT ${INT_BUNDLE_NAME})
+ endif(BUNDLE_FILES)
+ if (BUNDLE_DIRECTORIES)
+ install (DIRECTORY ${BUNDLE_DIRECTORIES} DESTINATION . COMPONENT ${INT_BUNDLE_NAME})
+ endif(BUNDLE_DIRECTORIES)
+
+ SET(__bundleConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${INT_BUNDLE_NAME}-bundle.cmake)
+ SET(BUNDLE_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfig.in ${__bundleConfig} @ONLY)
+ ADD_CUSTOM_COMMAND(TARGET ${INT_BUNDLE_NAME}
+ POST_BUILD
+ COMMAND ${CPACK_COMMAND} ARGS -C Debug --config ${__bundleConfig}
+ # COMMAND mkdir -p ${PROJECT_BINARY_DIR}/ziptojar \;
+ # cd ${PROJECT_BINARY_DIR}/ziptojar \;
+ # jar -xf ${PROJECT_BINARY_DIR}/bundles/${INT_BUNDLE_NAME}.zip \;
+ # jar -cfm ${PROJECT_BINARY_DIR}/bundles/${INT_BUNDLE_NAME}.zip META-INF/MANIFEST.MF . \;
+ # rm -rf ${PROJECT_BINARY_DIR}/ziptojar/*
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bundles
+ )
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/bundles/${INT_BUNDLE_NAME}.zip)
+ENDMACRO(bundle)
+
+MACRO(package)
+ PARSE_ARGUMENTS(PACKAGE "FILES;DIRECTORIES" "" ${ARGN})
+ LIST(GET PACKAGE_DEFAULT_ARGS 0 PACKAGE_NAME)
+
+ SET(PACKAGE_COMPONENT package_${PACKAGE_NAME})
+
+ install (FILES ${PROJECT_BINARY_DIR}/bundles/${PACKAGE_NAME}.zip DESTINATION . COMPONENT ${PACKAGE_COMPONENT})
+
+ if (PACKAGE_FILES)
+ install (FILES ${PACKAGE_FILES} DESTINATION . COMPONENT ${PACKAGE_COMPONENT})
+ endif(PACKAGE_FILES)
+ if (PACKAGE_DIRECTORIES)
+ install (DIRECTORY ${PACKAGE_DIRECTORIES} DESTINATION . COMPONENT ${PACKAGE_COMPONENT})
+ endif(PACKAGE_DIRECTORIES)
+
+ SET(__packageConfig ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig-${PACKAGE_NAME}-pkg.cmake)
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/CPackConfigPKG.in ${__packageConfig} @ONLY)
+ ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_NAME}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/packages
+ COMMAND ${CPACK_COMMAND} --config "${__packageConfig}"
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/packages
+ )
+
+ GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROPS};${PROJECT_BINARY_DIR}/packages/${PACKAGE_NAME}_pkg.zip")
+ENDMACRO(package)
+
+
+ADD_CUSTOM_TARGET(deploy)
+MACRO(deploy)
+ PARSE_ARGUMENTS(DEPLOY "BUNDLES" "" ${ARGN})
+ LIST(GET DEPLOY_DEFAULT_ARGS 0 DEPLOY_NAME)
+
+ SET(DEPLOY_COMPONENT deploy_${DEPLOY_NAME})
+ SET(__deployTarget deploy_${DEPLOY_NAME})
+
+ SET(BUNDLES "")
+ SET(DEPS)
+ FOREACH(BUNDLE ${DEPLOY_BUNDLES})
+ SET(DEP_NAME ${DEPLOY_NAME}_${BUNDLE})
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
+ COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/bundles/${BUNDLE}.zip
+ ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip
+ DEPENDS ${BUNDLE}
+ COMMENT "Deploying ${BUNDLE} to ${DEPLOY_NAME}"
+ )
+ SET(BUNDLES "${BUNDLES} bundles/${BUNDLE}.zip")
+ SET(DEPS ${DEPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip)
+ ENDFOREACH(BUNDLE)
+ ADD_CUSTOM_TARGET(${__deployTarget}
+ DEPENDS ${DEPS} celix
+ COMMENT "Deploy target ${DEPLOY_NAME}")
+ ADD_DEPENDENCIES(deploy ${__deployTarget})
+
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/config.properties.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/config.properties @ONLY)
+
+ set(FW_PATH ${CMAKE_BINARY_DIR}/framework)
+ set(UTILS_PATH ${CMAKE_BINARY_DIR}/utils)
+ set(LAUNCHER ${CMAKE_BINARY_DIR}/launcher/celix)
+
+ IF(UNIX)
+ IF(APPLE)
+ set(LIBRARY_PATH DYLD_LIBRARY_PATH)
+ ELSE(APPLE)
+ set(LIBRARY_PATH LD_LIBRARY_PATH)
+ ENDIF(APPLE)
+ ENDIF(UNIX)
+
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/run.sh.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/run.sh @ONLY)
+
+ GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROPS};${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles")
+
+ # Generate an Eclipse launch file to be able to run the deployment from Eclipse
+ string(REPLACE "/" ";" LIST ${PROJECT_BINARY_DIR})
+ list(LENGTH LIST len)
+ MATH(EXPR test "${len} - 1")
+ LIST(GET LIST ${test} last)
+
+ SET(CONTAINER_NAME ${DEPLOY_NAME})
+ SET(PROGRAM_NAME ${LAUNCHER})
+ SET(PROJECT_ATTR ${last})
+ SET(WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/")
+
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/RunConfig.in ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/${DEPLOY_NAME}.launch @ONLY)
+ENDMACRO(deploy)
+
+MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
+ SET(DEFAULT_ARGS)
+ FOREACH(arg_name ${arg_names})
+ SET(${prefix}_${arg_name})
+ ENDFOREACH(arg_name)
+ FOREACH(option ${option_names})
+ SET(${prefix}_${option} FALSE)
+ ENDFOREACH(option)
+
+ SET(current_arg_name DEFAULT_ARGS)
+ SET(current_arg_list)
+ FOREACH(arg ${ARGN})
+ SET(larg_names ${arg_names})
+ LIST(FIND larg_names "${arg}" is_arg_name)
+ IF (is_arg_name GREATER -1)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ SET(current_arg_name ${arg})
+ SET(current_arg_list)
+ ELSE (is_arg_name GREATER -1)
+ SET(loption_names ${option_names})
+ LIST(FIND loption_names "${arg}" is_option)
+ IF (is_option GREATER -1)
+ SET(${prefix}_${arg} TRUE)
+ ELSE (is_option GREATER -1)
+ SET(current_arg_list ${current_arg_list} ${arg})
+ ENDIF (is_option GREATER -1)
+ ENDIF (is_arg_name GREATER -1)
+ ENDFOREACH(arg)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ENDMACRO(PARSE_ARGUMENTS)
+
+
Modified: incubator/celix/trunk/dependency_manager/private/src/service_component.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/dependency_manager/private/src/service_component.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/private/src/service_component.c (original)
+++ incubator/celix/trunk/dependency_manager/private/src/service_component.c Tue Nov 27 11:33:50 2012
@@ -55,16 +55,15 @@ struct executor {
struct executorEntry * active;
LINKED_LIST workQueue;
- pthread_mutex_t mutex;
+ apr_thread_mutex_t *mutex;
};
SERVICE serviceComponent_create(bundle_context_t context, DEPENDENCY_MANAGER manager) {
SERVICE service;
apr_pool_t *pool;
+ apr_pool_t *mypool;
bundleContext_getMemoryPool(context, &pool);
-
- apr_pool_t *mypool;
apr_pool_create(&mypool, pool);
if (mypool) {
@@ -86,7 +85,7 @@ SERVICE serviceComponent_create(bundle_c
service->state = state_create(arrayList_clone(mypool, service->dependencies), false);
service->executor = executor_create(mypool);
- pthread_mutex_init(&service->mutex, NULL);
+ apr_thread_mutex_create(&service->mutex, APR_THREAD_MUTEX_UNNESTED, mypool);
}
return service;
@@ -117,19 +116,19 @@ void serviceComponent_calculateStateChan
SERVICE serviceComponent_addServiceDependency(SERVICE service, SERVICE_DEPENDENCY dependency) {
STATE old, new;
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
old = service->state;
arrayList_add(service->dependencies, dependency);
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
if (state_isTrackingOptional(old) || ( state_isWaitingForRequired(old) && dependency->required)) {
serviceDependency_start(dependency, service);
}
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
new = state_create(arrayList_clone(service->pool, service->dependencies), !state_isInactive(old));
service->state = new;
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
serviceComponent_calculateStateChanges(service, old, new);
state_destroy(old);
@@ -138,19 +137,19 @@ SERVICE serviceComponent_addServiceDepen
SERVICE serviceComponent_removeServiceDependency(SERVICE service, SERVICE_DEPENDENCY dependency) {
STATE old, new;
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
old = service->state;
arrayList_removeElement(service->dependencies, dependency);
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
if (state_isTrackingOptional(old) || ( state_isWaitingForRequired(old) && dependency->required)) {
serviceDependency_stop(dependency, service);
}
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
new = state_create(arrayList_clone(service->pool, service->dependencies), !state_isInactive(old));
service->state = new;
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
serviceComponent_calculateStateChanges(service, old, new);
state_destroy(old);
@@ -159,11 +158,11 @@ SERVICE serviceComponent_removeServiceDe
void serviceComponent_dependencyAvailable(SERVICE service, SERVICE_DEPENDENCY dependency) {
STATE old, new;
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
old = service->state;
new = state_create(arrayList_clone(service->pool, service->dependencies), !state_isInactive(old));
service->state = new;
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
serviceComponent_calculateStateChanges(service, old, new);
state_destroy(old);
if (state_isTrackingOptional(new)) {
@@ -174,9 +173,9 @@ void serviceComponent_dependencyAvailabl
void serviceComponent_dependencyChanged(SERVICE service, SERVICE_DEPENDENCY dependency) {
STATE state;
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
state = service->state;
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
if (state_isTrackingOptional(state)) {
executor_enqueue(service->executor, service, serviceComponent_updateInstance, dependency);
executor_execute(service->executor);
@@ -185,11 +184,11 @@ void serviceComponent_dependencyChanged(
void serviceComponent_dependencyUnavailable(SERVICE service, SERVICE_DEPENDENCY dependency) {
STATE old, new;
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
old = service->state;
new = state_create(arrayList_clone(service->pool, service->dependencies), !state_isInactive(old));
service->state = new;
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
serviceComponent_calculateStateChanges(service, old, new);
state_destroy(old);
if (state_isTrackingOptional(new)) {
@@ -199,24 +198,24 @@ void serviceComponent_dependencyUnavaila
}
void serviceComponent_start(SERVICE service) {
- bundleContext_registerService(service->context, SERVICE_COMPONENT_NAME, service, NULL, &service->serviceRegistration);
STATE old, new;
- pthread_mutex_lock(&service->mutex);
+ bundleContext_registerService(service->context, SERVICE_COMPONENT_NAME, service, NULL, &service->serviceRegistration);
+ apr_thread_mutex_lock(service->mutex);
old = service->state;
new = state_create(arrayList_clone(service->pool, service->dependencies), true);
service->state = new;
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
serviceComponent_calculateStateChanges(service, old, new);
state_destroy(old);
}
void serviceComponent_stop(SERVICE service) {
STATE old, new;
- pthread_mutex_lock(&service->mutex);
+ apr_thread_mutex_lock(service->mutex);
old = service->state;
new = state_create(arrayList_clone(service->pool, service->dependencies), false);
service->state = new;
- pthread_mutex_unlock(&service->mutex);
+ apr_thread_mutex_unlock(service->mutex);
serviceComponent_calculateStateChanges(service, old, new);
state_destroy(old);
serviceRegistration_unregister(service->serviceRegistration);
@@ -366,7 +365,7 @@ STATE state_create(ARRAY_LIST dependenci
state->dependencies = dependencies;
if (active) {
bool allReqAvail = true;
- int i;
+ unsigned int i;
for (i = 0; i < arrayList_size(dependencies); i++) {
SERVICE_DEPENDENCY dependency = arrayList_get(dependencies, i);
if (dependency->required) {
@@ -421,27 +420,28 @@ EXECUTOR executor_create(apr_pool_t *mem
if (executor) {
linkedList_create(memory_pool, &executor->workQueue);
executor->active = NULL;
- pthread_mutex_init(&executor->mutex, NULL);
+ apr_thread_mutex_create(&executor->mutex, APR_THREAD_MUTEX_UNNESTED, memory_pool);
}
return executor;
}
void executor_enqueue(EXECUTOR executor, SERVICE service, void (*function), void * argument) {
- pthread_mutex_lock(&executor->mutex);
- struct executorEntry * entry = malloc(sizeof(*entry));
+ struct executorEntry * entry = NULL;
+ apr_thread_mutex_lock(executor->mutex);
+ entry = (struct executorEntry *) malloc(sizeof(*entry));
entry->service = service;
entry->function = function;
entry->argument = argument;
linkedList_addLast(executor->workQueue, entry);
- pthread_mutex_unlock(&executor->mutex);
+ apr_thread_mutex_unlock(executor->mutex);
}
void executor_execute(EXECUTOR executor) {
struct executorEntry * active;
- pthread_mutex_lock(&executor->mutex);
+ apr_thread_mutex_lock(executor->mutex);
active = executor->active;
- pthread_mutex_unlock(&executor->mutex);
+ apr_thread_mutex_unlock(executor->mutex);
if (active == NULL) {
executor_scheduleNext(executor);
}
@@ -449,9 +449,9 @@ void executor_execute(EXECUTOR executor)
void executor_scheduleNext(EXECUTOR executor) {
struct executorEntry * entry = NULL;
- pthread_mutex_lock(&executor->mutex);
+ apr_thread_mutex_lock(executor->mutex);
entry = linkedList_removeFirst(executor->workQueue);
- pthread_mutex_unlock(&executor->mutex);
+ apr_thread_mutex_unlock(executor->mutex);
if (entry != NULL) {
entry->function(entry->service, entry->argument);
executor_scheduleNext(executor);
Modified: incubator/celix/trunk/dependency_manager/private/src/service_dependency.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/dependency_manager/private/src/service_dependency.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/private/src/service_dependency.c (original)
+++ incubator/celix/trunk/dependency_manager/private/src/service_dependency.c Tue Nov 27 11:33:50 2012
@@ -69,13 +69,14 @@ void * serviceDependency_getService(SERV
}
void serviceDependency_start(SERVICE_DEPENDENCY dependency, SERVICE service) {
+ apr_pool_t *pool;
+ service_tracker_customizer_t cust = NULL;
+
dependency->service = service;
dependency->tracker = NULL;
- apr_pool_t *pool;
bundleContext_getMemoryPool(dependency->context, &pool);
- service_tracker_customizer_t cust = NULL;
serviceTrackerCustomizer_create(pool, dependency, serviceDependency_addingService,
serviceDependency_addedService, serviceDependency_modifiedService,
serviceDependency_removedService, &cust);
@@ -137,6 +138,7 @@ celix_status_t serviceDependency_modifie
}
celix_status_t serviceDependency_removedService(void * handle, SERVICE_REFERENCE reference, void * service) {
+ bool result;
SERVICE_DEPENDENCY dependency = (SERVICE_DEPENDENCY) handle;
if (dependency->available && serviceTracker_getService(dependency->tracker) == NULL) {
dependency->available = false;
@@ -147,7 +149,6 @@ celix_status_t serviceDependency_removed
dependency->removed(dependency->service->impl, reference, service);
}
- bool result;
bundleContext_ungetService(dependency->context, reference, &result);
return CELIX_SUCCESS;
}
Modified: incubator/celix/trunk/dependency_manager/public/include/service_component_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/dependency_manager/public/include/service_component_private.h?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/public/include/service_component_private.h (original)
+++ incubator/celix/trunk/dependency_manager/public/include/service_component_private.h Tue Nov 27 11:33:50 2012
@@ -26,7 +26,7 @@
#ifndef SERVICE_COMPONENT_PRIVATE_H_
#define SERVICE_COMPONENT_PRIVATE_H_
-#include <stdbool.h>
+#include <celixbool.h>
#include "service_component.h"
#include "service_dependency.h"
@@ -60,7 +60,7 @@ struct service {
STATE state;
EXECUTOR executor;
- pthread_mutex_t mutex;
+ apr_thread_mutex_t *mutex;
};
SERVICE serviceComponent_create(bundle_context_t context, DEPENDENCY_MANAGER manager);
Modified: incubator/celix/trunk/dependency_manager/public/include/service_dependency.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/dependency_manager/public/include/service_dependency.h?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/public/include/service_dependency.h (original)
+++ incubator/celix/trunk/dependency_manager/public/include/service_dependency.h Tue Nov 27 11:33:50 2012
@@ -27,7 +27,7 @@
#ifndef SERVICE_DEPENDENCY_H_
#define SERVICE_DEPENDENCY_H_
-#include <stdbool.h>
+#include <celixbool.h>
#include "service_reference.h"
#include "service_tracker.h"
Modified: incubator/celix/trunk/examples/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/CMakeLists.txt?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/examples/CMakeLists.txt (original)
+++ incubator/celix/trunk/examples/CMakeLists.txt Tue Nov 27 11:33:50 2012
@@ -1,38 +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.
-celix_subproject(EXAMPLES "Option to enable building the Examples" "OFF" DEPS FRAMEWORK LAUNCHER SHELL_TUI LOG_WRITER DEPENDENCY_MANAGER)
-if (EXAMPLES)
- add_subdirectory(hello_world)
- add_subdirectory(mongoose)
-
- add_subdirectory(whiteboard)
- add_subdirectory(echo_service)
-
- add_subdirectory(osgi-in-action/chapter04-correct-lookup)
- add_subdirectory(osgi-in-action/chapter04-correct-listener)
- add_subdirectory(osgi-in-action/chapter01-greeting-example)
- add_subdirectory(osgi-in-action/chapter04-paint-example)
-
- deploy(chapter01-greeting-example BUNDLES shell shell_tui log_service chapter01-greeting-example-client chapter01-greeting-example)
- deploy(chapter04-correct-listener BUNDLES shell shell_tui log_service chapter04-correct-listener)
- deploy("chapter04-paint-example" BUNDLES chapter04-paint-example circle square triangle shell shell_tui log_service log_writer)
-
- deploy("hello_world" BUNDLES shell shell_tui hello_world log_service)
- deploy("wb" BUNDLES tracker publisherA publisherB shell shell_tui log_service log_writer)
- deploy("wb_dp" BUNDLES tracker_depman publisherA publisherB shell shell_tui log_service log_writer)
- deploy("echo" BUNDLES echo_server echo_client shell shell_tui log_service log_writer)
-endif(EXAMPLES)
+# 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.
+celix_subproject(EXAMPLES "Option to enable building the Examples" "OFF" DEPS FRAMEWORK LAUNCHER SHELL_TUI LOG_WRITER DEPENDENCY_MANAGER)
+if (EXAMPLES)
+ add_subdirectory(hello_world)
+ #add_subdirectory(mongoose)
+
+ #add_subdirectory(whiteboard)
+ #add_subdirectory(echo_service)
+
+ #add_subdirectory(osgi-in-action/chapter04-correct-lookup)
+ #add_subdirectory(osgi-in-action/chapter04-correct-listener)
+ #add_subdirectory(osgi-in-action/chapter01-greeting-example)
+ #add_subdirectory(osgi-in-action/chapter04-paint-example)
+
+ #deploy(chapter01-greeting-example BUNDLES shell shell_tui log_service chapter01-greeting-example-client chapter01-greeting-example)
+ #deploy(chapter04-correct-listener BUNDLES shell shell_tui log_service chapter04-correct-listener)
+ #deploy("chapter04-paint-example" BUNDLES chapter04-paint-example circle square triangle shell shell_tui log_service log_writer)
+
+ deploy("hello_world" BUNDLES shell shell_tui hello_world log_service)
+ #deploy("wb" BUNDLES tracker publisherA publisherB shell shell_tui log_service log_writer)
+ #deploy("wb_dp" BUNDLES tracker_depman publisherA publisherB shell shell_tui log_service log_writer)
+ #deploy("echo" BUNDLES echo_server echo_client shell shell_tui log_service log_writer)
+endif(EXAMPLES)
Modified: incubator/celix/trunk/framework/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/CMakeLists.txt?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/CMakeLists.txt (original)
+++ incubator/celix/trunk/framework/CMakeLists.txt Tue Nov 27 11:33:50 2012
@@ -1,47 +1,70 @@
-# 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.
-
-celix_subproject(FRAMEWORK "Option to build the framework shared library" "ON" DEPS UTILS)
-if (FRAMEWORK)
- cmake_minimum_required(VERSION 2.6)
-
- find_package(CURL REQUIRED)
- find_package(ZLIB REQUIRED)
-
- #include(CPackComponent)
-
- #cpack_add_component(framework
- # DISPLAY_NAME Framework
- # DESCRIPTION "The Apache Celix framework library"
- # REQUIRED
- #)
-
- add_definitions(-DUSE_FILE32API)
- aux_source_directory("private/src" SRC)
- #include_directories(${CURL_INCLUDE_DIR})
- include_directories(${ZLIB_INCLUDE_DIR})
- include_directories("private/include")
- include_directories("public/include")
- include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
- add_library(celix_framework SHARED ${SRC})
- target_link_libraries(celix_framework celix_utils ${ZLIB_LIBRARY} ${APR_LIBRARY})
-
- install(TARGETS celix_framework DESTINATION lib COMPONENT framework)
- FILE(GLOB files "public/include/*.h")
- INSTALL(FILES ${files} DESTINATION include/celix COMPONENT framework)
-
-endif (FRAMEWORK)
+# 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.
+
+celix_subproject(FRAMEWORK "Option to build the framework shared library" "ON" DEPS UTILS)
+if (FRAMEWORK)
+ cmake_minimum_required(VERSION 2.6)
+
+ find_package(CURL REQUIRED)
+ find_package(ZLIB REQUIRED)
+
+ #include(CPackComponent)
+
+ #cpack_add_component(framework
+ # DISPLAY_NAME Framework
+ # DESCRIPTION "The Apache Celix framework library"
+ # REQUIRED
+ #)
+
+ add_definitions(-DUSE_FILE32API)
+ #aux_source_directory("private/src" SRC)
+ #include_directories(${CURL_INCLUDE_DIR})
+ include_directories(${ZLIB_INCLUDE_DIR})
+ include_directories("private/include")
+ include_directories("public/include")
+ include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+ #message("Source: ${SRC}")
+
+ if(WIN32)
+ set(IO private/src/iowin32.c)
+ endif(WIN32)
+
+ add_library(celix_framework SHARED
+ private/src/attribute.c private/src/bundle.c private/src/bundle_archive.c private/src/bundle_cache.c
+ private/src/bundle_context.c private/src/bundle_revision.c private/src/capability.c private/src/celix_errorcodes.c
+ private/src/filter.c private/src/framework.c private/src/manifest.c private/src/ioapi.c
+ private/src/manifest_parser.c private/src/miniunz.c private/src/module.c private/src/properties.c
+ private/src/requirement.c private/src/resolver.c private/src/service_reference.c private/src/service_registration.c
+ private/src/service_registry.c private/src/service_tracker.c private/src/service_tracker_customizer.c
+ private/src/unzip.c private/src/utils.c private/src/version.c private/src/version_range.c private/src/wire.c
+
+ private/include/attribute.h public/include/framework_exports.h
+
+ public/include/framework.h public/include/properties.h public/include/bundle_context.h public/include/bundle.h
+ public/include/bundle_activator.h public/include/service_registration.h public/include/service_reference.h
+ public/include/bundle_archive.h public/include/utils.h public/include/module.h
+
+ ${IO}
+
+ )
+ target_link_libraries(celix_framework celix_utils ${ZLIB_LIBRARY} ${APR_LIBRARY})
+
+ install(TARGETS celix_framework DESTINATION lib COMPONENT framework)
+ FILE(GLOB files "public/include/*.h")
+ INSTALL(FILES ${files} DESTINATION include/celix COMPONENT framework)
+
+endif (FRAMEWORK)
Modified: incubator/celix/trunk/framework/private/src/bundle.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle.c Tue Nov 27 11:33:50 2012
@@ -240,9 +240,12 @@ celix_status_t bundle_createModule(BUNDL
status = bundleArchive_getId(bundle->archive, &bundleId);
if (status == CELIX_SUCCESS) {
int revision = 0;
+ char *moduleId = NULL;
apr_pool_t *pool = NULL;
+
+
apr_pool_create(&pool, bundle->memoryPool);
- char * moduleId = (char *) apr_palloc(pool, sizeof(bundleId) + sizeof(revision) +2);
+ moduleId = (char *) apr_palloc(pool, sizeof(bundleId) + sizeof(revision) +2);
sprintf(moduleId, "%ld.%d", bundleId, revision);
*module = module_create(headerMap, apr_pstrdup(bundle->memoryPool, moduleId), bundle);
@@ -253,7 +256,7 @@ celix_status_t bundle_createModule(BUNDL
status = module_getSymbolicName(*module, &symName);
if (status == CELIX_SUCCESS) {
ARRAY_LIST bundles = framework_getBundles(bundle->framework);
- int i;
+ unsigned int i;
for (i = 0; i < arrayList_size(bundles); i++) {
BUNDLE check = (BUNDLE) arrayList_get(bundles, i);
@@ -541,9 +544,9 @@ celix_status_t bundle_closeRevisions(BUN
celix_status_t bundle_closeModules(BUNDLE bundle) {
celix_status_t status = CELIX_SUCCESS;
- int i = 0;
+ unsigned int i = 0;
for (i = 0; i < arrayList_size(bundle->modules); i++) {
- MODULE module = arrayList_get(bundle->modules, i);
+ MODULE module = (MODULE) arrayList_get(bundle->modules, i);
resolver_removeModule(module);
module_setWires(module, NULL);
}
Modified: incubator/celix/trunk/framework/private/src/bundle_archive.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle_archive.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_archive.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_archive.c Tue Nov 27 11:33:50 2012
@@ -256,7 +256,7 @@ celix_status_t bundleArchive_getLocation
apr_pool_create(&subpool, archive->mp);
bundleLocation = (char *)apr_palloc(subpool, strlen(archive->archiveRoot) + 17);
- strcat(bundleLocation,archive->archiveRoot);
+ strcpy(bundleLocation,archive->archiveRoot);
strcat(bundleLocation, "/bundle.location");
if ((rv = apr_file_open(&bundleLocationFile, bundleLocation, APR_FOPEN_READ, APR_OS_DEFAULT, archive->mp)) != APR_SUCCESS) {
@@ -393,11 +393,11 @@ celix_status_t bundleArchive_getRefreshC
if (archive->refreshCount == -1) {
apr_file_t * refreshCounterFile;
- apr_status_t rv;
- apr_pool_t *subpool;
+ apr_status_t rv = APR_SUCCESS;
+ apr_pool_t *subpool = NULL;
+ char *refreshCounter = NULL;
+
apr_pool_create(&subpool, archive->mp);
-
- char * refreshCounter = NULL;
refreshCounter = (char *) apr_palloc(subpool, strlen(archive->archiveRoot) + 17);
strcpy(refreshCounter,archive->archiveRoot);
strcat(refreshCounter, "/refresh.counter");
@@ -685,10 +685,11 @@ static celix_status_t bundleArchive_init
} else {
apr_file_t *bundleIdFile;
apr_status_t apr_status;
- apr_pool_t *spool;
+ apr_pool_t *spool = NULL;
+ char *bundleId = NULL;
apr_pool_create(&spool, archive->mp);
- char * bundleId = (char *)apr_palloc(spool, sizeof(*bundleId) * (strlen(archive->archiveRoot) + 11));
+ bundleId = (char *)apr_palloc(spool, sizeof(*bundleId) * (strlen(archive->archiveRoot) + 11));
bundleId = apr_pstrcat(spool, archive->archiveRoot, "/bundle.id", NULL);
apr_status = apr_file_open(&bundleIdFile, bundleId, APR_FOPEN_CREATE|APR_FOPEN_WRITE, APR_OS_DEFAULT, archive->mp);
@@ -699,10 +700,11 @@ static celix_status_t bundleArchive_init
} else {
char * bundleLocation;
apr_file_t *bundleLocationFile;
+ apr_pool_t *subpool = NULL;
+
apr_file_printf(bundleIdFile, "%ld", archive->id);
// Ignore close status, let it fail if needed again
apr_file_close(bundleIdFile);
- apr_pool_t *subpool = NULL;
apr_pool_create(&subpool, archive->mp);
bundleLocation = (char *) apr_palloc(subpool, strlen(archive->archiveRoot) + 17);
Modified: incubator/celix/trunk/framework/private/src/bundle_cache.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle_cache.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_cache.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_cache.c Tue Nov 27 11:33:50 2012
@@ -76,7 +76,7 @@ celix_status_t bundleCache_create(PROPER
}
apr_status_t bundleCache_destroy(void *cacheP) {
- bundle_cache_t cache = cacheP;
+ bundle_cache_t cache = (bundle_cache_t) cacheP;
properties_destroy(cache->configurationMap);
return CELIX_SUCCESS;
}
@@ -91,7 +91,7 @@ celix_status_t bundleCache_getArchives(b
apr_dir_t *dir;
apr_status_t aprStatus = apr_dir_open(&dir, cache->cacheDir, pool);
- if (aprStatus == APR_ENOENT) {
+ if (APR_STATUS_IS_ENOENT(aprStatus)) {
apr_dir_make(cache->cacheDir, APR_UREAD|APR_UWRITE|APR_UEXECUTE, cache->mp);
aprStatus = apr_dir_open(&dir, cache->cacheDir, pool);
}
@@ -103,9 +103,10 @@ celix_status_t bundleCache_getArchives(b
while ((apr_dir_read(&dp, APR_FINFO_DIRENT|APR_FINFO_TYPE, dir)) == APR_SUCCESS) {
apr_pool_t *subpool = NULL;
- apr_pool_create(&subpool, pool);
+ char *archiveRoot = NULL;
- char * archiveRoot = (char *)apr_palloc(subpool, strlen(cache->cacheDir) + strlen(dp.name) + 2);
+ apr_pool_create(&subpool, pool);
+ archiveRoot = (char *)apr_palloc(subpool, strlen(cache->cacheDir) + strlen(dp.name) + 2);
strcpy(archiveRoot, cache->cacheDir);
strcat(archiveRoot, "/");
@@ -141,7 +142,6 @@ celix_status_t bundleCache_getArchives(b
celix_status_t bundleCache_createArchive(bundle_cache_t cache, apr_pool_t *bundlePool, long id, char * location, char *inputFile, bundle_archive_t *bundle_archive) {
celix_status_t status;
char *archiveRoot;
- bundle_archive_t archive;
if (cache && location && bundlePool) {
archiveRoot = apr_psprintf(bundlePool, "%s/bundle%ld", cache->cacheDir, id);
Modified: incubator/celix/trunk/framework/private/src/bundle_revision.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle_revision.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_revision.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_revision.c Tue Nov 27 11:33:50 2012
@@ -48,10 +48,11 @@ celix_status_t bundleRevision_create(apr
if (!revision) {
status = CELIX_ENOMEM;
} else {
+ apr_status_t apr_status;
apr_pool_pre_cleanup_register(pool, revision, bundleRevision_destroy);
// TODO: This overwrites an existing revision, is this supposed to happen?
- apr_status_t apr_status = apr_dir_make(root, APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool);
- if ((apr_status != APR_SUCCESS) && (apr_status != APR_EEXIST)) {
+ apr_status = apr_dir_make(root, APR_UREAD|APR_UWRITE|APR_UEXECUTE, pool);
+ if ((apr_status != APR_SUCCESS) && (!APR_STATUS_IS_EEXIST(apr_status))) {
status = CELIX_FILE_IO_EXCEPTION;
} else {
if (inputFile != NULL) {
Modified: incubator/celix/trunk/framework/private/src/celix_errorcodes.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/celix_errorcodes.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/celix_errorcodes.c (original)
+++ incubator/celix/trunk/framework/private/src/celix_errorcodes.c Tue Nov 27 11:33:50 2012
@@ -32,6 +32,7 @@ static char *celix_error_string(celix_st
case CELIX_ILLEGAL_ARGUMENT:
return "Illegal argument";
}
+ return "Unkown code";
}
char *celix_strerror(celix_status_t errorcode)
Modified: incubator/celix/trunk/framework/private/src/framework.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/framework.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/framework.c (original)
+++ incubator/celix/trunk/framework/private/src/framework.c Tue Nov 27 11:33:50 2012
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <dlfcn.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "celixbool.h"
@@ -40,8 +39,11 @@
#ifdef _WIN32
#include <winbase.h>
#include <windows.h>
+#else
+#include <dlfcn.h>
#endif
+
#include "framework.h"
#include "filter.h"
#include "constants.h"
@@ -304,6 +306,11 @@ celix_status_t framework_destroy(FRAMEWO
return status;
}
+typedef void *(*create_function_t)(bundle_context_t context, void **userData);
+typedef void (*start_function_t)(void * handle, bundle_context_t context);
+typedef void (*stop_function_t)(void * handle, bundle_context_t context);
+typedef void (*destroy_function_t)(void * handle, bundle_context_t context);
+
celix_status_t fw_init(FRAMEWORK framework) {
celix_status_t status = framework_acquireBundleLock(framework, framework->bundle, BUNDLE_INSTALLED|BUNDLE_RESOLVED|BUNDLE_STARTING|BUNDLE_ACTIVE);
BUNDLE_STATE state;
@@ -369,26 +376,26 @@ celix_status_t fw_init(FRAMEWORK framewo
#ifdef _WIN32
HMODULE this_process;
#endif
- int arcIdx;
+ unsigned int arcIdx;
void * handle;
bundle_context_t context = NULL;
ACTIVATOR activator;
for (arcIdx = 0; arcIdx < arrayList_size(archives); arcIdx++) {
- bundle_archive_t archive = (bundle_archive_t) arrayList_get(archives, arcIdx);
+ bundle_archive_t archive1 = (bundle_archive_t) arrayList_get(archives, arcIdx);
long id;
BUNDLE_STATE bundleState;
- bundleArchive_getId(archive, &id);
+ bundleArchive_getId(archive1, &id);
framework->nextBundleId = framework->nextBundleId > id + 1 ? framework->nextBundleId : id + 1;
- bundleArchive_getPersistentState(archive, &bundleState);
+ bundleArchive_getPersistentState(archive1, &bundleState);
if (bundleState == BUNDLE_UNINSTALLED) {
- bundleArchive_closeAndDelete(archive);
+ bundleArchive_closeAndDelete(archive1);
} else {
- BUNDLE bundle;
- char *location;
- status = bundleArchive_getLocation(archive, &location);
- fw_installBundle2(framework, &bundle, id, location, NULL, archive);
+ BUNDLE bundle = NULL;
+ char *location1 = NULL;
+ status = bundleArchive_getLocation(archive1, &location1);
+ fw_installBundle2(framework, &bundle, id, location1, NULL, archive1);
}
}
arrayList_destroy(archives);
@@ -405,7 +412,11 @@ celix_status_t fw_init(FRAMEWORK framewo
handle = dlopen(NULL, RTLD_LAZY|RTLD_LOCAL);
#endif
if (handle == NULL) {
+#ifdef _WIN32
+ printf ("%s\n", GetLastError());
+#else
printf ("%s\n", dlerror());
+#endif
framework_releaseBundleLock(framework, framework->bundle);
return CELIX_START_ERROR;
}
@@ -423,14 +434,17 @@ celix_status_t fw_init(FRAMEWORK framewo
} else {
bundle_context_t context = NULL;
void * userData = NULL;
- void * (*create)(bundle_context_t context);
- void (*start)(void * handle, bundle_context_t context);
- void (*stop)(void * handle, bundle_context_t context);
- void (*destroy)(void * handle, bundle_context_t context);
- create = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_CREATE);
- start = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_START);
- stop = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_STOP);
- destroy = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_DESTROY);
+#ifdef _WIN32
+ create_function_t create = (create_function_t) GetProcAddress((HMODULE) bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_CREATE);
+ start_function_t start = (start_function_t) GetProcAddress((HMODULE) bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_START);
+ stop_function_t stop = (stop_function_t) GetProcAddress((HMODULE) bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_STOP);
+ destroy_function_t destroy = (destroy_function_t) GetProcAddress((HMODULE) bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_DESTROY);
+#else
+ create_function_t create = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_CREATE);
+ start_function_t start = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_START);
+ stop_function_t stop = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_STOP);
+ destroy_function_t destroy = dlsym(bundle_getHandle(framework->bundle), BUNDLE_ACTIVATOR_DESTROY);
+#endif
activator->start = start;
activator->stop = stop;
activator->destroy = destroy;
@@ -438,8 +452,8 @@ celix_status_t fw_init(FRAMEWORK framewo
bundle_getContext(framework->bundle, &context);
- if (create != NULL) {
- userData = create(context);
+ if (create != NULL) {
+ create(context, &userData);
}
activator->userData = userData;
@@ -712,7 +726,11 @@ celix_status_t fw_startBundle(FRAMEWORK
handle = dlopen(libraryPath, RTLD_LAZY|RTLD_LOCAL);
#endif
if (handle == NULL) {
+#ifdef _WIN32
+ printf ("%s\n", GetLastError());
+#else
printf ("%s\n", dlerror());
+#endif
framework_releaseBundleLock(framework, bundle);
return CELIX_BUNDLE_EXCEPTION;
}
@@ -725,14 +743,19 @@ celix_status_t fw_startBundle(FRAMEWORK
} else {
void * userData = NULL;
bundle_context_t context;
- void * (*create)(bundle_context_t context, void **userData);
- void (*start)(void * userData, bundle_context_t context);
- void (*stop)(void * userData, bundle_context_t context);
- void (*destroy)(void * userData, bundle_context_t context);
- create = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_CREATE);
- start = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_START);
- stop = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_STOP);
- destroy = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_DESTROY);
+#ifdef _WIN32
+
+ create_function_t create = (create_function_t) GetProcAddress((HMODULE) bundle_getHandle(bundle), BUNDLE_ACTIVATOR_CREATE);
+ start_function_t start = (start_function_t) GetProcAddress((HMODULE) bundle_getHandle(bundle), BUNDLE_ACTIVATOR_START);
+ stop_function_t stop = (stop_function_t) GetProcAddress((HMODULE) bundle_getHandle(bundle), BUNDLE_ACTIVATOR_STOP);
+ destroy_function_t destroy = (destroy_function_t) GetProcAddress((HMODULE) bundle_getHandle(bundle), BUNDLE_ACTIVATOR_DESTROY);
+#else
+ create_function_t create = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_CREATE);
+ start_function_t start = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_START);
+ stop_function_t stop = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_STOP);
+ destroy_function_t destroy = dlsym(bundle_getHandle(bundle), BUNDLE_ACTIVATOR_DESTROY);
+#endif
+
activator->start = start;
activator->stop = stop;
activator->destroy = destroy;
@@ -1092,7 +1115,7 @@ celix_status_t fw_getDependentBundles(FR
if (*list == NULL && exporter != NULL && framework != NULL) {
ARRAY_LIST modules;
- int modIdx = 0;
+ unsigned int modIdx = 0;
apr_pool_t *pool = NULL;
bundle_getMemoryPool(exporter, &pool);
arrayList_create(pool, list);
@@ -1101,7 +1124,7 @@ celix_status_t fw_getDependentBundles(FR
for (modIdx = 0; modIdx < arrayList_size(modules); modIdx++) {
MODULE module = arrayList_get(modules, modIdx);
ARRAY_LIST dependents = module_getDependents(module);
- int depIdx = 0;
+ unsigned int depIdx = 0;
for (depIdx = 0; (dependents != NULL) && (depIdx < arrayList_size(dependents)); depIdx++) {
MODULE dependent = arrayList_get(dependents, depIdx);
arrayList_add(*list, module_getBundle(dependent));
@@ -1121,7 +1144,7 @@ celix_status_t fw_populateDependentGraph
if (exporter != NULL && framework != NULL) {
ARRAY_LIST dependents = NULL;
if ((status = fw_getDependentBundles(framework, exporter, &dependents)) == CELIX_SUCCESS) {
- int depIdx = 0;
+ unsigned int depIdx = 0;
for (depIdx = 0; (dependents != NULL) && (depIdx < arrayList_size(dependents)); depIdx++) {
if (!hashMap_containsKey(*map, arrayList_get(dependents, depIdx))) {
hashMap_put(*map, arrayList_get(dependents, depIdx), arrayList_get(dependents, depIdx));
@@ -1158,7 +1181,7 @@ celix_status_t fw_registerService(FRAMEW
// If this is a listener hook, invoke the callback with all current listeners
if (strcmp(serviceName, listener_hook_service_name) == 0) {
- int i;
+ unsigned int i;
ARRAY_LIST infos = NULL;
apr_pool_t *subpool;
SERVICE_REFERENCE ref = NULL;
@@ -1224,7 +1247,7 @@ celix_status_t fw_registerServiceFactory
celix_status_t fw_getServiceReferences(FRAMEWORK framework, ARRAY_LIST *references, BUNDLE bundle, const char * serviceName, char * sfilter) {
filter_t filter = NULL;
- int refIdx = 0;
+ unsigned int refIdx = 0;
apr_pool_t *pool = NULL;
bundle_getMemoryPool(bundle, &pool);
@@ -1284,7 +1307,7 @@ void fw_addServiceListener(FRAMEWORK fra
ARRAY_LIST listenerHooks = NULL;
apr_pool_t *subpool;
listener_hook_info_t info;
- int i;
+ unsigned int i;
FW_SERVICE_LISTENER fwListener = (FW_SERVICE_LISTENER) malloc(sizeof(*fwListener));
apr_pool_t *pool = NULL;
@@ -1365,7 +1388,7 @@ void fw_removeServiceListener(FRAMEWORK
}
if (info != NULL) {
- int i;
+ unsigned int i;
ARRAY_LIST listenerHooks = NULL;
serviceRegistry_getListenerHooks(framework->registry, pool, &listenerHooks);
@@ -1410,7 +1433,7 @@ celix_status_t fw_addBundleListener(FRAM
celix_status_t fw_removeBundleListener(FRAMEWORK framework, BUNDLE bundle, bundle_listener_t listener) {
celix_status_t status = CELIX_SUCCESS;
- int i;
+ unsigned int i;
fw_bundle_listener_t bundleListener;
for (i = 0; i < arrayList_size(framework->bundleListeners); i++) {
@@ -1455,10 +1478,11 @@ void fw_serviceChanged(FRAMEWORK framewo
element->listener->serviceChanged(element->listener, event);
} else if (eventType == MODIFIED) {
bool matchResult = false;
+ int matched = 0;
if (element->filter != NULL) {
filter_match(element->filter, oldprops, &matchResult);
}
- int matched = (element->filter == NULL) || matchResult;
+ matched = (element->filter == NULL) || matchResult;
if (matched) {
SERVICE_REFERENCE reference = NULL;
SERVICE_EVENT endmatch = (SERVICE_EVENT) malloc(sizeof(*endmatch));
@@ -1769,7 +1793,7 @@ celix_status_t framework_releaseGlobalLo
return CELIX_FRAMEWORK_EXCEPTION;
}
- if (framework->globalLockThread == pthread_self()) {
+ if (framework->globalLockThread == apr_os_thread_current()) {
framework->globalLockCount--;
if (framework->globalLockCount == 0) {
framework->globalLockThread = 0;
@@ -1934,12 +1958,15 @@ static void *APR_THREAD_FUNC fw_eventDis
request_t request = NULL;
while (true) {
+ int size;
+ apr_status_t status;
+
if (apr_thread_mutex_lock(framework->dispatcherLock) != 0) {
celix_log("Error locking the dispatcher");
return NULL;
}
- int size = arrayList_size(framework->requests);
+ size = arrayList_size(framework->requests);
while (size == 0 && !framework->shutdown) {
apr_status_t apr_status = apr_thread_cond_wait(framework->dispatcher, framework->dispatcherLock);
// Ignore status and just keep waiting
@@ -1950,10 +1977,9 @@ static void *APR_THREAD_FUNC fw_eventDis
apr_thread_exit(thd, APR_SUCCESS);
return NULL;
}
+
+ request = (request_t) arrayList_remove(framework->requests, 0);
- request = arrayList_remove(framework->requests, 0);
-
- apr_status_t status;
if ((status = apr_thread_mutex_unlock(framework->dispatcherLock)) != 0) {
celix_log("Error unlocking the dispatcher.");
apr_thread_exit(thd, status);
Modified: incubator/celix/trunk/framework/private/src/manifest.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/manifest.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/manifest.c (original)
+++ incubator/celix/trunk/framework/private/src/manifest.c Tue Nov 27 11:33:50 2012
@@ -96,10 +96,11 @@ celix_status_t manifest_read(MANIFEST ma
int len;
char * name = NULL;
bool skipEmptyLines = true;
- char * lastline;
- manifest_readAttributes(manifest, manifest->mainAttributes, file);
-
+ char * lastline = NULL;
apr_pool_t *subpool;
+
+ manifest_readAttributes(manifest, manifest->mainAttributes, file);
+
apr_pool_create(&subpool, manifest->pool);
while (fgets(lbuf, sizeof(lbuf), file) != NULL ) {
PROPERTIES attributes;
Modified: incubator/celix/trunk/framework/private/src/manifest_parser.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/manifest_parser.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/manifest_parser.c (original)
+++ incubator/celix/trunk/framework/private/src/manifest_parser.c Tue Nov 27 11:33:50 2012
@@ -106,7 +106,7 @@ static LINKED_LIST manifestParser_parseD
char * buffer = (char *) apr_pcalloc(temp_pool, sizeof(char) * 512);
if (buffer != NULL) {
int expecting = (CHAR | DELIMITER | STARTQUOTE);
- int i;
+ unsigned int i;
buffer[0] = '\0';
Modified: incubator/celix/trunk/framework/private/src/miniunz.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/miniunz.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/miniunz.c (original)
+++ incubator/celix/trunk/framework/private/src/miniunz.c Tue Nov 27 11:33:50 2012
@@ -50,8 +50,7 @@
#ifdef _WIN32
#define USEWIN32IOAPI
-#include <windows.h>
-#include <winbase.h>
+#include "iowin32.h"
#endif
/*
mini unzip, demo of unzip package
Modified: incubator/celix/trunk/framework/private/src/service_registration.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_registration.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_registration.c (original)
+++ incubator/celix/trunk/framework/private/src/service_registration.c Tue Nov 27 11:33:50 2012
@@ -78,7 +78,6 @@ SERVICE_REGISTRATION serviceRegistration
celix_status_t serviceRegistration_createInternal(apr_pool_t *pool, SERVICE_REGISTRY registry, BUNDLE bundle, char * serviceName, long serviceId,
void * serviceObject, PROPERTIES dictionary, bool isFactory, SERVICE_REGISTRATION *registration) {
celix_status_t status = CELIX_SUCCESS;
- SERVICE_REFERENCE reference;
*registration = (SERVICE_REGISTRATION) apr_palloc(pool, sizeof(**registration));
(*registration)->isServiceFactory = isFactory;
Modified: incubator/celix/trunk/framework/private/src/service_registry.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_registry.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_registry.c (original)
+++ incubator/celix/trunk/framework/private/src/service_registry.c Tue Nov 27 11:33:50 2012
@@ -63,10 +63,10 @@ celix_status_t serviceRegistry_removeHoo
apr_status_t serviceRegistry_removeReference(void *referenceP);
USAGE_COUNT serviceRegistry_getUsageCount(SERVICE_REGISTRY registry, BUNDLE bundle, SERVICE_REFERENCE reference) {
- ARRAY_LIST usages = hashMap_get(registry->inUseMap, bundle);
- int i;
+ ARRAY_LIST usages = (ARRAY_LIST) hashMap_get(registry->inUseMap, bundle);
+ unsigned int i;
for (i = 0; (usages != NULL) && (i < arrayList_size(usages)); i++) {
- USAGE_COUNT usage = arrayList_get(usages, i);
+ USAGE_COUNT usage = (USAGE_COUNT) arrayList_get(usages, i);
if (usage->reference == reference) {
return usage;
}
@@ -150,7 +150,7 @@ celix_status_t serviceRegistry_getRegist
ARRAY_LIST regs = (ARRAY_LIST) hashMap_get(registry->serviceRegistrations, bundle);
if (regs != NULL) {
- int i;
+ unsigned int i;
arrayList_create(pool, services);
for (i = 0; i < arrayList_size(regs); i++) {
@@ -208,7 +208,7 @@ celix_status_t serviceRegistry_registerS
// SERVICE_EVENT event = (SERVICE_EVENT) malloc(sizeof(*event));
// event->type = REGISTERED;
// event->reference = (*registration)->reference;
- registry->serviceChanged(registry->framework, REGISTERED, *registration, NULL);
+ registry->serviceChanged(registry->framework, REGISTEREDA, *registration, NULL);
// free(event);
// event = NULL;
}
@@ -217,8 +217,8 @@ celix_status_t serviceRegistry_registerS
}
void serviceRegistry_unregisterService(SERVICE_REGISTRY registry, BUNDLE bundle, SERVICE_REGISTRATION registration) {
- ARRAY_LIST clients;
- int i;
+ // ARRAY_LIST clients;
+ unsigned int i;
ARRAY_LIST regs;
ARRAY_LIST references = NULL;
@@ -243,14 +243,15 @@ void serviceRegistry_unregisterService(S
serviceRegistration_getServiceReferences(registration, &references);
for (i = 0; i < arrayList_size(references); i++) {
- SERVICE_REFERENCE reference = arrayList_get(references, i);
+ SERVICE_REFERENCE reference = (SERVICE_REFERENCE) arrayList_get(references, i);
apr_pool_t *pool = NULL;
+ ARRAY_LIST clients = NULL;
+ unsigned int j;
framework_getMemoryPool(registry->framework, &pool);
- ARRAY_LIST clients = serviceRegistry_getUsingBundles(registry, pool, reference);
- int j;
+ clients = serviceRegistry_getUsingBundles(registry, pool, reference);
for (j = 0; (clients != NULL) && (j < arrayList_size(clients)); j++) {
- BUNDLE client = arrayList_get(clients, j);
+ BUNDLE client = (BUNDLE) arrayList_get(clients, j);
while (serviceRegistry_ungetService(registry, client, reference)) {
;
}
@@ -269,7 +270,7 @@ void serviceRegistry_unregisterService(S
void serviceRegistry_unregisterServices(SERVICE_REGISTRY registry, BUNDLE bundle) {
ARRAY_LIST regs = NULL;
- int i;
+ unsigned int i;
apr_thread_mutex_lock(registry->mutex);
regs = (ARRAY_LIST) hashMap_get(registry->serviceRegistrations, bundle);
apr_thread_mutex_unlock(registry->mutex);
@@ -322,7 +323,7 @@ celix_status_t serviceRegistry_getServic
iterator = hashMapValues_iterator(registrations);
while (hashMapIterator_hasNext(iterator)) {
ARRAY_LIST regs = (ARRAY_LIST) hashMapIterator_nextValue(iterator);
- int regIdx;
+ unsigned int regIdx;
for (regIdx = 0; (regs != NULL) && regIdx < arrayList_size(regs); regIdx++) {
SERVICE_REGISTRATION registration = (SERVICE_REGISTRATION) arrayList_get(regs, regIdx);
PROPERTIES props = NULL;
@@ -380,7 +381,7 @@ apr_status_t serviceRegistry_removeRefer
ARRAY_LIST serviceRegistry_getServicesInUse(SERVICE_REGISTRY registry, BUNDLE bundle) {
ARRAY_LIST usages = hashMap_get(registry->inUseMap, bundle);
if (usages != NULL) {
- int i;
+ unsigned int i;
ARRAY_LIST references = NULL;
apr_pool_t *pool = NULL;
bundle_getMemoryPool(bundle, &pool);
@@ -456,7 +457,7 @@ bool serviceRegistry_ungetService(SERVIC
void serviceRegistry_ungetServices(SERVICE_REGISTRY registry, BUNDLE bundle) {
ARRAY_LIST fusages;
ARRAY_LIST usages;
- int i;
+ unsigned int i;
apr_pool_t *pool = NULL;
bundle_getMemoryPool(bundle, &pool);
@@ -494,7 +495,7 @@ ARRAY_LIST serviceRegistry_getUsingBundl
HASH_MAP_ENTRY entry = hashMapIterator_nextEntry(iter);
BUNDLE bundle = hashMapEntry_getKey(entry);
ARRAY_LIST usages = hashMapEntry_getValue(entry);
- int i;
+ unsigned int i;
for (i = 0; i < arrayList_size(usages); i++) {
USAGE_COUNT usage = arrayList_get(usages, i);
if (usage->reference == reference) {
@@ -518,10 +519,11 @@ celix_status_t serviceRegistry_addHooks(
celix_status_t serviceRegistry_removeHook(SERVICE_REGISTRY registry, SERVICE_REGISTRATION registration) {
celix_status_t status = CELIX_SUCCESS;
+ char *serviceName = NULL;
PROPERTIES props = NULL;
serviceRegistration_getProperties(registration, &props);
- char *serviceName = properties_get(props, (char *) OBJECTCLASS);
+ serviceName = properties_get(props, (char *) OBJECTCLASS);
if (strcmp(listener_hook_service_name, serviceName) == 0) {
arrayList_removeElement(registry->listenerHooks, registration);
}
@@ -537,7 +539,7 @@ celix_status_t serviceRegistry_getListen
} else {
status = arrayList_create(pool, hooks);
if (status == CELIX_SUCCESS) {
- int i;
+ unsigned int i;
for (i = 0; i < arrayList_size(registry->listenerHooks); i++) {
SERVICE_REGISTRATION registration = arrayList_get(registry->listenerHooks, i);
SERVICE_REFERENCE reference = NULL;
Modified: incubator/celix/trunk/framework/private/src/service_tracker.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/service_tracker.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/service_tracker.c (original)
+++ incubator/celix/trunk/framework/private/src/service_tracker.c Tue Nov 27 11:33:50 2012
@@ -148,9 +148,9 @@ celix_status_t serviceTracker_close(serv
if (status == CELIX_SUCCESS) {
ARRAY_LIST refs = serviceTracker_getServiceReferences(tracker);
if (refs != NULL) {
- int i;
+ unsigned int i;
for (i = 0; i < arrayList_size(refs); i++) {
- SERVICE_REFERENCE ref = arrayList_get(refs, i);
+ SERVICE_REFERENCE ref = (SERVICE_REFERENCE) arrayList_get(refs, i);
status = serviceTracker_untrack(tracker, ref, NULL);
}
}
@@ -225,7 +225,7 @@ void *serviceTracker_getServiceByReferen
void serviceTracker_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event) {
service_tracker_t tracker = listener->handle;
switch (event->type) {
- case REGISTERED:
+ case REGISTEREDA:
case MODIFIED:
serviceTracker_track(tracker, event->reference, event);
break;
@@ -308,7 +308,7 @@ celix_status_t serviceTracker_untrack(se
celix_status_t status = CELIX_SUCCESS;
TRACKED tracked = NULL;
unsigned int i;
- bool result = NULL;
+ bool result = false;
for (i = 0; i < arrayList_size(tracker->tracked); i++) {
bool equals;
Modified: incubator/celix/trunk/framework/private/src/utils.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/utils.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/utils.c (original)
+++ incubator/celix/trunk/framework/private/src/utils.c Tue Nov 27 11:33:50 2012
@@ -34,7 +34,7 @@ unsigned int string_hash(void * string)
unsigned int hash = 1315423911;
unsigned int i = 0;
- int len = strlen(str);
+ unsigned int len = strlen(str);
for(i = 0; i < len; str++, i++)
{
Modified: incubator/celix/trunk/framework/private/src/version.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/version.c?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/version.c (original)
+++ incubator/celix/trunk/framework/private/src/version.c Tue Nov 27 11:33:50 2012
@@ -50,7 +50,7 @@ celix_status_t version_createVersion(apr
if (!*version) {
status = CELIX_ENOMEM;
} else {
- int i;
+ unsigned int i;
apr_pool_pre_cleanup_register(pool, *version, version_destroy);
(*version)->pool = pool;
Modified: incubator/celix/trunk/framework/public/include/bundle.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle.h?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/bundle.h (original)
+++ incubator/celix/trunk/framework/public/include/bundle.h Tue Nov 27 11:33:50 2012
@@ -39,63 +39,62 @@ typedef struct bundle * BUNDLE;
#include "service_reference.h"
#include "bundle_context.h"
-celix_status_t bundle_create(BUNDLE * bundle, apr_pool_t *mp);
-celix_status_t bundle_createFromArchive(BUNDLE * bundle, FRAMEWORK framework, bundle_archive_t archive, apr_pool_t *bundlePool);
-celix_status_t bundle_destroy(BUNDLE bundle);
-
-celix_status_t bundle_isSystemBundle(BUNDLE bundle, bool *systemBundle);
-celix_status_t bundle_getArchive(BUNDLE bundle, bundle_archive_t *archive);
-celix_status_t bundle_getCurrentModule(BUNDLE bundle, MODULE *module);
-ARRAY_LIST bundle_getModules(BUNDLE bundle);
-void * bundle_getHandle(BUNDLE bundle);
-void bundle_setHandle(BUNDLE bundle, void * handle);
-ACTIVATOR bundle_getActivator(BUNDLE bundle);
-celix_status_t bundle_setActivator(BUNDLE bundle, ACTIVATOR activator);
-celix_status_t bundle_getManifest(BUNDLE bundle, MANIFEST *manifest);
-celix_status_t bundle_setManifest(BUNDLE bundle, MANIFEST manifest);
-celix_status_t bundle_getContext(BUNDLE bundle, bundle_context_t *context);
-celix_status_t bundle_setContext(BUNDLE bundle, bundle_context_t context);
-celix_status_t bundle_getEntry(BUNDLE bundle, char * name, apr_pool_t *pool, char **entry);
-
-celix_status_t bundle_start(BUNDLE bundle, int options);
-celix_status_t bundle_update(BUNDLE bundle, char *inputFile);
-celix_status_t bundle_stop(BUNDLE bundle, int options);
-celix_status_t bundle_uninstall(BUNDLE bundle);
-
-celix_status_t bundle_setState(BUNDLE bundle, BUNDLE_STATE state);
-celix_status_t bundle_setPersistentStateInactive(BUNDLE bundle);
-celix_status_t bundle_setPersistentStateUninstalled(BUNDLE bundle);
-
-void uninstallBundle(BUNDLE bundle);
-
-celix_status_t bundle_revise(BUNDLE bundle, char * location, char *inputFile);
-celix_status_t bundle_addModule(BUNDLE bundle, MODULE module);
-celix_status_t bundle_closeModules(BUNDLE bundle);
+FRAMEWORK_EXPORT celix_status_t bundle_create(BUNDLE * bundle, apr_pool_t *mp);
+FRAMEWORK_EXPORT celix_status_t bundle_createFromArchive(BUNDLE * bundle, FRAMEWORK framework, bundle_archive_t archive, apr_pool_t *bundlePool);
+FRAMEWORK_EXPORT celix_status_t bundle_destroy(BUNDLE bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_isSystemBundle(BUNDLE bundle, bool *systemBundle);
+FRAMEWORK_EXPORT celix_status_t bundle_getArchive(BUNDLE bundle, bundle_archive_t *archive);
+FRAMEWORK_EXPORT celix_status_t bundle_getCurrentModule(BUNDLE bundle, MODULE *module);
+FRAMEWORK_EXPORT ARRAY_LIST bundle_getModules(BUNDLE bundle);
+FRAMEWORK_EXPORT void * bundle_getHandle(BUNDLE bundle);
+FRAMEWORK_EXPORT void bundle_setHandle(BUNDLE bundle, void * handle);
+FRAMEWORK_EXPORT ACTIVATOR bundle_getActivator(BUNDLE bundle);
+FRAMEWORK_EXPORT celix_status_t bundle_setActivator(BUNDLE bundle, ACTIVATOR activator);
+FRAMEWORK_EXPORT celix_status_t bundle_getManifest(BUNDLE bundle, MANIFEST *manifest);
+FRAMEWORK_EXPORT celix_status_t bundle_setManifest(BUNDLE bundle, MANIFEST manifest);
+FRAMEWORK_EXPORT celix_status_t bundle_getContext(BUNDLE bundle, bundle_context_t *context);
+FRAMEWORK_EXPORT celix_status_t bundle_setContext(BUNDLE bundle, bundle_context_t context);
+FRAMEWORK_EXPORT celix_status_t bundle_getEntry(BUNDLE bundle, char * name, apr_pool_t *pool, char **entry);
+
+FRAMEWORK_EXPORT celix_status_t bundle_start(BUNDLE bundle, int options);
+FRAMEWORK_EXPORT celix_status_t bundle_update(BUNDLE bundle, char *inputFile);
+FRAMEWORK_EXPORT celix_status_t bundle_stop(BUNDLE bundle, int options);
+FRAMEWORK_EXPORT celix_status_t bundle_uninstall(BUNDLE bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_setState(BUNDLE bundle, BUNDLE_STATE state);
+FRAMEWORK_EXPORT celix_status_t bundle_setPersistentStateInactive(BUNDLE bundle);
+FRAMEWORK_EXPORT celix_status_t bundle_setPersistentStateUninstalled(BUNDLE bundle);
+
+FRAMEWORK_EXPORT void uninstallBundle(BUNDLE bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_revise(BUNDLE bundle, char * location, char *inputFile);
+FRAMEWORK_EXPORT celix_status_t bundle_addModule(BUNDLE bundle, MODULE module);
+FRAMEWORK_EXPORT celix_status_t bundle_closeModules(BUNDLE bundle);
// Service Reference Functions
-ARRAY_LIST getUsingBundles(SERVICE_REFERENCE reference);
+FRAMEWORK_EXPORT ARRAY_LIST getUsingBundles(SERVICE_REFERENCE reference);
-int compareTo(SERVICE_REFERENCE a, SERVICE_REFERENCE b);
+FRAMEWORK_EXPORT int compareTo(SERVICE_REFERENCE a, SERVICE_REFERENCE b);
+FRAMEWORK_EXPORT celix_status_t bundle_getState(BUNDLE bundle, BUNDLE_STATE *state);
+FRAMEWORK_EXPORT celix_status_t bundle_isLockable(BUNDLE bundle, bool *lockable);
+FRAMEWORK_EXPORT celix_status_t bundle_getLockingThread(BUNDLE bundle, apr_os_thread_t *thread);
+FRAMEWORK_EXPORT celix_status_t bundle_lock(BUNDLE bundle, bool *locked);
+FRAMEWORK_EXPORT celix_status_t bundle_unlock(BUNDLE bundle, bool *unlocked);
-celix_status_t bundle_getState(BUNDLE bundle, BUNDLE_STATE *state);
-celix_status_t bundle_isLockable(BUNDLE bundle, bool *lockable);
-celix_status_t bundle_getLockingThread(BUNDLE bundle, apr_os_thread_t *thread);
-celix_status_t bundle_lock(BUNDLE bundle, bool *locked);
-celix_status_t bundle_unlock(BUNDLE bundle, bool *unlocked);
+FRAMEWORK_EXPORT celix_status_t bundle_closeAndDelete(BUNDLE bundle);
+FRAMEWORK_EXPORT celix_status_t bundle_close(BUNDLE bundle);
-celix_status_t bundle_closeAndDelete(BUNDLE bundle);
-celix_status_t bundle_close(BUNDLE bundle);
+FRAMEWORK_EXPORT celix_status_t bundle_refresh(BUNDLE bundle);
+FRAMEWORK_EXPORT celix_status_t bundle_getBundleId(BUNDLE bundle, long *id);
-celix_status_t bundle_refresh(BUNDLE bundle);
-celix_status_t bundle_getBundleId(BUNDLE bundle, long *id);
+FRAMEWORK_EXPORT celix_status_t bundle_getRegisteredServices(BUNDLE bundle, apr_pool_t *pool, ARRAY_LIST *list);
+FRAMEWORK_EXPORT celix_status_t bundle_getServicesInUse(BUNDLE bundle, ARRAY_LIST *list);
-celix_status_t bundle_getRegisteredServices(BUNDLE bundle, apr_pool_t *pool, ARRAY_LIST *list);
-celix_status_t bundle_getServicesInUse(BUNDLE bundle, ARRAY_LIST *list);
+FRAMEWORK_EXPORT celix_status_t bundle_getMemoryPool(BUNDLE bundle, apr_pool_t **pool);
-celix_status_t bundle_getMemoryPool(BUNDLE bundle, apr_pool_t **pool);
-
-celix_status_t bundle_setFramework(BUNDLE bundle, FRAMEWORK framework);
-celix_status_t bundle_getFramework(BUNDLE bundle, FRAMEWORK *framework);
+FRAMEWORK_EXPORT celix_status_t bundle_setFramework(BUNDLE bundle, FRAMEWORK framework);
+FRAMEWORK_EXPORT celix_status_t bundle_getFramework(BUNDLE bundle, FRAMEWORK *framework);
#endif /* BUNDLE_H_ */
Modified: incubator/celix/trunk/framework/public/include/bundle_activator.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/bundle_activator.h?rev=1414132&r1=1414131&r2=1414132&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/bundle_activator.h (original)
+++ incubator/celix/trunk/framework/public/include/bundle_activator.h Tue Nov 27 11:33:50 2012
@@ -38,6 +38,7 @@
#define BUNDLE_ACTIVATOR_H_
#include "bundle_context.h"
+#include "framework_exports.h"
/**
* Called when this bundle is started so the bundle can create an instance for its activator.
@@ -53,7 +54,7 @@
* - Any other status code will mark the bundle as stopped and the framework will remove this
* bundle's listeners, unregister all services, and release all services used by this bundle.
*/
-celix_status_t bundleActivator_create(bundle_context_t context, void **userData);
+FRAMEWORK_EXPORT celix_status_t bundleActivator_create(bundle_context_t context, void **userData);
/**
* Called when this bundle is started so the Framework can perform the bundle-specific activities necessary
@@ -71,7 +72,7 @@ celix_status_t bundleActivator_create(bu
* - Any other status code will mark the bundle as stopped and the framework will remove this
* bundle's listeners, unregister all services, and release all services used by this bundle.
*/
-celix_status_t bundleActivator_start(void * userData, bundle_context_t context);
+FRAMEWORK_EXPORT celix_status_t bundleActivator_start(void * userData, bundle_context_t context);
/**
* Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary
@@ -90,7 +91,7 @@ celix_status_t bundleActivator_start(voi
* - Any other status code will mark the bundle as stopped and the framework will remove this
* bundle's listeners, unregister all services, and release all services used by this bundle.
*/
-celix_status_t bundleActivator_stop(void * userData, bundle_context_t context);
+FRAMEWORK_EXPORT celix_status_t bundleActivator_stop(void * userData, bundle_context_t context);
/**
* Called when this bundle is stopped so the bundle can destroy the instance of its activator. In general, this
@@ -107,7 +108,7 @@ celix_status_t bundleActivator_stop(void
* - Any other status code will mark the bundle as stopped and the framework will remove this
* bundle's listeners, unregister all services, and release all services used by this bundle.
*/
-celix_status_t bundleActivator_destroy(void * userData, bundle_context_t context);
+FRAMEWORK_EXPORT celix_status_t bundleActivator_destroy(void * userData, bundle_context_t context);
#endif /* BUNDLE_ACTIVATOR_H_ */