http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/dependency_manager/src/dm_service_dependency.c ---------------------------------------------------------------------- diff --git a/dependency_manager/src/dm_service_dependency.c b/dependency_manager/src/dm_service_dependency.c new file mode 100644 index 0000000..65a0593 --- /dev/null +++ b/dependency_manager/src/dm_service_dependency.c @@ -0,0 +1,811 @@ +/** + *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. + */ +/* + * dm_service_dependency.c + * + * \date 17 Oct 2014 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <limits.h> +#include <assert.h> + +#include "constants.h" + +#include "dm_service_dependency_impl.h" +#include "dm_component_impl.h" + +#define DEFAULT_RANKING 0 +#define DM_SERVICE_DEPENDENCY_DEFAULT_STRATEGY DM_SERVICE_DEPENDENCY_STRATEGY_SUSPEND + +static celix_status_t serviceDependency_addedService(void *_ptr, service_reference_pt reference, void *service); +static celix_status_t serviceDependency_modifiedService(void *_ptr, service_reference_pt reference, void *service); +static celix_status_t serviceDependency_removedService(void *_ptr, service_reference_pt reference, void *service); +static void* serviceDependency_getCallbackHandle(dm_service_dependency_pt dep); + +celix_status_t serviceDependency_create(dm_service_dependency_pt *dependency_ptr) { + celix_status_t status = CELIX_SUCCESS; + + *dependency_ptr = calloc(1, sizeof(**dependency_ptr)); + if (!*dependency_ptr) { + status = CELIX_ENOMEM; + } else { + (*dependency_ptr)->component = NULL; + (*dependency_ptr)->available = false; + (*dependency_ptr)->instanceBound = false; + (*dependency_ptr)->required = false; + (*dependency_ptr)->strategy = DM_SERVICE_DEPENDENCY_DEFAULT_STRATEGY; + + (*dependency_ptr)->callbackHandle = NULL; + (*dependency_ptr)->set = NULL; + (*dependency_ptr)->add = NULL; + (*dependency_ptr)->change = NULL; + (*dependency_ptr)->remove = NULL; + (*dependency_ptr)->swap = NULL; + + (*dependency_ptr)->add_with_ref = NULL; + (*dependency_ptr)->change_with_ref = NULL; + (*dependency_ptr)->remove_with_ref = NULL; + (*dependency_ptr)->swap_with_ref = NULL; + + (*dependency_ptr)->autoConfigure = NULL; + + (*dependency_ptr)->isStarted = false; + + (*dependency_ptr)->addCLanguageFilter = false; + (*dependency_ptr)->tracked_service = NULL; + (*dependency_ptr)->tracked_filter_unmodified = NULL; + (*dependency_ptr)->tracked_filter = NULL; + + (*dependency_ptr)->tracker = NULL; + (*dependency_ptr)->tracker_customizer = NULL; + } + + return status; +} + +celix_status_t serviceDependency_destroy(dm_service_dependency_pt *dependency_ptr) { + celix_status_t status = CELIX_SUCCESS; + + if (!*dependency_ptr) { + status = CELIX_ENOMEM; + } + + if (status == CELIX_SUCCESS) { + free((*dependency_ptr)->tracked_service); + free((*dependency_ptr)->tracked_filter); + free((*dependency_ptr)->tracked_filter_unmodified); + free(*dependency_ptr); + *dependency_ptr = NULL; + } + + return status; +} + +celix_status_t serviceDependency_lock(dm_service_dependency_pt dependency) { + celixThreadMutex_lock(&dependency->lock); + return CELIX_SUCCESS; +} + +celix_status_t serviceDependency_unlock(dm_service_dependency_pt dependency) { + celixThreadMutex_unlock(&dependency->lock); + return CELIX_SUCCESS; +} + +celix_status_t serviceDependency_setRequired(dm_service_dependency_pt dependency, bool required) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->required = required; + } + + return status; +} + +celix_status_t serviceDependency_setAddCLanguageFilter(dm_service_dependency_pt dependency, bool addCLangFilter) { + dependency->addCLanguageFilter = addCLangFilter; + return CELIX_SUCCESS; +} + +celix_status_t serviceDependency_setStrategy(dm_service_dependency_pt dependency, dm_service_dependency_strategy_t strategy) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } else { + dependency->strategy = strategy; + } + + return status; +} + +celix_status_t serviceDependency_getStrategy(dm_service_dependency_pt dependency, dm_service_dependency_strategy_t* strategy) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } else { + *strategy = dependency->strategy; + } + + return status; + +} + +celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency, const char* serviceName, const char* serviceVersionRange, const char* filter) { + celix_status_t status = CELIX_SUCCESS; + if (!dependency || !serviceName) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + array_list_pt filterElements = NULL; + arrayList_create(&filterElements); + + free(dependency->tracked_service); + dependency->tracked_service = strdup(serviceName); + + if (serviceVersionRange != NULL) { + version_range_pt versionRange = NULL; + + if (versionRange_parse(serviceVersionRange, &versionRange) == CELIX_SUCCESS) { + version_pt lowVersion = NULL; + version_pt highVersion = NULL; + + if ((versionRange_getHighVersion(versionRange, &highVersion) == CELIX_SUCCESS) && (highVersion != NULL)) { + bool isHighInclusive; + char* highOperator; + char* highVersionStr = NULL; + + versionRange_isHighInclusive(versionRange, &isHighInclusive); + version_toString(highVersion, &highVersionStr); + + highOperator = isHighInclusive ? "<=" : "<"; + + if(highVersionStr != NULL){ + size_t len = strlen(CELIX_FRAMEWORK_SERVICE_VERSION) + strlen(highVersionStr) + strlen(highOperator) + 3; + char serviceVersionFilter[len]; + snprintf(serviceVersionFilter, len, "(%s%s%s)", CELIX_FRAMEWORK_SERVICE_VERSION, highOperator, highVersionStr); + arrayList_add(filterElements, strdup(serviceVersionFilter)); + free(highVersionStr); + } + } + + if ((versionRange_getLowVersion(versionRange, &lowVersion) == CELIX_SUCCESS) && (lowVersion != NULL)) { + bool isLowInclusive; + char* lowOperator; + char* lowVersionStr = NULL; + + versionRange_isLowInclusive(versionRange, &isLowInclusive); + version_toString(lowVersion, &lowVersionStr); + + lowOperator = isLowInclusive ? ">=" : ">"; + + if(lowVersionStr != NULL){ + size_t len = strlen(CELIX_FRAMEWORK_SERVICE_VERSION) + strlen(lowVersionStr) + strlen(lowOperator) + 3; + char serviceVersionFilter[len]; + snprintf(serviceVersionFilter, len, "(%s%s%s)", CELIX_FRAMEWORK_SERVICE_VERSION, lowOperator, lowVersionStr); + arrayList_add(filterElements, strdup(serviceVersionFilter)); + free(lowVersionStr); + } + } + } + + if(versionRange!=NULL){ + versionRange_destroy(versionRange); + } + } + + if (filter != NULL) { + free(dependency->tracked_filter_unmodified); + dependency->tracked_filter_unmodified = strdup(filter); + arrayList_add(filterElements, strdup(filter)); + } + + + + bool needLangFilter = true; + if (filter != NULL) { + char needle[128]; + snprintf(needle, sizeof(needle), "(%s=", CELIX_FRAMEWORK_SERVICE_LANGUAGE); + if (strstr(filter, needle) != NULL) { + needLangFilter = false; + } + } + + if (needLangFilter && dependency->addCLanguageFilter) { + char langFilter[128]; + snprintf(langFilter, sizeof(langFilter), "(%s=%s)", CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE); + arrayList_add(filterElements, strdup(langFilter)); + } + + if (arrayList_size(filterElements) > 0) { + array_list_iterator_pt filterElementsIter = arrayListIterator_create(filterElements); + + size_t len = strlen(serviceName) + strlen(OSGI_FRAMEWORK_OBJECTCLASS) + 4; + free(dependency->tracked_filter); + dependency->tracked_filter = calloc(len, sizeof(*dependency->tracked_filter)); + snprintf(dependency->tracked_filter, len, "(%s=%s)", OSGI_FRAMEWORK_OBJECTCLASS, serviceName); + + while (arrayListIterator_hasNext(filterElementsIter) == true) { + char* filterElement = (char*) arrayListIterator_next(filterElementsIter); + size_t len = strnlen(dependency->tracked_filter, 1024*1024) + strnlen(filterElement, 1024*1024) + 4; + char* newFilter = calloc(len, sizeof(*newFilter)); + + if (dependency->tracked_filter[0] == '(' && dependency->tracked_filter[1] == '&') { + //already have an & (AND) can combine with additional filter -> easier to read + size_t orgLen = strnlen(dependency->tracked_filter, 1024*1024); + snprintf(newFilter, len, "%.*s%s)", (int)orgLen -1, dependency->tracked_filter, filterElement); + } else { + snprintf(newFilter, len, "(&%s%s)", dependency->tracked_filter, filterElement); + } + + free(dependency->tracked_filter); + free(filterElement); + + dependency->tracked_filter = newFilter; + } + + arrayListIterator_destroy(filterElementsIter); + } + else { + free(dependency->tracked_filter); + dependency->tracked_filter = NULL; + } + + arrayList_destroy(filterElements); + } + + return status; +} + +celix_status_t serviceDependency_getFilter(dm_service_dependency_pt dependency, const char** filter) { + *filter = (const char*)dependency->tracked_filter; + return CELIX_SUCCESS; +} + +celix_status_t serviceDependency_setCallbacks(dm_service_dependency_pt dependency, service_set_fpt set, service_add_fpt add, service_change_fpt change, service_remove_fpt remove, service_swap_fpt swap) { + celix_status_t status = CELIX_SUCCESS; + + //printf("Setting callbacks set %p, add %p, change %p, remove %p and swap %p\n", set, add, change, remove, swap); + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->set = set; + dependency->add = add; + dependency->change = change; + dependency->remove = remove; + dependency->swap = swap; + } + + return status; +} + +celix_status_t serviceDependency_setCallbacksWithServiceReference(dm_service_dependency_pt dependency, service_set_with_ref_fpt set, service_add_with_ref_fpt add, service_change_with_ref_fpt change, service_remove_with_ref_fpt remove, + service_swap_with_ref_fpt swap) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->set_with_ref = set; + dependency->add_with_ref = add; + dependency->change_with_ref = change; + dependency->remove_with_ref = remove; + dependency->swap_with_ref = swap; + } + + return status; +} + +celix_status_t serviceDependency_setAutoConfigure(dm_service_dependency_pt dependency, celix_thread_mutex_t *service_lock, const void **field) { + celix_status_t status = CELIX_SUCCESS; + + celix_thread_mutex_t lock; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->autoConfigure = field; + celixThreadMutex_create(&lock, NULL); + *service_lock = lock; + dependency->lock = lock; + } + + return status; +} + +celix_status_t serviceDependency_setComponent(dm_service_dependency_pt dependency, dm_component_pt component) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->component = component; + } + + return status; +} + +celix_status_t serviceDependency_start(dm_service_dependency_pt dependency) { + celix_status_t status = CELIX_SUCCESS; + bundle_context_pt context = NULL; + + if (!dependency || !dependency->component || (!dependency->tracked_service && !dependency->tracked_filter)) { + status = CELIX_ILLEGAL_ARGUMENT; + } + if (status == CELIX_SUCCESS) { + status = component_getBundleContext(dependency->component, &context); + if (!context) { + status = CELIX_BUNDLE_EXCEPTION; + } + } + if (status == CELIX_SUCCESS) { + dependency->tracker_customizer = NULL; + status = serviceTrackerCustomizer_create(dependency, NULL, serviceDependency_addedService, serviceDependency_modifiedService, serviceDependency_removedService, &dependency->tracker_customizer); + } + if (status == CELIX_SUCCESS) { + if (dependency->tracked_filter) { + status = serviceTracker_createWithFilter(context, dependency->tracked_filter, dependency->tracker_customizer, &dependency->tracker); + } else if (dependency->tracked_service) { + status = serviceTracker_create(context, dependency->tracked_service, dependency->tracker_customizer, &dependency->tracker); + } + } + + if (status == CELIX_SUCCESS) { + status = serviceTracker_open(dependency->tracker); + } + + if (status == CELIX_SUCCESS) { + dependency->isStarted = true; + } + + return status; +} + +celix_status_t serviceDependency_stop(dm_service_dependency_pt dependency) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->isStarted = false; + } + + if (status == CELIX_SUCCESS && dependency->tracker) { + status = serviceTracker_close(dependency->tracker); + if (status == CELIX_SUCCESS) { + serviceTracker_destroy(dependency->tracker); + dependency->tracker = NULL; + } + } + + return status; +} + +celix_status_t serviceDependency_setInstanceBound(dm_service_dependency_pt dependency, bool instanceBound) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->instanceBound = instanceBound; + } + + return status; +} + +celix_status_t serviceDependency_setAvailable(dm_service_dependency_pt dependency, bool available) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + dependency->available = available; + } + + return status; +} + +celix_status_t serviceDependency_invokeSet(dm_service_dependency_pt dependency, dm_event_pt event) { + celix_status_t status = CELIX_SUCCESS; + assert(dependency->isStarted == true); + array_list_pt serviceReferences = NULL; + int i; + int curRanking = INT_MIN; + service_reference_pt curServRef = NULL; + void *service = NULL; + + serviceReferences = serviceTracker_getServiceReferences(dependency->tracker); + + /* Find the service with the higest ranking */ + for (i = 0; i < arrayList_size(serviceReferences); i++) { + service_reference_pt serviceReference = arrayList_get(serviceReferences, i); + const char* ranking_value; + int ranking = 0; + + status = serviceReference_getProperty(serviceReference, ((char *) OSGI_FRAMEWORK_SERVICE_RANKING), &ranking_value); + + if (status == CELIX_SUCCESS) { + if (ranking_value == NULL) { + ranking = DEFAULT_RANKING; + } else { + char *end; + ranking = strtol(ranking_value, &end, 10); + if (end == ranking_value) { + ranking = DEFAULT_RANKING; + } + } + + if (ranking > curRanking) { + curRanking = ranking; + curServRef = serviceReference; + } + } else { + break; + } + + } + + arrayList_destroy(serviceReferences); + + if (status == CELIX_SUCCESS) { + if (curServRef) { + status = bundleContext_getService(event->context, curServRef, &service); + } else { + service = NULL; + } + + if (dependency->set) { + dependency->set(serviceDependency_getCallbackHandle(dependency), service); + } + if (dependency->set_with_ref) { + dependency->set_with_ref(serviceDependency_getCallbackHandle(dependency), curServRef, service); + } + + if (curServRef) { + bundleContext_ungetService(event->context, curServRef, NULL); + } + } + + return status; +} + +celix_status_t serviceDependency_invokeAdd(dm_service_dependency_pt dependency, dm_event_pt event) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + if (dependency->add) { + dependency->add(serviceDependency_getCallbackHandle(dependency), event->service); + } + if (dependency->add_with_ref) { + dependency->add_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service); + } + } + + return status; +} + +celix_status_t serviceDependency_invokeChange(dm_service_dependency_pt dependency, dm_event_pt event) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + if (dependency->change) { + dependency->change(serviceDependency_getCallbackHandle(dependency), event->service); + } + if (dependency->change_with_ref) { + dependency->change_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service); + } + } + + return status; +} + +celix_status_t serviceDependency_invokeRemove(dm_service_dependency_pt dependency, dm_event_pt event) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + if (dependency->remove) { + dependency->remove(serviceDependency_getCallbackHandle(dependency), event->service); + } + if (dependency->remove_with_ref) { + dependency->remove_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service); + } + } + + return status; +} + +celix_status_t serviceDependency_invokeSwap(dm_service_dependency_pt dependency, dm_event_pt event, dm_event_pt newEvent) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + if (dependency->swap) { + dependency->swap(serviceDependency_getCallbackHandle(dependency), event->service, newEvent->service); + } + if (dependency->swap_with_ref) { + dependency->swap_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service, newEvent->reference, newEvent->service); + } + } + + return status; +} + +celix_status_t serviceDependency_isAvailable(dm_service_dependency_pt dependency, bool *available) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + *available = dependency->available; + } + + return status; +} + +celix_status_t serviceDependency_isRequired(dm_service_dependency_pt dependency, bool *required) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + *required = dependency->required; + } + + return status; +} + +celix_status_t serviceDependency_isInstanceBound(dm_service_dependency_pt dependency, bool *instanceBound) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + *instanceBound = dependency->instanceBound; + } + + return status; +} + +celix_status_t serviceDependency_isAutoConfig(dm_service_dependency_pt dependency, bool *autoConfig) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + *autoConfig = dependency->autoConfigure != NULL; + } + + return status; +} + +celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, const void*** autoConfigure) { + celix_status_t status = CELIX_SUCCESS; + + if (!dependency) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + *autoConfigure = dependency->autoConfigure; + } + + return status; +} + +celix_status_t serviceDependency_addedService(void *_ptr, service_reference_pt reference, void *service) { + celix_status_t status = CELIX_SUCCESS; + bundle_context_pt context = NULL; + bundle_pt bundle = NULL; + dm_event_pt event = NULL; + dm_service_dependency_pt dependency = _ptr; + + if (!dependency || !reference || !service) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + status = component_getBundleContext(dependency->component, &context); + if (!context) { + status = CELIX_BUNDLE_EXCEPTION; + } + } + + if (status == CELIX_SUCCESS) { + status = bundleContext_getBundle(context, &bundle); + if (!bundle) { + status = CELIX_BUNDLE_EXCEPTION; + } + } + + if (status == CELIX_SUCCESS) { + status = event_create(DM_EVENT_ADDED, bundle, context, reference, service, &event); + } + + if (status == CELIX_SUCCESS) { + component_handleEvent(dependency->component, dependency, event); + } + + return status; +} + +celix_status_t serviceDependency_modifiedService(void *_ptr, service_reference_pt reference, void *service) { + celix_status_t status = CELIX_SUCCESS; + bundle_context_pt context = NULL; + bundle_pt bundle = NULL; + dm_event_pt event = NULL; + dm_service_dependency_pt dependency = _ptr; + + if (!dependency || !reference || !service) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + status = component_getBundleContext(dependency->component, &context); + if (!context) { + status = CELIX_BUNDLE_EXCEPTION; + } + } + + if (status == CELIX_SUCCESS) { + status = bundleContext_getBundle(context, &bundle); + if (!bundle) { + status = CELIX_BUNDLE_EXCEPTION; + } + } + + if (status == CELIX_SUCCESS) { + status = event_create(DM_EVENT_CHANGED, bundle, context, reference, service, &event); + } + + if (status == CELIX_SUCCESS) { + component_handleEvent(dependency->component, dependency, event); + } + + return status; +} + +celix_status_t serviceDependency_removedService(void *_ptr, service_reference_pt reference, void *service) { + celix_status_t status = CELIX_SUCCESS; + bundle_context_pt context = NULL; + bundle_pt bundle = NULL; + dm_event_pt event = NULL; + dm_service_dependency_pt dependency = _ptr; + + if (!dependency || !reference || !service) { + status = CELIX_ILLEGAL_ARGUMENT; + } + + if (status == CELIX_SUCCESS) { + status = component_getBundleContext(dependency->component, &context); + if (!context) { + status = CELIX_BUNDLE_EXCEPTION; + } + } + + if (status == CELIX_SUCCESS) { + status = bundleContext_getBundle(context, &bundle); + if (!bundle) { + status = CELIX_BUNDLE_EXCEPTION; + } + } + + if (status == CELIX_SUCCESS) { + status = event_create(DM_EVENT_REMOVED, bundle, context, reference, service, &event); + } + + if (status == CELIX_SUCCESS) { + component_handleEvent(dependency->component, dependency, event); + } + + return status; +} + +celix_status_t serviceDependency_getServiceDependencyInfo(dm_service_dependency_pt dep, dm_service_dependency_info_pt *out) { + celix_status_t status = CELIX_SUCCESS; + dm_service_dependency_info_pt info = calloc(1, sizeof(*info)); + if (info != NULL) { + celixThreadMutex_lock(&dep->lock); + info->available = dep->available; + info->filter = dep->tracked_filter != NULL ? strdup(dep->tracked_filter) : NULL; + if (info->filter == NULL) { + info->filter = dep->tracked_service != NULL ? strdup(dep->tracked_service) : NULL; + } + info->required = dep->required; + + array_list_pt refs = serviceTracker_getServiceReferences(dep->tracker); + if (refs != NULL) { + info->count = arrayList_size(refs); + } + arrayList_destroy(refs); + + celixThreadMutex_unlock(&dep->lock); + } else { + status = CELIX_ENOMEM; + } + + if (status == CELIX_SUCCESS) { + *out = info; + } + + return status; +} + +void dependency_destroyDependencyInfo(dm_service_dependency_info_pt info) { + if (info != NULL) { + free(info->filter); + } + free(info); +} + +celix_status_t serviceDependency_setCallbackHandle(dm_service_dependency_pt dependency, void* handle) { + dependency->callbackHandle = handle; + return CELIX_SUCCESS; +} + +static void* serviceDependency_getCallbackHandle(dm_service_dependency_pt dependency) { + return dependency->callbackHandle == NULL ? component_getImplementation(dependency->component) : dependency->callbackHandle; +}
http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/dependency_manager/src/dm_service_dependency_impl.h ---------------------------------------------------------------------- diff --git a/dependency_manager/src/dm_service_dependency_impl.h b/dependency_manager/src/dm_service_dependency_impl.h new file mode 100644 index 0000000..7026ebf --- /dev/null +++ b/dependency_manager/src/dm_service_dependency_impl.h @@ -0,0 +1,104 @@ +/** + *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. + */ +/* + * dm_service_dependency_impl.h + * + * \date 16 Oct 2015 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ + +#ifndef DM_SERVICE_DEPENDENCY_IMPL_H_ +#define DM_SERVICE_DEPENDENCY_IMPL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdbool.h> + +#include "dm_event.h" +#include "service_tracker.h" +#include "service_tracker_customizer.h" + +#include "dm_service_dependency.h" +#include "dm_component.h" + +struct dm_service_dependency { + dm_component_pt component; + bool available; + bool instanceBound; + bool required; + dm_service_dependency_strategy_t strategy; + + void* callbackHandle; //This handle can be set to be used instead of the component implementation + service_set_fpt set; + service_add_fpt add; + service_change_fpt change; + service_remove_fpt remove; + service_swap_fpt swap; + + service_set_with_ref_fpt set_with_ref; + service_add_with_ref_fpt add_with_ref; + service_change_with_ref_fpt change_with_ref; + service_remove_with_ref_fpt remove_with_ref; + service_swap_with_ref_fpt swap_with_ref; + + const void **autoConfigure; + celix_thread_mutex_t lock; + + bool isStarted; + + bool addCLanguageFilter; + char *tracked_service; + char *tracked_filter_unmodified; + char *tracked_filter; + + service_tracker_pt tracker; + service_tracker_customizer_pt tracker_customizer; +}; + +celix_status_t serviceDependency_start(dm_service_dependency_pt dependency); +celix_status_t serviceDependency_stop(dm_service_dependency_pt dependency); +celix_status_t serviceDependency_setInstanceBound(dm_service_dependency_pt dependency, bool instanceBound); +celix_status_t serviceDependency_setAutoConfig(dm_service_dependency_pt dependency, void **autoConfigure); +celix_status_t serviceDependency_setAvailable(dm_service_dependency_pt dependency, bool available); + +celix_status_t serviceDependency_setComponent(dm_service_dependency_pt dependency, dm_component_pt component); +//celix_status_t serviceDependency_removeComponent(dm_service_dependency_pt dependency, dm_component_pt component); + +celix_status_t serviceDependency_invokeSet(dm_service_dependency_pt dependency, dm_event_pt event); +celix_status_t serviceDependency_invokeAdd(dm_service_dependency_pt dependency, dm_event_pt event); +celix_status_t serviceDependency_invokeChange(dm_service_dependency_pt dependency, dm_event_pt event); +celix_status_t serviceDependency_invokeRemove(dm_service_dependency_pt dependency, dm_event_pt event); +celix_status_t serviceDependency_invokeSwap(dm_service_dependency_pt dependency, dm_event_pt event, dm_event_pt newEvent); +celix_status_t serviceDependency_isAvailable(dm_service_dependency_pt dependency, bool *available); +celix_status_t serviceDependency_isRequired(dm_service_dependency_pt dependency, bool *required); +celix_status_t serviceDependency_isInstanceBound(dm_service_dependency_pt dependency, bool *instanceBound); +celix_status_t serviceDependency_isAutoConfig(dm_service_dependency_pt dependency, bool *autoConfig); + +celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, const void*** autoConfigure); +celix_status_t serviceDependency_unlock(dm_service_dependency_pt dependency); +celix_status_t serviceDependency_lock(dm_service_dependency_pt dependency); + +#ifdef __cplusplus +} +#endif + +#endif /* DM_SERVICE_DEPENDENCY_IMPL_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/dependency_manager/src/dm_shell_activator.c ---------------------------------------------------------------------- diff --git a/dependency_manager/src/dm_shell_activator.c b/dependency_manager/src/dm_shell_activator.c new file mode 100644 index 0000000..4d6f507 --- /dev/null +++ b/dependency_manager/src/dm_shell_activator.c @@ -0,0 +1,94 @@ +/** + *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. + */ +/* + * dm_shell_activator.c + * + * \date 16 Oct 2015 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ + +#include <constants.h> +#include "bundle_context.h" +#include "command.h" + +#include "dm_shell_list_command.h" +#include "shell_constants.h" + +struct bundle_instance { + service_registration_pt reg; + command_service_t dmCommand; + dm_command_handle_t dmHandle; +}; + +typedef struct bundle_instance * bundle_instance_pt; + +celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) { + + if(userData==NULL){ + return CELIX_ILLEGAL_ARGUMENT; + } + + struct bundle_instance *bi = calloc(sizeof (struct bundle_instance), 1); + + if (bi==NULL) { + return CELIX_ENOMEM; + } + + bi->dmHandle.context = context; + const char* config = NULL; + bundleContext_getPropertyWithDefault(context, SHELL_USE_ANSI_COLORS, SHELL_USE_ANSI_COLORS_DEFAULT_VALUE, &config); + bi->dmHandle.useColors = config != NULL && strncmp("true", config, 5) == 0; + + (*userData) = bi; + + return CELIX_SUCCESS; +} + +celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) { + celix_status_t status = CELIX_SUCCESS; + bundle_instance_pt bi = (bundle_instance_pt) userData; + + bi->dmCommand.handle = &bi->dmHandle; + bi->dmCommand.executeCommand = (void *)dmListCommand_execute; + + properties_pt props = properties_create(); + properties_set(props, CELIX_FRAMEWORK_SERVICE_LANGUAGE, CELIX_FRAMEWORK_SERVICE_C_LANGUAGE); + properties_set(props, OSGI_SHELL_COMMAND_NAME, "dm"); + properties_set(props, OSGI_SHELL_COMMAND_USAGE, "dm"); + properties_set(props, OSGI_SHELL_COMMAND_DESCRIPTION, + "Gives an overview of the component managemend by a dependency manager."); + + status = bundleContext_registerService(context, OSGI_SHELL_COMMAND_SERVICE_NAME, &bi->dmCommand, props, &bi->reg); + + return status; +} + +celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) { + bundle_instance_pt bi = (bundle_instance_pt) userData; + serviceRegistration_unregister(bi->reg); + return CELIX_SUCCESS; +} + +celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) { + bundle_instance_pt bi = (bundle_instance_pt) userData; + free(bi); + return CELIX_SUCCESS; +} + http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/dependency_manager/src/dm_shell_list_command.c ---------------------------------------------------------------------- diff --git a/dependency_manager/src/dm_shell_list_command.c b/dependency_manager/src/dm_shell_list_command.c new file mode 100644 index 0000000..1600710 --- /dev/null +++ b/dependency_manager/src/dm_shell_list_command.c @@ -0,0 +1,126 @@ +/** + *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. + */ +/* + * dm_shell_list_command.c + * + * \date Oct 16, 2015 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ +#include <stdlib.h> +#include <string.h> +#include <dm_dependency_manager.h> +#include <dm_shell_list_command.h> +#include "dm_info.h" +#include "service_reference.h" +#include "array_list.h" +#include "bundle_context.h" +#include "bundle.h" +#include "shell.h" + + +static const char * const OK_COLOR = "\033[92m"; +static const char * const WARNING_COLOR = "\033[93m"; +static const char * const NOK_COLOR = "\033[91m"; +static const char * const END_COLOR = "\033[m"; + +void dmListCommand_execute(dm_command_handle_t* handle, char * line, FILE *out, FILE *err) { + + array_list_pt servRefs = NULL; + int i; + bundleContext_getServiceReferences(handle->context, DM_INFO_SERVICE_NAME ,NULL, &servRefs); + + if(servRefs==NULL){ + fprintf(out, "Invalid dm_info ServiceReferences List\n"); + return; + } + + bool colors = handle->useColors; + + for(i = 0; i < arrayList_size(servRefs); i++) { + dm_dependency_manager_info_pt info = NULL; + dm_info_service_pt infoServ = NULL; + service_reference_pt servRef = NULL; + servRef = arrayList_get(servRefs, i); + bundleContext_getService(handle->context, servRef, (void**)&infoServ); + infoServ->getInfo(infoServ->handle, &info); + + int cmpCnt; + for (cmpCnt = 0; cmpCnt < arrayList_size(info->components); cmpCnt++) { + dm_component_info_pt compInfo = arrayList_get(info->components, cmpCnt); + const char *startColors = ""; + const char *endColors = ""; + if (colors) { + startColors = compInfo->active ? OK_COLOR : NOK_COLOR; + endColors = END_COLOR; + } + fprintf(out, "Component: Name=%s\n|- ID=%s, %sActive=%s%s, State=%s\n", compInfo->name, compInfo->id, startColors, compInfo->active ? "true " : "false", endColors, compInfo->state); + + int interfCnt; + fprintf(out, "|- Interfaces (%d):\n", arrayList_size(compInfo->interfaces)); + for(interfCnt = 0 ;interfCnt < arrayList_size(compInfo->interfaces); interfCnt++) { + dm_interface_info_pt intfInfo= arrayList_get(compInfo->interfaces, interfCnt); + fprintf(out, " |- Interface: %s\n", intfInfo->name); + + hash_map_iterator_t iter = hashMapIterator_construct((hash_map_pt) intfInfo->properties); + char* key = NULL; + while((key = hashMapIterator_nextKey(&iter)) != NULL) { + fprintf(out, " | %15s = %s\n", key, properties_get(intfInfo->properties, key)); + } + } + + int depCnt; + fprintf(out, "|- Dependencies (%d):\n", arrayList_size(compInfo->dependency_list)); + for(depCnt = 0 ;depCnt < arrayList_size(compInfo->dependency_list); depCnt++) { + dm_service_dependency_info_pt dependency; + dependency = arrayList_get(compInfo->dependency_list, depCnt); + const char *startColors = ""; + const char *endColors = ""; + if (colors) { + if (dependency->required) { + startColors = dependency->available ? OK_COLOR : NOK_COLOR; + } else { + startColors = dependency->available ? OK_COLOR : WARNING_COLOR; + } + + endColors = END_COLOR; + } + fprintf(out, " |- Dependency: %sAvailable = %s%s, Required = %s, Filter = %s\n", + startColors, + dependency->available ? "true " : "false" , + endColors, + dependency->required ? "true " : "false", + dependency->filter + ); + } + fprintf(out, "\n"); + + } + + infoServ->destroyInfo(infoServ->handle, info); + + bundleContext_ungetService(handle->context, servRef, NULL); + bundleContext_ungetServiceReference(handle->context, servRef); + + } + + if(servRefs!=NULL){ + arrayList_destroy(servRefs); + } +} http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/dependency_manager/src/dm_shell_list_command.h ---------------------------------------------------------------------- diff --git a/dependency_manager/src/dm_shell_list_command.h b/dependency_manager/src/dm_shell_list_command.h new file mode 100644 index 0000000..6ab0581 --- /dev/null +++ b/dependency_manager/src/dm_shell_list_command.h @@ -0,0 +1,42 @@ +/** + *Licensed to the Apache Software Foundation (ASF) under one + *or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + *regarding copyright ownership. The ASF licenses this file + *to you under the Apache License, Version 2.0 (the + *"License"); you may not use this file except in compliance + *with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + *Unless required by applicable law or agreed to in writing, + *software distributed under the License is distributed on an + *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + *specific language governing permissions and limitations + *under the License. + */ + +#ifndef DM_SHELL_LIST_COMMAND_H_ +#define DM_SHELL_LIST_COMMAND_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdlib.h> +#include <string.h> +#include "command.h" + +typedef struct dm_command_handle { + bundle_context_pt context; + bool useColors; +} dm_command_handle_t; + +void dmListCommand_execute(dm_command_handle_t* handle, char * line, FILE *out, FILE *err); + +#ifdef __cplusplus +} +#endif + +#endif //DM_SHELL_LSIT_COMMAND_H_ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/dependency_manager_cxx/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/dependency_manager_cxx/CMakeLists.txt b/dependency_manager_cxx/CMakeLists.txt index c113fa3..65c158d 100644 --- a/dependency_manager_cxx/CMakeLists.txt +++ b/dependency_manager_cxx/CMakeLists.txt @@ -24,31 +24,26 @@ if (DEPENDENCY_MANAGER_CXX) exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL "processor type (i386 and x86_64)") if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - add_definitions(-fPIC) + set(DM_COMP_OPT -fPIC) endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") endif(CMAKE_UNAME) endif(UNIX AND NOT WIN32) - include_directories( - include - ${PROJECT_SOURCE_DIR}/dependency_manager/public/include - ${PROJECT_SOURCE_DIR}/dependency_manager/private/include - ${PROJECT_SOURCE_DIR}/utils/public/include - ) - - add_library( dependency_manager_cxx_static STATIC - ${CMAKE_SOURCE_DIR}/dependency_manager/private/src/dm_component_impl - ${CMAKE_SOURCE_DIR}/dependency_manager/private/src/dm_service_dependency - ${CMAKE_SOURCE_DIR}/dependency_manager/private/src/dm_event - ${CMAKE_SOURCE_DIR}/dependency_manager/private/src/dm_dependency_manager_impl + add_library(dependency_manager_cxx_static STATIC + ${CMAKE_SOURCE_DIR}/dependency_manager/src/dm_component_impl + ${CMAKE_SOURCE_DIR}/dependency_manager/src/dm_service_dependency + ${CMAKE_SOURCE_DIR}/dependency_manager/src/dm_event + ${CMAKE_SOURCE_DIR}/dependency_manager/src/dm_dependency_manager_impl src/dm_activator.cc ) - #set_target_properties(dependency_manager_cxx_static PROPERTIES SOVERSION 1) + target_include_directories(dependency_manager_cxx_static PUBLIC include ${CMAKE_SOURCE_DIR}/dependency_manager/api) + target_include_directories(dependency_manager_cxx_static PRIVATE src) + target_compile_options(dependency_manager_cxx_static PRIVATE ${DM_COMP_OPT}) if (APPLE) - target_link_libraries(dependency_manager_cxx_static celix_framework "-undefined dynamic_lookup") + target_link_libraries(dependency_manager_cxx_static Celix::framework "-undefined dynamic_lookup") else() - target_link_libraries(dependency_manager_cxx_static celix_framework) + target_link_libraries(dependency_manager_cxx_static Celix::framework) endif() install( @@ -61,4 +56,9 @@ if (DEPENDENCY_MANAGER_CXX) ) install(TARGETS dependency_manager_cxx_static DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT dependency_manager_cxx) + unset(DM_COMP_OPT) + + + #Setup target aliases to match external usage + add_library(Celix::dependency_manager_cxx_static ALIAS dependency_manager_cxx_static) endif (DEPENDENCY_MANAGER_CXX) http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/dependency_manager_cxx/readme.md ---------------------------------------------------------------------- diff --git a/dependency_manager_cxx/readme.md b/dependency_manager_cxx/readme.md index 80de7af..63dc5b3 100644 --- a/dependency_manager_cxx/readme.md +++ b/dependency_manager_cxx/readme.md @@ -59,3 +59,9 @@ For more information examples please see - [The C++ Dependency Manager API](include/celix/dm): The c++ dependency manager header files - [Dm C++ example](../examples/dm_example_cxx): A DM C++ example. - [Getting Started: Using Services with C++](../documents/getting_started/using_services_with_cxx.md): A introduction how to work with services using the C++ dependency manager + +## Using info + +If the Celix C++ Dependency Manager is installed The `FindCelix.cmake` will set: + - The `Celix::shell_api` interface (i.e. headers only) library target + - The `Celix::shell` bundle target http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/deployment_admin/CMakeLists.txt b/deployment_admin/CMakeLists.txt index a6094ad..4a06be5 100644 --- a/deployment_admin/CMakeLists.txt +++ b/deployment_admin/CMakeLists.txt @@ -20,55 +20,48 @@ if (DEPLOYMENT_ADMIN) find_package(CURL REQUIRED) find_package(UUID REQUIRED) + find_package(ZLIB REQUIRED) - add_definitions(-DUSE_FILE32API) + add_library(deployment_admin_api INTERFACE) + target_include_directories(deployment_admin_api INTERFACE api) - include_directories("${CURL_INCLUDE_DIR}") - include_directories("${UUID_INCLUDE_DIR}") - include_directories("${PROJECT_SOURCE_DIR}/utils/public/include") - include_directories("${PROJECT_SOURCE_DIR}/deployment_admin/private/include") - include_directories("${PROJECT_SOURCE_DIR}/deployment_admin/public/include") - add_bundle(deployment_admin SYMBOLIC_NAME "apache_celix_deployment_admin" VERSION "0.0.2" NAME "Apache Celix Deployment Admin" SOURCES - private/src/deployment_package - private/src/deployment_admin - private/src/deployment_admin_activator - private/src/ioapi - private/src/miniunz - private/src/unzip - private/src/log - private/src/log_store - private/src/log_sync + src/deployment_package + src/deployment_admin + src/deployment_admin_activator + src/ioapi + src/miniunz + src/unzip + src/log + src/log_store + src/log_sync + ) - private/include/deployment_admin.h - private/include/deployment_package.h - private/include/ioapi.h - private/include/log.h - private/include/log_event.h - private/include/log_store.h - private/include/log_sync.h - private/include/miniunz.h - private/include/unzip.h + target_compile_definitions(deployment_admin PRIVATE -DUSE_FILE32API) + target_include_directories(deployment_admin PRIVATE + src + ${CURL_INCLUDE_DIRS} + ${UUID_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIRS} ) + target_link_libraries(deployment_admin PRIVATE ${CURL_LIBRARIES} ${UUID_LIBRARIES} ${ZLIB_LIBRARIES} deployment_admin_api) - - install_bundle(deployment_admin - HEADERS - public/include/resource_processor.h - ) - - target_link_libraries(deployment_admin celix_framework ${CURL_LIBRARIES}) + install_bundle(deployment_admin) + #Setup target aliases to match external usage + add_library(Celix::deployment_admin_api ALIAS deployment_admin_api) + add_library(Celix::deployment_admin ALIAS deployment_admin) add_deploy(deployment-admin - BUNDLES deployment_admin shell shell_tui log_service log_writer + BUNDLES Celix::deployment_admin Celix::shell Celix::shell_tui log_service log_writer PROPERTIES "deployment_admin_url=http://localhost:8080" "deployment_admin_identification=celix" "org.osgi.framework.storage.clean=onFirstInit" ) + endif (DEPLOYMENT_ADMIN) http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/README.md ---------------------------------------------------------------------- diff --git a/deployment_admin/README.md b/deployment_admin/README.md index d28559c..6716415 100644 --- a/deployment_admin/README.md +++ b/deployment_admin/README.md @@ -5,10 +5,20 @@ The Celix Deployment Admin implements the OSGi Deployment Admin specification, w It can be used for example with Apache Ace, which allows you to centrally manage and distribute software components, configuration data and other artifacts. ###### Properties - deployment_admin_identification id used by the deployment admin to identify itself - deployment_admin_url url of the deployment server - deployment_cache_dir possible cache dir for the deployment admin update - deployment_tags tags used by the deployment admin + tags used by the deployment admin -###### CMake option +## CMake option BUILD_DEPLOYMENT_ADMIN=ON + +## Deployment Admin Config Options + +- deployment_admin_identification id used by the deployment admin to identify itself +- deployment_admin_url url of the deployment server +- deployment_cache_dir possible cache dir for the deployment admin update +- deployment_tags + +## Using info + +If the Celix Deployment Admin is installed The `FindCelix.cmake` will set: + - The `Celix::deployment_admin_api` interface (i.e. headers only) library target + - The `Celix::deployment_admin` bundle target http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/api/resource_processor.h ---------------------------------------------------------------------- diff --git a/deployment_admin/api/resource_processor.h b/deployment_admin/api/resource_processor.h new file mode 100644 index 0000000..f91e13b --- /dev/null +++ b/deployment_admin/api/resource_processor.h @@ -0,0 +1,54 @@ +/** + *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. + */ +/* + * resource_processor.h + * + * \date Feb 13, 2012 + * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> + * \copyright Apache License, Version 2.0 + */ + +#ifndef RESOURCE_PROCESSOR_H_ +#define RESOURCE_PROCESSOR_H_ + +#include "celix_errno.h" + +#define DEPLOYMENTADMIN_RESOURCE_PROCESSOR_SERVICE "resource_processor" + +typedef struct resource_processor *resource_processor_pt; + +typedef struct resource_processor_service *resource_processor_service_pt; + +struct resource_processor_service { + resource_processor_pt processor; + celix_status_t (*begin)(resource_processor_pt processor, char *packageName); + + celix_status_t (*process)(resource_processor_pt processor, char *name, char *path); + + celix_status_t (*dropped)(resource_processor_pt processor, char *name); + celix_status_t (*dropAllResources)(resource_processor_pt processor); + + //celix_status_t (*prepare)(resource_processor_pt processor); + //celix_status_t (*commit)(resource_processor_pt processor); + //celix_status_t (*rollback)(resource_processor_pt processor); + + //celix_status_t (*cancel)(resource_processor_pt processor); +}; + +#endif /* RESOURCE_PROCESSOR_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/deployment_admin.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/deployment_admin.h b/deployment_admin/private/include/deployment_admin.h deleted file mode 100644 index a7e3a39..0000000 --- a/deployment_admin/private/include/deployment_admin.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - *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. - */ -/* - * deployment_admin.h - * - * \date Nov 7, 2011 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef DEPLOYMENT_ADMIN_H_ -#define DEPLOYMENT_ADMIN_H_ - -#include "bundle_context.h" - -typedef struct deployment_admin *deployment_admin_pt; - -struct deployment_admin { - celix_thread_t poller; - bundle_context_pt context; - - bool running; - char *current; - hash_map_pt packages; - char *targetIdentification; - char *pollUrl; - char *auditlogUrl; - unsigned long long auditlogId; - unsigned int aditlogSeqNr; -}; - -typedef enum { - DEPLOYMENT_ADMIN_AUDIT_EVENT__FRAMEWORK_STARTED = 1005, - DEPLOYMENT_ADMIN_AUDIT_EVENT__TARGETPROPERTIES_SET = 4001 - -} DEPLOYMENT_ADMIN_AUDIT_EVENT; - -celix_status_t deploymentAdmin_create(bundle_context_pt context, deployment_admin_pt *admin); -celix_status_t deploymentAdmin_destroy(deployment_admin_pt admin); - -#endif /* DEPLOYMENT_ADMIN_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/deployment_package.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/deployment_package.h b/deployment_admin/private/include/deployment_package.h deleted file mode 100644 index 06c1767..0000000 --- a/deployment_admin/private/include/deployment_package.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - *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. - */ -/* - * deployment_package.h - * - * \date Nov 8, 2011 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef DEPLOYMENT_PACKAGE_H_ -#define DEPLOYMENT_PACKAGE_H_ - -#include "version.h" -#include "bundle_context.h" - -#include "array_list.h" - -struct bundle_info { - char *path; - version_pt version; - char *symbolicName; - bool customizer; - - properties_pt attributes; -}; - -typedef struct bundle_info *bundle_info_pt; - -struct resource_info { - char *path; - properties_pt attributes; - - char *resourceProcessor; -}; - -typedef struct resource_info *resource_info_pt; - -struct deployment_package { - bundle_context_pt context; - manifest_pt manifest; - array_list_pt bundleInfos; - array_list_pt resourceInfos; - hash_map_pt nameToBundleInfo; - hash_map_pt pathToEntry; -}; - -typedef struct deployment_package *deployment_package_pt; - -celix_status_t deploymentPackage_create(bundle_context_pt context, manifest_pt manifest, deployment_package_pt *package); -celix_status_t deploymentPackage_destroy(deployment_package_pt package); -celix_status_t deploymentPackage_getName(deployment_package_pt package, const char** name); -celix_status_t deploymentPackage_getBundleInfos(deployment_package_pt package, array_list_pt *infos); -celix_status_t deploymentPackage_getBundleInfoByName(deployment_package_pt package, const char* name, bundle_info_pt *info); -celix_status_t deploymentPackage_getResourceInfos(deployment_package_pt package, array_list_pt *infos); -celix_status_t deploymentPackage_getResourceInfoByPath(deployment_package_pt package, const char* path, resource_info_pt *info); -celix_status_t deploymentPackage_getBundle(deployment_package_pt package, const char* name, bundle_pt *bundle); -celix_status_t deploymentPackage_getVersion(deployment_package_pt package, version_pt *version); - -#endif /* DEPLOYMENT_PACKAGE_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/ioapi.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/ioapi.h b/deployment_admin/private/include/ioapi.h deleted file mode 100644 index 8309c4c..0000000 --- a/deployment_admin/private/include/ioapi.h +++ /dev/null @@ -1,200 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - Changes - - Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) - Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. - More if/def section may be needed to support other platforms - Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. - (but you should use iowin32.c for windows instead) - -*/ - -#ifndef _ZLIBIOAPI64_H -#define _ZLIBIOAPI64_H - -#if (!defined(_WIN32)) && (!defined(WIN32)) - - // Linux needs this to support file operation on files larger then 4+GB - // But might need better if/def to select just the platforms that needs them. - - #ifndef __USE_FILE_OFFSET64 - #define __USE_FILE_OFFSET64 - #endif - #ifndef __USE_LARGEFILE64 - #define __USE_LARGEFILE64 - #endif - #ifndef _LARGEFILE64_SOURCE - #define _LARGEFILE64_SOURCE - #endif - #ifndef _FILE_OFFSET_BIT - #define _FILE_OFFSET_BIT 64 - #endif -#endif - -#include <stdio.h> -#include <stdlib.h> -#include "zlib.h" - -#if defined(USE_FILE32API) -#define fopen64 fopen -#define ftello64 ftell -#define fseeko64 fseek -#else -#ifdef _MSC_VER - #define fopen64 fopen - #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) - #define ftello64 _ftelli64 - #define fseeko64 _fseeki64 - #else // old MSC - #define ftello64 ftell - #define fseeko64 fseek - #endif -#endif -#endif - -/* -#ifndef ZPOS64_T - #ifdef _WIN32 - #define ZPOS64_T fpos_t - #else - #include <stdint.h> - #define ZPOS64_T uint64_t - #endif -#endif -*/ - -#ifdef HAVE_MINIZIP64_CONF_H -#include "mz64conf.h" -#endif - -/* a type choosen by DEFINE */ -#ifdef HAVE_64BIT_INT_CUSTOM -typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; -#else -#ifdef HAS_STDINT_H -#include "stdint.h" -typedef uint64_t ZPOS64_T; -#else - - -#if defined(_MSC_VER) || defined(__BORLANDC__) -typedef unsigned __int64 ZPOS64_T; -#else -typedef unsigned long long int ZPOS64_T; -#endif -#endif -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) - #define ZCALLBACK CALLBACK - #else - #define ZCALLBACK - #endif -#endif - - - - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); - - -/* here is the "old" 32 bits structure structure */ -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - -typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); - -typedef struct zlib_filefunc64_def_s -{ - open64_file_func zopen64_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell64_file_func ztell64_file; - seek64_file_func zseek64_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc64_def; - -void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -/* now internal definition, only for zip.c and unzip.h */ -typedef struct zlib_filefunc64_32_def_s -{ - zlib_filefunc64_def zfile_func64; - open_file_func zopen32_file; - tell_file_func ztell32_file; - seek_file_func zseek32_file; -} zlib_filefunc64_32_def; - - -#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) -//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) -#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) - -voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); -long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); -ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); - -#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) -#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) -#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) - -#ifdef __cplusplus -} -#endif - -#endif http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/log.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/log.h b/deployment_admin/private/include/log.h deleted file mode 100644 index fa77911..0000000 --- a/deployment_admin/private/include/log.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - *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. - */ -/* - * log.h - * - * \date Apr 18, 2012 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef LOG_H_ -#define LOG_H_ - -#include "log_event.h" -#include "log_store.h" - -#include "bundle_event.h" -#include "framework_event.h" - -typedef struct log *log_pt; - -celix_status_t log_create(log_store_pt store, log_pt *log); -celix_status_t log_log(log_pt log, unsigned int type, properties_pt properties); - -celix_status_t log_bundleChanged(void * listener, bundle_event_pt event); -celix_status_t log_frameworkEvent(void * listener, framework_event_pt event); - -#endif /* LOG_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/log_event.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/log_event.h b/deployment_admin/private/include/log_event.h deleted file mode 100644 index c1a76a9..0000000 --- a/deployment_admin/private/include/log_event.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - *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. - */ -/* - * log_event.h - * - * \date Apr 19, 2012 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef LOG_EVENT_H_ -#define LOG_EVENT_H_ - -#include "properties.h" - -struct log_event { - char *targetId; - unsigned long logId; - unsigned long id; - unsigned long time; - unsigned int type; - properties_pt properties; -}; - -typedef struct log_event *log_event_pt; - -#endif /* LOG_EVENT_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/log_store.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/log_store.h b/deployment_admin/private/include/log_store.h deleted file mode 100644 index 84299b3..0000000 --- a/deployment_admin/private/include/log_store.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - *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. - */ -/* - * log_store.h - * - * \date Apr 18, 2012 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef LOG_STORE_H_ -#define LOG_STORE_H_ - -#include "log_event.h" - -#include "properties.h" -#include "array_list.h" - -typedef struct log_store *log_store_pt; - -celix_status_t logStore_create(log_store_pt *store); -celix_status_t logStore_put(log_store_pt store, unsigned int type, properties_pt properties, log_event_pt *event); - -celix_status_t logStore_getLogId(log_store_pt store, unsigned long *id); -celix_status_t logStore_getEvents(log_store_pt store, array_list_pt *events); - -celix_status_t logStore_getHighestId(log_store_pt store, long *id); - -#endif /* LOG_STORE_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/log_sync.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/log_sync.h b/deployment_admin/private/include/log_sync.h deleted file mode 100644 index 7cd10d9..0000000 --- a/deployment_admin/private/include/log_sync.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - *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. - */ -/* - * log_sync.h - * - * \date Apr 19, 2012 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef LOG_SYNC_H_ -#define LOG_SYNC_H_ - -#include "log_store.h" - -typedef struct log_sync *log_sync_pt; - -celix_status_t logSync_create(char *targetId, log_store_pt store, log_sync_pt *logSync); - -#endif /* LOG_SYNC_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/deployment_admin/private/include/miniunz.h ---------------------------------------------------------------------- diff --git a/deployment_admin/private/include/miniunz.h b/deployment_admin/private/include/miniunz.h deleted file mode 100644 index f54b1fa..0000000 --- a/deployment_admin/private/include/miniunz.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - *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. - */ -/* - * miniunz.h - * - * \date Aug 8, 2012 - * \author <a href="mailto:[email protected]">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef MINIUNZ_H_ -#define MINIUNZ_H_ - -#include "celix_errno.h" - -celix_status_t unzip_extractDeploymentPackage(char * packageName, char * destination); - -#endif /* MINIUNZ_H_ */
