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 2014/06/07 14:44:34 UTC
svn commit: r1601103 [1/3] - in /incubator/celix/trunk:
dependency_manager/private/src/ deployment_admin/private/src/
device_access/device_access/private/src/
device_access/example/refining_driver/private/src/
event_admin/event_admin/private/src/ event...
Author: abroekhuis
Date: Sat Jun 7 12:44:31 2014
New Revision: 1601103
URL: http://svn.apache.org/r1601103
Log:
CELIX-119: Updated framework, removed APR. Updated all bundles (except event admin) to the latest API.
Modified:
incubator/celix/trunk/dependency_manager/private/src/service_component.c
incubator/celix/trunk/dependency_manager/private/src/service_dependency.c
incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c
incubator/celix/trunk/deployment_admin/private/src/deployment_package.c
incubator/celix/trunk/device_access/device_access/private/src/activator.c
incubator/celix/trunk/device_access/device_access/private/src/device_manager.c
incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c
incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c
incubator/celix/trunk/event_admin/event_admin/private/src/event_admin_activator.c
incubator/celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c
incubator/celix/trunk/examples/hello_world/private/src/activator.c
incubator/celix/trunk/examples/hello_world_test/private/src/activator.c
incubator/celix/trunk/framework/CMakeLists.txt
incubator/celix/trunk/framework/private/include/attribute.h
incubator/celix/trunk/framework/private/include/bundle_context_private.h
incubator/celix/trunk/framework/private/include/bundle_private.h
incubator/celix/trunk/framework/private/include/framework_private.h
incubator/celix/trunk/framework/private/include/listener_hook_info_impl.h
incubator/celix/trunk/framework/private/include/manifest_parser.h
incubator/celix/trunk/framework/private/include/service_tracker_private.h
incubator/celix/trunk/framework/private/include/version_private.h
incubator/celix/trunk/framework/private/integration-test/test_bundle1/src/activator.c
incubator/celix/trunk/framework/private/mock/attribute_mock.c
incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c
incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c
incubator/celix/trunk/framework/private/mock/bundle_context_mock.c
incubator/celix/trunk/framework/private/mock/bundle_mock.c
incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c
incubator/celix/trunk/framework/private/mock/capability_mock.c
incubator/celix/trunk/framework/private/mock/filter_mock.c
incubator/celix/trunk/framework/private/mock/framework_mock.c
incubator/celix/trunk/framework/private/mock/manifest_mock.c
incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c
incubator/celix/trunk/framework/private/mock/requirement_mock.c
incubator/celix/trunk/framework/private/mock/service_reference_mock.c
incubator/celix/trunk/framework/private/mock/service_registry_mock.c
incubator/celix/trunk/framework/private/mock/service_tracker_customizer_mock.c
incubator/celix/trunk/framework/private/mock/version_mock.c
incubator/celix/trunk/framework/private/mock/version_range_mock.c
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_context.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/module.c
incubator/celix/trunk/framework/private/src/resolver.c
incubator/celix/trunk/framework/private/src/service_reference.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/service_tracker_customizer.c
incubator/celix/trunk/framework/private/src/utils.c
incubator/celix/trunk/framework/private/src/version.c
incubator/celix/trunk/framework/private/src/version_range.c
incubator/celix/trunk/framework/private/test/attribute_test.cpp
incubator/celix/trunk/framework/private/test/bundle_archive_test.cpp
incubator/celix/trunk/framework/private/test/bundle_cache_test.cpp
incubator/celix/trunk/framework/private/test/bundle_context_test.cpp
incubator/celix/trunk/framework/private/test/bundle_revision_test.cpp
incubator/celix/trunk/framework/private/test/bundle_test.cpp
incubator/celix/trunk/framework/private/test/capability_test.cpp
incubator/celix/trunk/framework/private/test/filter_test.cpp
incubator/celix/trunk/framework/private/test/manifest_test.cpp
incubator/celix/trunk/framework/private/test/requirement_test.cpp
incubator/celix/trunk/framework/private/test/service_reference_test.cpp
incubator/celix/trunk/framework/private/test/service_registration_test.cpp
incubator/celix/trunk/framework/private/test/service_registry_test.cpp
incubator/celix/trunk/framework/private/test/service_tracker_customizer_test.cpp
incubator/celix/trunk/framework/private/test/service_tracker_test.cpp
incubator/celix/trunk/framework/private/test/version_range_test.cpp
incubator/celix/trunk/framework/private/test/version_test.cpp
incubator/celix/trunk/framework/public/include/bundle.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/bundle_listener.h
incubator/celix/trunk/framework/public/include/bundle_revision.h
incubator/celix/trunk/framework/public/include/celix_errno.h
incubator/celix/trunk/framework/public/include/framework.h
incubator/celix/trunk/framework/public/include/framework_listener.h
incubator/celix/trunk/framework/public/include/manifest.h
incubator/celix/trunk/framework/public/include/service_factory.h
incubator/celix/trunk/framework/public/include/service_listener.h
incubator/celix/trunk/framework/public/include/service_tracker.h
incubator/celix/trunk/framework/public/include/service_tracker_customizer.h
incubator/celix/trunk/framework/public/include/utils.h
incubator/celix/trunk/framework/public/include/version.h
incubator/celix/trunk/log_service/private/src/log_service_activator.c
incubator/celix/trunk/log_service/public/include/log_entry.h
incubator/celix/trunk/log_writer/private/src/log_writer.c
incubator/celix/trunk/remote_services/discovery_bonjour/private/src/discovery.c
incubator/celix/trunk/remote_services/discovery_bonjour/private/src/discovery_activator.c
incubator/celix/trunk/remote_services/discovery_shm/private/src/discovery.c
incubator/celix/trunk/remote_services/discovery_shm/private/src/discovery_activator.c
incubator/celix/trunk/remote_services/discovery_slp/private/src/discovery.c
incubator/celix/trunk/remote_services/discovery_slp/private/src/discovery_activator.c
incubator/celix/trunk/remote_services/remote_service_admin_http/private/src/export_registration_impl.c
incubator/celix/trunk/remote_services/remote_service_admin_http/private/src/import_registration_impl.c
incubator/celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
incubator/celix/trunk/remote_services/remote_service_admin_shm/private/src/export_registration_impl.c
incubator/celix/trunk/remote_services/remote_service_admin_shm/private/src/import_registration_impl.c
incubator/celix/trunk/remote_services/remote_service_admin_shm/private/src/remote_service_admin_impl.c
incubator/celix/trunk/remote_services/topology_manager/private/src/activator.c
incubator/celix/trunk/remote_services/topology_manager/private/src/topology_manager.c
incubator/celix/trunk/remote_shell/private/include/shell_mediator.h
incubator/celix/trunk/remote_shell/private/src/shell_mediator.c
incubator/celix/trunk/shell/private/include/shell_private.h
incubator/celix/trunk/shell/private/src/inspect_command.c
incubator/celix/trunk/shell/private/src/install_command.c
incubator/celix/trunk/shell/private/src/log_command.c
incubator/celix/trunk/shell/private/src/ps_command.c
incubator/celix/trunk/shell/private/src/shell.c
incubator/celix/trunk/shell_tui/private/src/shell_tui.c
incubator/celix/trunk/utils/private/test/array_list_test.cpp
incubator/celix/trunk/utils/private/test/linked_list_test.c
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=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/private/src/service_component.c (original)
+++ incubator/celix/trunk/dependency_manager/private/src/service_component.c Sat Jun 7 12:44:31 2014
@@ -418,7 +418,7 @@ executor_pt executor_create(apr_pool_t *
executor = (executor_pt) apr_pcalloc(memory_pool, sizeof(*executor));
if (executor) {
- linkedList_create(memory_pool, &executor->workQueue);
+ linkedList_create(&executor->workQueue);
executor->active = NULL;
apr_thread_mutex_create(&executor->mutex, APR_THREAD_MUTEX_UNNESTED, memory_pool);
}
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=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/dependency_manager/private/src/service_dependency.c (original)
+++ incubator/celix/trunk/dependency_manager/private/src/service_dependency.c Sat Jun 7 12:44:31 2014
@@ -77,14 +77,14 @@ void serviceDependency_start(service_dep
bundleContext_getMemoryPool(dependency->context, &pool);
- serviceTrackerCustomizer_create(pool, dependency, serviceDependency_addingService,
+ serviceTrackerCustomizer_create(dependency, serviceDependency_addingService,
serviceDependency_addedService, serviceDependency_modifiedService,
serviceDependency_removedService, &cust);
if (dependency->trackedServiceFilter != NULL) {
- serviceTracker_createWithFilter(pool, dependency->context, dependency->trackedServiceFilter, cust, &dependency->tracker);
+ serviceTracker_createWithFilter(dependency->context, dependency->trackedServiceFilter, cust, &dependency->tracker);
} else if (dependency->trackedServiceName != NULL) {
- serviceTracker_create(pool, dependency->context, dependency->trackedServiceName, cust, &dependency->tracker);
+ serviceTracker_create(dependency->context, dependency->trackedServiceName, cust, &dependency->tracker);
} else {
}
Modified: incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c (original)
+++ incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c Sat Jun 7 12:44:31 2014
@@ -197,7 +197,7 @@ static void * APR_THREAD_FUNC deployment
bundle_pt bundle = NULL;
bundleContext_getBundle(admin->context, &bundle);
char *entry = NULL;
- bundle_getEntry(bundle, "/", admin->pool, &entry);
+ bundle_getEntry(bundle, "/", &entry);
// Handle file
char tmpDir[256];
@@ -212,7 +212,7 @@ static void * APR_THREAD_FUNC deployment
unzip_extractDeploymentPackage(test, tmpDir);
char *manifest = apr_pstrcat(admin->pool, tmpDir, "/META-INF/MANIFEST.MF", NULL);
manifest_pt mf = NULL;
- manifest_createFromFile(admin->pool, manifest, &mf);
+ manifest_createFromFile(manifest, &mf);
deployment_package_pt source = NULL;
deploymentPackage_create(admin->pool, admin->context, mf, &source);
char *name = NULL;
@@ -416,7 +416,7 @@ celix_status_t deploymentAdmin_updateDep
bundleContext_getBundle(admin->context, &bundle);
char *entry = NULL;
- bundle_getEntry(bundle, "/", admin->pool, &entry);
+ bundle_getEntry(bundle, "/", &entry);
char *name = NULL;
deploymentPackage_getName(source, &name);
char *bundlePath = apr_pstrcat(admin->pool, entry, "repo/", name, "/", info->path, NULL);
@@ -511,7 +511,7 @@ celix_status_t deploymentAdmin_processDe
resource_processor_service_pt processor = processorP;
bundleContext_getBundle(admin->context, &bundle);
- bundle_getEntry(bundle, "/", admin->pool, &entry);
+ bundle_getEntry(bundle, "/", &entry);
deploymentPackage_getName(source, &name);
char *resourcePath = apr_pstrcat(admin->pool, entry, "repo/", name, "/", info->path, NULL);
Modified: incubator/celix/trunk/deployment_admin/private/src/deployment_package.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/deployment_admin/private/src/deployment_package.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/deployment_admin/private/src/deployment_package.c (original)
+++ incubator/celix/trunk/deployment_admin/private/src/deployment_package.c Sat Jun 7 12:44:31 2014
@@ -126,7 +126,7 @@ celix_status_t deploymentPackage_getReso
celix_status_t deploymentPackage_getVersion(deployment_package_pt package, version_pt *version) {
char *versionStr = manifest_getValue(package->manifest, "DeploymentPackage-Version");
- return version_createVersionFromString(package->pool, versionStr, version);
+ return version_createVersionFromString(versionStr, version);
}
celix_status_t deploymentPackage_processEntries(deployment_package_pt package) {
@@ -149,7 +149,7 @@ celix_status_t deploymentPackage_process
info->symbolicName = properties_get(values, (char *) OSGI_FRAMEWORK_BUNDLE_SYMBOLICNAME);
char *version = properties_get(values, (char *) OSGI_FRAMEWORK_BUNDLE_VERSION);
info->version = NULL;
- status = version_createVersionFromString(package->pool, version, &info->version);
+ status = version_createVersionFromString(version, &info->version);
char *customizer = properties_get(values, (char *) DEPLOYMENTPACKAGE_CUSTOMIZER);
deploymentPackage_parseBooleanHeader(customizer, &info->customizer);
Modified: incubator/celix/trunk/device_access/device_access/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/private/src/activator.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/private/src/activator.c (original)
+++ incubator/celix/trunk/device_access/device_access/private/src/activator.c Sat Jun 7 12:44:31 2014
@@ -115,12 +115,12 @@ static celix_status_t deviceManagerBundl
service_tracker_customizer_pt customizer = NULL;
- status = serviceTrackerCustomizer_create(bundleData->pool, bundleData->deviceManager, addingService_dummy_func,
+ status = serviceTrackerCustomizer_create(bundleData->deviceManager, addingService_dummy_func,
deviceManager_locatorAdded, deviceManager_locatorModified, deviceManager_locatorRemoved, &customizer);
if (status == CELIX_SUCCESS) {
service_tracker_pt tracker = NULL;
- status = serviceTracker_create(bundleData->pool, bundleData->context, "driver_locator", customizer, &tracker);
+ status = serviceTracker_create(bundleData->context, "driver_locator", customizer, &tracker);
if (status == CELIX_SUCCESS) {
bundleData->driverLocatorTracker=tracker;
}
@@ -135,12 +135,12 @@ static celix_status_t deviceManagerBundl
service_tracker_customizer_pt customizer = NULL;
- status = serviceTrackerCustomizer_create(bundleData->pool, bundleData->deviceManager, addingService_dummy_func,
+ status = serviceTrackerCustomizer_create(bundleData->deviceManager, addingService_dummy_func,
deviceManager_driverAdded, deviceManager_driverModified, deviceManager_driverRemoved, &customizer);
if (status == CELIX_SUCCESS) {
service_tracker_pt tracker = NULL;
- status = serviceTracker_createWithFilter(bundleData->pool, bundleData->context, "(objectClass=driver)", customizer, &tracker);
+ status = serviceTracker_createWithFilter(bundleData->context, "(objectClass=driver)", customizer, &tracker);
if (status == CELIX_SUCCESS) {
bundleData->driverTracker=tracker;
}
@@ -155,12 +155,12 @@ static celix_status_t deviceManagerBundl
service_tracker_customizer_pt customizer = NULL;
- status = serviceTrackerCustomizer_create(bundleData->pool, bundleData->deviceManager, addingService_dummy_func,
+ status = serviceTrackerCustomizer_create(bundleData->deviceManager, addingService_dummy_func,
deviceManager_deviceAdded, deviceManager_deviceModified, deviceManager_deviceRemoved, &customizer);
if (status == CELIX_SUCCESS) {
service_tracker_pt tracker = NULL;
- status = serviceTracker_createWithFilter(bundleData->pool, bundleData->context, "(|(objectClass=device)(DEVICE_CATEGORY=*))", customizer, &tracker);
+ status = serviceTracker_createWithFilter(bundleData->context, "(|(objectClass=device)(DEVICE_CATEGORY=*))", customizer, &tracker);
if (status == CELIX_SUCCESS) {
bundleData->deviceTracker=tracker;
}
Modified: incubator/celix/trunk/device_access/device_access/private/src/device_manager.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/private/src/device_manager.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/private/src/device_manager.c (original)
+++ incubator/celix/trunk/device_access/device_access/private/src/device_manager.c Sat Jun 7 12:44:31 2014
@@ -441,7 +441,7 @@ celix_status_t deviceManager_getIdleDevi
if (substatus == CELIX_SUCCESS) {
printf("DEVICE_MANAGER: Check idle device: %s\n", bsn);
array_list_pt bundles = NULL;
- substatus = serviceReference_getUsingBundles(ref, pool, &bundles);
+ substatus = serviceReference_getUsingBundles(ref, &bundles);
if (substatus == CELIX_SUCCESS) {
bool inUse = false;
int i;
@@ -496,7 +496,7 @@ celix_status_t deviceManager_getIdleDevi
substatus = serviceReference_getBundle(ref, &bundle);
substatus = DO_IF_SUCCESS(substatus, bundle_getCurrentModule(bundle, &module));
substatus = DO_IF_SUCCESS(substatus, module_getSymbolicName(module, &bsn));
- substatus = DO_IF_SUCCESS(substatus, serviceReference_getUsingBundles(ref, pool, &bundles));
+ substatus = DO_IF_SUCCESS(substatus, serviceReference_getUsingBundles(ref, &bundles));
if (substatus == CELIX_SUCCESS) {
printf("DEVICE_MANAGER: Check idle device: %s\n", bsn);
@@ -535,10 +535,7 @@ celix_status_t deviceManager_isDriverBun
(*isDriver) = false;
array_list_pt refs = NULL;
- apr_pool_t *pool = NULL;
- status = bundle_getMemoryPool(bundle, &pool);
- if (status == CELIX_SUCCESS) {
- status = bundle_getRegisteredServices(bundle, pool, &refs);
+ status = bundle_getRegisteredServices(bundle, &refs);
if (status == CELIX_SUCCESS) {
if (refs != NULL) {
int i;
@@ -564,8 +561,6 @@ celix_status_t deviceManager_isDriverBun
}
}
- }
-
return status;
}
Modified: incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c (original)
+++ incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c Sat Jun 7 12:44:31 2014
@@ -179,7 +179,7 @@ celix_status_t driverLoader_loadDriverFo
if (status == CELIX_SUCCESS) {
status = bundle_start(bundle);
if (status == CELIX_SUCCESS) {
- status = bundle_getRegisteredServices(bundle, pool, references);
+ status = bundle_getRegisteredServices(bundle, references);
if (status == CELIX_SUCCESS) {
arrayList_addAll(loader->loadedDrivers, *references);
}
Modified: incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c (original)
+++ incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c Sat Jun 7 12:44:31 2014
@@ -172,7 +172,6 @@ celix_status_t refiningDriver_createDevi
(*device)->listener=NULL;
service_listener_pt listener = apr_palloc(devicePool, sizeof(*listener));
- listener->pool=devicePool;
listener->handle=(void *)(*device);
listener->serviceChanged=(celix_status_t (*)(void * listener, service_event_pt event))refiningDriver_serviceChanged;
bundleContext_addServiceListener(driver->context, listener, NULL);
Modified: incubator/celix/trunk/event_admin/event_admin/private/src/event_admin_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/event_admin/event_admin/private/src/event_admin_activator.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/event_admin/event_admin/private/src/event_admin_activator.c (original)
+++ incubator/celix/trunk/event_admin/event_admin/private/src/event_admin_activator.c Sat Jun 7 12:44:31 2014
@@ -97,8 +97,8 @@ celix_status_t bundleActivator_start(voi
service_tracker_pt tracker = NULL;
data->context = context;
- serviceTrackerCustomizer_create(pool, data->event_admin_service->eventAdmin, eventAdmin_addingService, eventAdmin_addedService, eventAdmin_modifiedService, eventAdmin_removedService, &cust);
- serviceTracker_create(pool, context, (char *) EVENT_HANDLER_SERVICE, cust, &tracker);
+ serviceTrackerCustomizer_create(data->event_admin_service->eventAdmin, eventAdmin_addingService, eventAdmin_addedService, eventAdmin_modifiedService, eventAdmin_removedService, &cust);
+ serviceTracker_create(context, (char *) EVENT_HANDLER_SERVICE, cust, &tracker);
data->tracker = tracker;
Modified: incubator/celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c (original)
+++ incubator/celix/trunk/event_admin/event_handler/private/src/event_handler_activator.c Sat Jun 7 12:44:31 2014
@@ -84,8 +84,8 @@ celix_status_t bundleActivator_start(voi
if(status == CELIX_SUCCESS) {
service_tracker_customizer_pt customizer = NULL;
service_tracker_pt tracker = NULL;
- serviceTrackerCustomizer_create(pool, activator->event_handler_service->event_handler, eventHandlerAddingService, eventHandlerAddedService, eventHandlerModifiedService, eventHandlerRemovedService, &customizer);
- serviceTracker_create(pool, context, (char *) EVENT_ADMIN_NAME, customizer,
+ serviceTrackerCustomizer_create(activator->event_handler_service->event_handler, eventHandlerAddingService, eventHandlerAddedService, eventHandlerModifiedService, eventHandlerRemovedService, &customizer);
+ serviceTracker_create(context, (char *) EVENT_ADMIN_NAME, customizer,
&tracker);
activator->eventAdminTracker = tracker;
serviceTracker_open(tracker);
Modified: incubator/celix/trunk/examples/hello_world/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/hello_world/private/src/activator.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/examples/hello_world/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/hello_world/private/src/activator.c Sat Jun 7 12:44:31 2014
@@ -37,10 +37,9 @@ struct userData {
};
celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
- apr_pool_t *pool;
- celix_status_t status = bundleContext_getMemoryPool(context, &pool);
- if (status == CELIX_SUCCESS) {
- *userData = apr_palloc(pool, sizeof(struct userData));
+ celix_status_t status = CELIX_SUCCESS;
+ *userData = malloc(sizeof(struct userData));
+ if (userData != NULL) {
((struct userData *)(*userData))->word = "World";
} else {
status = CELIX_START_ERROR;
@@ -64,5 +63,6 @@ celix_status_t bundleActivator_stop(void
}
celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
+ free(userData);
return CELIX_SUCCESS;
}
Modified: incubator/celix/trunk/examples/hello_world_test/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/hello_world_test/private/src/activator.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/examples/hello_world_test/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/hello_world_test/private/src/activator.c Sat Jun 7 12:44:31 2014
@@ -38,9 +38,9 @@ struct userData {
celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
apr_pool_t *pool;
- celix_status_t status = bundleContext_getMemoryPool(context, &pool);
- if (status == CELIX_SUCCESS) {
- *userData = apr_palloc(pool, sizeof(struct userData));
+ celix_status_t status = CELIX_SUCCESS;
+ *userData = malloc(sizeof(struct userData));
+ if (userData != NULL) {
((struct userData *)(*userData))->word = "Import";
} else {
status = CELIX_START_ERROR;
@@ -64,5 +64,6 @@ celix_status_t bundleActivator_stop(void
}
celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
+ free(userData);
return CELIX_SUCCESS;
}
Modified: incubator/celix/trunk/framework/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/CMakeLists.txt?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/CMakeLists.txt (original)
+++ incubator/celix/trunk/framework/CMakeLists.txt Sat Jun 7 12:44:31 2014
@@ -65,7 +65,7 @@ if (FRAMEWORK)
${IO}
)
- target_link_libraries(celix_framework celix_utils ${ZLIB_LIBRARY} ${APR_LIBRARY} ${APRUTIL_LIBRARY})
+ 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")
@@ -93,8 +93,10 @@ if (FRAMEWORK)
private/src/celix_log.c)
target_link_libraries(version_range_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
- add_executable(utils_test private/test/utils_test.cpp private/src/utils.c)
- target_link_libraries(utils_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
+ add_executable(utils_test
+ private/test/utils_test.cpp private/src/utils.c
+ )
+ target_link_libraries(utils_test ${APR_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils)
add_executable(service_tracker_test
private/test/service_tracker_test.cpp
Modified: incubator/celix/trunk/framework/private/include/attribute.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/attribute.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/attribute.h (original)
+++ incubator/celix/trunk/framework/private/include/attribute.h Sat Jun 7 12:44:31 2014
@@ -26,7 +26,6 @@
#ifndef ATTRIBUTE_H_
#define ATTRIBUTE_H_
-#include <apr_general.h>
#include "celix_errno.h"
typedef struct attribute *attribute_pt;
Modified: incubator/celix/trunk/framework/private/include/bundle_context_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/bundle_context_private.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/bundle_context_private.h (original)
+++ incubator/celix/trunk/framework/private/include/bundle_context_private.h Sat Jun 7 12:44:31 2014
@@ -32,9 +32,9 @@
#include "celix_log.h"
struct bundleContext {
+ apr_pool_t *pool;
struct framework * framework;
struct bundle * bundle;
- apr_pool_t *pool;
framework_logger_pt logger;
};
Modified: incubator/celix/trunk/framework/private/include/bundle_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/bundle_private.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/bundle_private.h (original)
+++ incubator/celix/trunk/framework/private/include/bundle_private.h Sat Jun 7 12:44:31 2014
@@ -37,7 +37,6 @@ struct bundle {
bundle_archive_pt archive;
array_list_pt modules;
manifest_pt manifest;
- apr_pool_t *memoryPool;
celix_thread_mutex_t lock;
int lockCount;
Modified: incubator/celix/trunk/framework/private/include/framework_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/framework_private.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/framework_private.h (original)
+++ incubator/celix/trunk/framework/private/include/framework_private.h Sat Jun 7 12:44:31 2014
@@ -48,6 +48,7 @@
#include "celix_threads.h"
struct framework {
+ apr_pool_t *pool;
struct bundle * bundle;
hash_map_pt installedBundleMap;
hash_map_pt installRequestMap;
@@ -73,8 +74,6 @@ struct framework {
bool interrupted;
bool shutdown;
- apr_pool_t *mp;
-
properties_pt configurationMap;
array_list_pt requests;
@@ -93,7 +92,7 @@ FRAMEWORK_EXPORT celix_status_t fw_getPr
FRAMEWORK_EXPORT celix_status_t fw_installBundle(framework_pt framework, bundle_pt * bundle, char * location, char *inputFile);
FRAMEWORK_EXPORT celix_status_t fw_uninstallBundle(framework_pt framework, bundle_pt bundle);
-FRAMEWORK_EXPORT celix_status_t framework_getBundleEntry(framework_pt framework, bundle_pt bundle, char *name, apr_pool_t *pool, char **entry);
+FRAMEWORK_EXPORT celix_status_t framework_getBundleEntry(framework_pt framework, bundle_pt bundle, char *name, char **entry);
FRAMEWORK_EXPORT celix_status_t fw_startBundle(framework_pt framework, bundle_pt bundle, int options);
FRAMEWORK_EXPORT celix_status_t framework_updateBundle(framework_pt framework, bundle_pt bundle, char *inputFile);
@@ -106,7 +105,7 @@ FRAMEWORK_EXPORT void fw_unregisterServi
FRAMEWORK_EXPORT celix_status_t fw_getServiceReferences(framework_pt framework, array_list_pt *references, bundle_pt bundle, const char * serviceName, char * filter);
FRAMEWORK_EXPORT celix_status_t fw_getService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, void **service);
FRAMEWORK_EXPORT celix_status_t framework_ungetService(framework_pt framework, bundle_pt bundle, service_reference_pt reference, bool *result);
-FRAMEWORK_EXPORT celix_status_t fw_getBundleRegisteredServices(framework_pt framework, apr_pool_t *pool, bundle_pt bundle, array_list_pt *services);
+FRAMEWORK_EXPORT celix_status_t fw_getBundleRegisteredServices(framework_pt framework, bundle_pt bundle, array_list_pt *services);
FRAMEWORK_EXPORT celix_status_t fw_getBundleServicesInUse(framework_pt framework, bundle_pt bundle, array_list_pt *services);
FRAMEWORK_EXPORT void fw_addServiceListener(framework_pt framework, bundle_pt bundle, service_listener_pt listener, char * filter);
@@ -124,7 +123,7 @@ FRAMEWORK_EXPORT celix_status_t fw_isSer
//bundle_archive_t fw_createArchive(long id, char * location);
//void revise(bundle_archive_t archive, char * location);
-FRAMEWORK_EXPORT celix_status_t getManifest(bundle_archive_pt archive, apr_pool_t *pool, manifest_pt *manifest);
+FRAMEWORK_EXPORT celix_status_t getManifest(bundle_archive_pt archive, manifest_pt *manifest);
FRAMEWORK_EXPORT bundle_pt findBundle(bundle_context_pt context);
FRAMEWORK_EXPORT service_registration_pt findRegistration(service_reference_pt reference);
Modified: incubator/celix/trunk/framework/private/include/listener_hook_info_impl.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/listener_hook_info_impl.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/listener_hook_info_impl.h (original)
+++ incubator/celix/trunk/framework/private/include/listener_hook_info_impl.h Sat Jun 7 12:44:31 2014
@@ -27,10 +27,8 @@
#ifndef LISTENER_HOOK_INFO_IMPL_H_
#define LISTENER_HOOK_INFO_IMPL_H_
-#include <apr_general.h>
-
#include "celix_errno.h"
-celix_status_t listenerHookInfo_create(apr_pool_t *pool);
+celix_status_t listenerHookInfo_create();
#endif /* LISTENER_HOOK_INFO_IMPL_H_ */
Modified: incubator/celix/trunk/framework/private/include/manifest_parser.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/manifest_parser.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/manifest_parser.h (original)
+++ incubator/celix/trunk/framework/private/include/manifest_parser.h Sat Jun 7 12:44:31 2014
@@ -34,11 +34,11 @@
typedef struct manifestParser * manifest_parser_pt;
-celix_status_t manifestParser_create(module_pt owner, manifest_pt manifest, apr_pool_t *memory_pool, manifest_parser_pt *manifest_parser);
+celix_status_t manifestParser_create(module_pt owner, manifest_pt manifest, manifest_parser_pt *manifest_parser);
-celix_status_t manifestParser_getSymbolicName(manifest_parser_pt parser, apr_pool_t *pool, char **symbolicName);
-celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, apr_pool_t *pool, version_pt *version);
-celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *capabilities);
-celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *requirements);
+celix_status_t manifestParser_getSymbolicName(manifest_parser_pt parser, char **symbolicName);
+celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, version_pt *version);
+celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, linked_list_pt *capabilities);
+celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, linked_list_pt *requirements);
#endif /* MANIFEST_PARSER_H_ */
Modified: incubator/celix/trunk/framework/private/include/service_tracker_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/service_tracker_private.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/service_tracker_private.h (original)
+++ incubator/celix/trunk/framework/private/include/service_tracker_private.h Sat Jun 7 12:44:31 2014
@@ -34,7 +34,6 @@ struct serviceTracker {
bundle_context_pt context;
char * filter;
- apr_pool_t *pool;
service_tracker_pt tracker;
service_tracker_customizer_pt customizer;
service_listener_pt listener;
Modified: incubator/celix/trunk/framework/private/include/version_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/version_private.h?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/version_private.h (original)
+++ incubator/celix/trunk/framework/private/include/version_private.h Sat Jun 7 12:44:31 2014
@@ -31,8 +31,6 @@
#include "version.h"
struct version {
- apr_pool_t *pool;
-
int major;
int minor;
int micro;
Modified: incubator/celix/trunk/framework/private/integration-test/test_bundle1/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/integration-test/test_bundle1/src/activator.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/integration-test/test_bundle1/src/activator.c (original)
+++ incubator/celix/trunk/framework/private/integration-test/test_bundle1/src/activator.c Sat Jun 7 12:44:31 2014
@@ -56,7 +56,6 @@ celix_status_t bundleActivator_start(voi
bundleContext_getMemoryPool(context, &pool);
activator->listener = apr_palloc(pool, sizeof(*activator->listener));
- activator->listener->pool = pool;
activator->listener->handle = activator;
activator->listener->frameworkEvent = test_frameworkEvent;
bundleContext_addFrameworkListener(context, activator->listener);
Modified: incubator/celix/trunk/framework/private/mock/attribute_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/attribute_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/attribute_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/attribute_mock.c Sat Jun 7 12:44:31 2014
@@ -27,9 +27,8 @@
#include "attribute.h"
-celix_status_t attribute_create(apr_pool_t *memory_pool, char * key, char * value, attribute_pt *attribute) {
+celix_status_t attribute_create(char * key, char * value, attribute_pt *attribute) {
mock_c()->actualCall("attribute_create")
- ->withPointerParameters("pool", memory_pool)
->withStringParameters("key", key)
->withStringParameters("value", value)
->_andPointerOutputParameters("attribute", (void **) attribute);
Modified: incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/bundle_archive_mock.c Sat Jun 7 12:44:31 2014
@@ -27,30 +27,27 @@
#include "bundle_archive.h"
-celix_status_t bundleArchive_create(framework_logger_pt logger, char * archiveRoot, long id, char * location, char *inputFile, apr_pool_t *mp, bundle_archive_pt *bundle_archive) {
+celix_status_t bundleArchive_create(framework_logger_pt logger, char * archiveRoot, long id, char * location, char *inputFile, bundle_archive_pt *bundle_archive) {
mock_c()->actualCall("bundleArchive_create")
->withPointerParameters("logger", logger)
->withStringParameters("archiveRoot", archiveRoot)
->withIntParameters("id", id)
->withStringParameters("location", location)
->withStringParameters("inputFile", inputFile)
- ->withPointerParameters("mp", mp)
->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundleArchive_createSystemBundleArchive(apr_pool_t *mp, framework_logger_pt logger, bundle_archive_pt *bundle_archive) {
+celix_status_t bundleArchive_createSystemBundleArchive(framework_logger_pt logger, bundle_archive_pt *bundle_archive) {
mock_c()->actualCall("bundleArchive_createSystemBundleArchive")
- ->withPointerParameters("pool", mp)
->withPointerParameters("logger", logger)
->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundleArchive_recreate(char * archiveRoot, apr_pool_t *mp, bundle_archive_pt *bundle_archive) {
+celix_status_t bundleArchive_recreate(char * archiveRoot, bundle_archive_pt *bundle_archive) {
mock_c()->actualCall("bundleArchive_recreate")
->withStringParameters("archiveRoot", archiveRoot)
- ->withPointerParameters("mp", mp)
->_andPointerOutputParameters("bundle_archive", (void **) bundle_archive);
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/bundle_cache_mock.c Sat Jun 7 12:44:31 2014
@@ -27,17 +27,17 @@
#include "bundle_cache.h"
-celix_status_t bundleCache_create(properties_pt configurationMap, apr_pool_t *mp, framework_logger_pt logger, bundle_cache_pt *bundle_cache) {
+celix_status_t bundleCache_create(properties_pt configurationMap, framework_logger_pt logger, bundle_cache_pt *bundle_cache) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundleCache_getArchives(bundle_cache_pt cache, apr_pool_t *pool, array_list_pt *archives) {
+celix_status_t bundleCache_getArchives(bundle_cache_pt cache, array_list_pt *archives) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundleCache_createArchive(bundle_cache_pt cache, apr_pool_t *bundlePool, long id, char * location, char *inputFile, bundle_archive_pt *archive) {
+celix_status_t bundleCache_createArchive(bundle_cache_pt cache, long id, char * location, char *inputFile, bundle_archive_pt *archive) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/bundle_context_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_context_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_context_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/bundle_context_mock.c Sat Jun 7 12:44:31 2014
@@ -27,8 +27,9 @@
#include "bundle_context.h"
-celix_status_t bundleContext_create(framework_pt framework, framework_logger_pt logger, bundle_pt bundle, bundle_context_pt *bundle_context) {
+celix_status_t bundleContext_create(apr_pool_t *pool, framework_pt framework, framework_logger_pt logger, bundle_pt bundle, bundle_context_pt *bundle_context) {
mock_c()->actualCall("bundleContext_create")
+ ->withPointerParameters("pool", pool)
->withPointerParameters("framework", framework)
->withPointerParameters("logger", logger)
->withPointerParameters("bundle", bundle)
Modified: incubator/celix/trunk/framework/private/mock/bundle_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/bundle_mock.c Sat Jun 7 12:44:31 2014
@@ -27,11 +27,11 @@
#include "bundle_private.h"
-celix_status_t bundle_create(bundle_pt * bundle, framework_logger_pt logger, apr_pool_t *mp) {
+celix_status_t bundle_create(bundle_pt * bundle, framework_logger_pt logger) {
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundle_createFromArchive(bundle_pt * bundle, framework_pt framework, bundle_archive_pt archive, apr_pool_t *bundlePool) {
+celix_status_t bundle_createFromArchive(bundle_pt * bundle, framework_pt framework, bundle_archive_pt archive) {
return mock_c()->returnValue().value.intValue;
}
@@ -82,7 +82,7 @@ celix_status_t bundle_setContext(bundle_
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundle_getEntry(bundle_pt bundle, char * name, apr_pool_t *pool, char **entry) {
+celix_status_t bundle_getEntry(bundle_pt bundle, char * name, char **entry) {
return mock_c()->returnValue().value.intValue;
}
@@ -160,7 +160,7 @@ celix_status_t bundle_isLockable(bundle_
return mock_c()->returnValue().value.intValue;
}
-celix_status_t bundle_getLockingThread(bundle_pt bundle, apr_os_thread_t *thread) {
+celix_status_t bundle_getLockingThread(bundle_pt bundle, celix_thread_t *thread) {
return mock_c()->returnValue().value.intValue;
}
@@ -191,7 +191,7 @@ celix_status_t bundle_getBundleId(bundle
}
-celix_status_t bundle_getRegisteredServices(bundle_pt bundle, apr_pool_t *pool, array_list_pt *list) {
+celix_status_t bundle_getRegisteredServices(bundle_pt bundle, array_list_pt *list) {
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/bundle_revision_mock.c Sat Jun 7 12:44:31 2014
@@ -27,7 +27,7 @@
#include "bundle_revision.h"
-celix_status_t bundleRevision_create(apr_pool_t *pool, framework_logger_pt logger, char *root, char *location, long revisionNr, char *inputFile, bundle_revision_pt *bundle_revision) {
+celix_status_t bundleRevision_create(framework_logger_pt logger, char *root, char *location, long revisionNr, char *inputFile, bundle_revision_pt *bundle_revision) {
mock_c()->actualCall("bundleRevision_create");
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/capability_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/capability_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/capability_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/capability_mock.c Sat Jun 7 12:44:31 2014
@@ -27,7 +27,7 @@
#include "capability.h"
-celix_status_t capability_create(apr_pool_t *pool, module_pt module, hash_map_pt directives, hash_map_pt attributes, capability_pt *capability) {
+celix_status_t capability_create(module_pt module, hash_map_pt directives, hash_map_pt attributes, capability_pt *capability) {
mock_c()->actualCall("capability_create");
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/filter_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/filter_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/filter_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/filter_mock.c Sat Jun 7 12:44:31 2014
@@ -27,7 +27,7 @@
#include "filter.h"
-filter_pt filter_create(char * filterString, apr_pool_t *pool) {
+filter_pt filter_create(char * filterString) {
return mock_c()->returnValue().value.pointerValue;
}
Modified: incubator/celix/trunk/framework/private/mock/framework_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/framework_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/framework_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/framework_mock.c Sat Jun 7 12:44:31 2014
@@ -75,12 +75,11 @@ celix_status_t fw_uninstallBundle(framew
return mock_c()->returnValue().value.intValue;
}
-celix_status_t framework_getBundleEntry(framework_pt framework, bundle_pt bundle, char *name, apr_pool_t *pool, char **entry) {
+celix_status_t framework_getBundleEntry(framework_pt framework, bundle_pt bundle, char *name, char **entry) {
mock_c()->actualCall("framework_getBundleEntry")
->withPointerParameters("framework", framework)
->withPointerParameters("bundle", bundle)
->withStringParameters("name", name)
- ->withPointerParameters("pool", pool)
->_andStringOutputParameters("entry", (const char **) entry);
return mock_c()->returnValue().value.intValue;
}
@@ -166,7 +165,7 @@ celix_status_t framework_ungetService(fr
return mock_c()->returnValue().value.intValue;
}
-celix_status_t fw_getBundleRegisteredServices(framework_pt framework, apr_pool_t *pool, bundle_pt bundle, array_list_pt *services) {
+celix_status_t fw_getBundleRegisteredServices(framework_pt framework, bundle_pt bundle, array_list_pt *services) {
mock_c()->actualCall("fw_getBundleRegisteredServices");
return mock_c()->returnValue().value.intValue;
}
@@ -240,10 +239,9 @@ celix_status_t fw_isServiceAssignable(fr
//void revise(bundle_archive_t archive, char * location) {
-celix_status_t getManifest(bundle_archive_pt archive, apr_pool_t *pool, manifest_pt *manifest) {
+celix_status_t getManifest(bundle_archive_pt archive, manifest_pt *manifest) {
mock_c()->actualCall("getManifest")
->withPointerParameters("archive", archive)
- ->withPointerParameters("pool", pool)
->_andPointerOutputParameters("manifest", (void **) manifest);
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/manifest_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/manifest_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/manifest_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/manifest_mock.c Sat Jun 7 12:44:31 2014
@@ -27,16 +27,14 @@
#include "manifest.h"
-celix_status_t manifest_create(apr_pool_t *pool, manifest_pt *manifest) {
+celix_status_t manifest_create(manifest_pt *manifest) {
mock_c()->actualCall("manifest_create")
- ->withPointerParameters("pool", pool)
->_andPointerOutputParameters("manifest", (void **) manifest);
return mock_c()->returnValue().value.intValue;
}
-celix_status_t manifest_createFromFile(apr_pool_t *pool, char *filename, manifest_pt *manifest) {
+celix_status_t manifest_createFromFile(char *filename, manifest_pt *manifest) {
mock_c()->actualCall("manifest_createFromFile")
- ->withPointerParameters("pool", pool)
->withStringParameters("filename", filename)
->_andPointerOutputParameters("manifest", (void **) manifest);
return mock_c()->returnValue().value.intValue;
Modified: incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/manifest_parser_mock.c Sat Jun 7 12:44:31 2014
@@ -27,27 +27,27 @@
#include "manifest_parser.h"
-celix_status_t manifestParser_create(module_pt owner, manifest_pt manifest, apr_pool_t *memory_pool, manifest_parser_pt *manifest_parser) {
+celix_status_t manifestParser_create(module_pt owner, manifest_pt manifest, manifest_parser_pt *manifest_parser) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t manifestParser_getSymbolicName(manifest_parser_pt parser, apr_pool_t *pool, char **symbolicName) {
+celix_status_t manifestParser_getSymbolicName(manifest_parser_pt parser, char **symbolicName) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, apr_pool_t *pool, version_pt *version) {
+celix_status_t manifestParser_getBundleVersion(manifest_parser_pt parser, version_pt *version) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *capabilities) {
+celix_status_t manifestParser_getCapabilities(manifest_parser_pt parser, linked_list_pt *capabilities) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, apr_pool_t *pool, linked_list_pt *requirements) {
+celix_status_t manifestParser_getRequirements(manifest_parser_pt parser, linked_list_pt *requirements) {
mock_c()->actualCall("bundle_getCurrentModule");
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/requirement_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/requirement_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/requirement_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/requirement_mock.c Sat Jun 7 12:44:31 2014
@@ -27,9 +27,8 @@
#include "requirement.h"
-celix_status_t requirement_create(apr_pool_t *pool, hash_map_pt directives, hash_map_pt attributes, requirement_pt *requirement) {
+celix_status_t requirement_create(hash_map_pt directives, hash_map_pt attributes, requirement_pt *requirement) {
mock_c()->actualCall("requirement_create")
- ->withPointerParameters("pool", pool)
->withPointerParameters("directives", directives)
->withPointerParameters("attributes", attributes)
->_andPointerOutputParameters("requirement", (void **) requirement);
Modified: incubator/celix/trunk/framework/private/mock/service_reference_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/service_reference_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/service_reference_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/service_reference_mock.c Sat Jun 7 12:44:31 2014
@@ -29,7 +29,6 @@
celix_status_t serviceReference_create(bundle_pt bundle, service_registration_pt registration, service_reference_pt *reference) {
mock_c()->actualCall("serviceReference_create")
- ->withPointerParameters("pool", pool)
->withPointerParameters("bundle", bundle)
->withPointerParameters("registration", registration)
->_andPointerOutputParameters("reference", (void **) reference);
@@ -38,7 +37,7 @@ celix_status_t serviceReference_create(b
celix_status_t serviceReference_destroy(service_reference_pt reference) {
mock_c()->actualCall("serviceReference_destroy")
- ->withPointerParameters("reference", reference)
+ ->withPointerParameters("reference", reference);
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/service_registry_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/service_registry_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/service_registry_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/service_registry_mock.c Sat Jun 7 12:44:31 2014
@@ -37,11 +37,6 @@ celix_status_t serviceRegistry_destroy(s
return mock_c()->returnValue().value.intValue;
}
-celix_status_t serviceRegistry_destroy(service_registry_pt registry) {
- mock_c()->actualCall("serviceRegistry_destroy");
- return mock_c()->returnValue().value.intValue;
-}
-
celix_status_t serviceRegistry_getRegisteredServices(service_registry_pt registry, bundle_pt bundle, array_list_pt *services) {
mock_c()->actualCall("serviceRegistry_getRegisteredServices");
return mock_c()->returnValue().value.intValue;
@@ -121,3 +116,8 @@ celix_status_t serviceRegistry_servicePr
return mock_c()->returnValue().value.intValue;
}
+celix_status_t serviceRegistry_removeReference(service_reference_pt reference) {
+ mock_c()->actualCall("serviceRegistry_removeReference");
+ return mock_c()->returnValue().value.intValue;
+}
+
Modified: incubator/celix/trunk/framework/private/mock/service_tracker_customizer_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/service_tracker_customizer_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/service_tracker_customizer_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/service_tracker_customizer_mock.c Sat Jun 7 12:44:31 2014
@@ -27,7 +27,7 @@
#include "service_tracker_customizer_private.h"
-celix_status_t serviceTrackerCustomizer_create(apr_pool_t *pool, void *handle,
+celix_status_t serviceTrackerCustomizer_create(void *handle,
adding_callback_pt addingFunction, added_callback_pt addedFunction,
modified_callback_pt modifiedFunction, removed_callback_pt removedFunction,
service_tracker_customizer_pt *customizer) {
Modified: incubator/celix/trunk/framework/private/mock/version_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/version_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/version_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/version_mock.c Sat Jun 7 12:44:31 2014
@@ -27,27 +27,30 @@
#include "version.h"
-celix_status_t version_createVersion(apr_pool_t *pool, int major, int minor, int micro, char * qualifier, version_pt *version) {
+celix_status_t version_createVersion(int major, int minor, int micro, char * qualifier, version_pt *version) {
mock_c()->actualCall("version_createVersion");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t version_clone(version_pt version, apr_pool_t *pool, version_pt *clone) {
+celix_status_t version_destroy(version_pt version) {
+ mock_c()->actualCall("version_destroy");
+ return mock_c()->returnValue().value.intValue;
+}
+
+celix_status_t version_clone(version_pt version, version_pt *clone) {
mock_c()->actualCall("version_clone");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t version_createVersionFromString(apr_pool_t *pool, char * versionStr, version_pt *version) {
+celix_status_t version_createVersionFromString(char * versionStr, version_pt *version) {
mock_c()->actualCall("version_createVersionFromString")
- ->withPointerParameters("pool", pool)
->withStringParameters("versionStr", versionStr)
->_andPointerOutputParameters("version", (void **) version);
return mock_c()->returnValue().value.intValue;
}
-celix_status_t version_createEmptyVersion(apr_pool_t *pool, version_pt *version) {
+celix_status_t version_createEmptyVersion(version_pt *version) {
mock_c()->actualCall("version_createEmptyVersion")
- ->withPointerParameters("pool", pool)
->_andPointerOutputParameters("version", (void **) version);
return mock_c()->returnValue().value.intValue;
}
@@ -77,7 +80,7 @@ celix_status_t version_compareTo(version
return mock_c()->returnValue().value.intValue;
}
-celix_status_t version_toString(version_pt version, apr_pool_t *pool, char **string) {
+celix_status_t version_toString(version_pt version, char **string) {
mock_c()->actualCall("version_toString");
return mock_c()->returnValue().value.intValue;
}
Modified: incubator/celix/trunk/framework/private/mock/version_range_mock.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/mock/version_range_mock.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/mock/version_range_mock.c (original)
+++ incubator/celix/trunk/framework/private/mock/version_range_mock.c Sat Jun 7 12:44:31 2014
@@ -27,14 +27,13 @@
#include "version_range.h"
-celix_status_t versionRange_createVersionRange(apr_pool_t *pool, version_pt low, bool isLowInclusive, version_pt high, bool isHighInclusive, version_range_pt *versionRange) {
+celix_status_t versionRange_createVersionRange(version_pt low, bool isLowInclusive, version_pt high, bool isHighInclusive, version_range_pt *versionRange) {
mock_c()->actualCall("versionRange_createVersionRange");
return mock_c()->returnValue().value.intValue;
}
-celix_status_t versionRange_createInfiniteVersionRange(apr_pool_t *pool, version_range_pt *range) {
+celix_status_t versionRange_createInfiniteVersionRange(version_range_pt *range) {
mock_c()->actualCall("versionRange_createInfiniteVersionRange")
- ->withPointerParameters("pool", pool)
->_andPointerOutputParameters("range", (void **) range);
return mock_c()->returnValue().value.intValue;
}
@@ -47,9 +46,8 @@ celix_status_t versionRange_isInRange(ve
return mock_c()->returnValue().value.intValue;
}
-celix_status_t versionRange_parse(apr_pool_t *pool, char * rangeStr, version_range_pt *range) {
+celix_status_t versionRange_parse(char * rangeStr, version_range_pt *range) {
mock_c()->actualCall("versionRange_parse")
- ->withPointerParameters("pool", pool)
->withStringParameters("rangeStr", rangeStr)
->_andPointerOutputParameters("range", (void **) range);
return mock_c()->returnValue().value.intValue;
Modified: incubator/celix/trunk/framework/private/src/bundle.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle.c Sat Jun 7 12:44:31 2014
@@ -25,7 +25,6 @@
*/
#include <stdlib.h>
#include <string.h>
-#include <apr_strings.h>
#include "framework_private.h"
#include "bundle_private.h"
@@ -42,20 +41,18 @@
celix_status_t bundle_createModule(bundle_pt bundle, module_pt *module);
celix_status_t bundle_closeRevisions(bundle_pt bundle);
-celix_status_t bundle_create(bundle_pt * bundle, framework_logger_pt logger, apr_pool_t *mp) {
+celix_status_t bundle_create(bundle_pt * bundle, framework_logger_pt logger) {
celix_status_t status = CELIX_SUCCESS;
bundle_archive_pt archive = NULL;
- *bundle = (bundle_pt) apr_palloc(mp, sizeof(**bundle));
+ *bundle = (bundle_pt) malloc(sizeof(**bundle));
if (*bundle == NULL) {
return CELIX_ENOMEM;
}
status = bundleArchive_createSystemBundleArchive(logger, &archive);
if (status == CELIX_SUCCESS) {
module_pt module;
- apr_status_t apr_status;
- (*bundle)->memoryPool = mp;
(*bundle)->archive = archive;
(*bundle)->activator = NULL;
(*bundle)->context = NULL;
@@ -68,8 +65,8 @@ celix_status_t bundle_create(bundle_pt *
bundle_addModule(*bundle, module);
// (*bundle)->module = module;
- apr_status = celixThreadMutex_create(&(*bundle)->lock, NULL);
- if (apr_status != APR_SUCCESS) {
+ status = celixThreadMutex_create(&(*bundle)->lock, NULL);
+ if (status != CELIX_SUCCESS) {
status = CELIX_ILLEGAL_STATE;
} else {
(*bundle)->lockCount = 0;
@@ -84,16 +81,15 @@ celix_status_t bundle_create(bundle_pt *
return status;
}
-celix_status_t bundle_createFromArchive(bundle_pt * bundle, framework_pt framework, bundle_archive_pt archive, apr_pool_t *bundlePool) {
+celix_status_t bundle_createFromArchive(bundle_pt * bundle, framework_pt framework, bundle_archive_pt archive) {
module_pt module;
celix_status_t status = CELIX_SUCCESS;
- *bundle = (bundle_pt) apr_pcalloc(bundlePool, sizeof(**bundle));
+ *bundle = (bundle_pt) malloc(sizeof(**bundle));
if (*bundle == NULL) {
return CELIX_ENOMEM;
}
- (*bundle)->memoryPool = bundlePool;
(*bundle)->archive = archive;
(*bundle)->activator = NULL;
(*bundle)->context = NULL;
@@ -101,15 +97,12 @@ celix_status_t bundle_createFromArchive(
(*bundle)->state = OSGI_FRAMEWORK_BUNDLE_INSTALLED;
(*bundle)->modules = NULL;
arrayList_create(&(*bundle)->modules);
-
status = bundle_createModule(*bundle, &module);
if (status == CELIX_SUCCESS) {
- apr_status_t apr_status;
-
bundle_addModule(*bundle, module);
- apr_status = celixThreadMutex_create(&(*bundle)->lock, NULL);
- if (apr_status != APR_SUCCESS) {
+ status = celixThreadMutex_create(&(*bundle)->lock, NULL);
+ if (status != CELIX_SUCCESS) {
status = CELIX_ILLEGAL_STATE;
} else {
(*bundle)->lockCount = 0;
@@ -136,7 +129,6 @@ celix_status_t bundle_destroy(bundle_pt
arrayList_destroy(bundle->modules);
celixThreadMutex_destroy(&bundle->lock);
- apr_pool_destroy(bundle->memoryPool);
return CELIX_SUCCESS;
}
@@ -199,8 +191,8 @@ celix_status_t bundle_setContext(bundle_
return CELIX_SUCCESS;
}
-celix_status_t bundle_getEntry(bundle_pt bundle, char * name, apr_pool_t *pool, char **entry) {
- return framework_getBundleEntry(bundle->framework, bundle, name, pool, entry);
+celix_status_t bundle_getEntry(bundle_pt bundle, char * name, char **entry) {
+ return framework_getBundleEntry(bundle->framework, bundle, name, entry);
}
celix_status_t bundle_getState(bundle_pt bundle, bundle_state_e *state) {
@@ -227,15 +219,11 @@ 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;
+ char moduleId[512];
+ snprintf(moduleId, sizeof(moduleId), "%ld.%d", bundleId, revision);
- apr_pool_create(&pool, bundle->memoryPool);
- 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);
+ *module = module_create(headerMap, strdup(moduleId), bundle);
if (*module != NULL) {
version_pt bundleVersion = module_getVersion(*module);
@@ -274,7 +262,6 @@ celix_status_t bundle_createModule(bundl
arrayList_destroy(bundles);
}
}
- apr_pool_destroy(pool);
}
}
@@ -478,10 +465,9 @@ celix_status_t bundle_isSystemBundle(bun
celix_status_t bundle_isLockable(bundle_pt bundle, bool *lockable) {
celix_status_t status = CELIX_SUCCESS;
- apr_status_t apr_status;
- apr_status = celixThreadMutex_lock(&bundle->lock);
- if (apr_status != APR_SUCCESS) {
+ status = celixThreadMutex_lock(&bundle->lock);
+ if (status != 0) {
status = CELIX_BUNDLE_EXCEPTION;
} else {
bool equals;
@@ -490,8 +476,8 @@ celix_status_t bundle_isLockable(bundle_
*lockable = (bundle->lockCount == 0) || (equals);
}
- apr_status = celixThreadMutex_unlock(&bundle->lock);
- if (apr_status != APR_SUCCESS) {
+ status = celixThreadMutex_unlock(&bundle->lock);
+ if (status != 0) {
status = CELIX_BUNDLE_EXCEPTION;
}
}
@@ -503,16 +489,15 @@ celix_status_t bundle_isLockable(bundle_
celix_status_t bundle_getLockingThread(bundle_pt bundle, celix_thread_t *thread) {
celix_status_t status = CELIX_SUCCESS;
- apr_status_t apr_status;
- apr_status = celixThreadMutex_lock(&bundle->lock);
- if (apr_status != APR_SUCCESS) {
+ status = celixThreadMutex_lock(&bundle->lock);
+ if (status != 0) {
status = CELIX_BUNDLE_EXCEPTION;
} else {
*thread = bundle->lockThread;
- apr_status = celixThreadMutex_unlock(&bundle->lock);
- if (apr_status != APR_SUCCESS) {
+ status = celixThreadMutex_unlock(&bundle->lock);
+ if (status != 0) {
status = CELIX_BUNDLE_EXCEPTION;
}
}
@@ -664,10 +649,10 @@ celix_status_t bundle_getBundleId(bundle
return status;
}
-celix_status_t bundle_getRegisteredServices(bundle_pt bundle, apr_pool_t *pool, array_list_pt *list) {
+celix_status_t bundle_getRegisteredServices(bundle_pt bundle, array_list_pt *list) {
celix_status_t status = CELIX_SUCCESS;
- status = fw_getBundleRegisteredServices(bundle->framework, pool, bundle, list);
+ status = fw_getBundleRegisteredServices(bundle->framework, bundle, list);
framework_logIfError(bundle->framework->logger, status, NULL, "Failed to get registered services");
@@ -684,20 +669,6 @@ celix_status_t bundle_getServicesInUse(b
return status;
}
-celix_status_t bundle_getMemoryPool(bundle_pt bundle, apr_pool_t **pool) {
- celix_status_t status = CELIX_SUCCESS;
-
- if (bundle != NULL && *pool == NULL) {
- *pool = bundle->memoryPool;
- } else {
- status = CELIX_ILLEGAL_ARGUMENT;
- }
-
- framework_logIfError(bundle->framework->logger, status, NULL, "Failed to get memory pool");
-
- return status;
-}
-
celix_status_t bundle_setFramework(bundle_pt bundle, framework_pt framework) {
celix_status_t status = CELIX_SUCCESS;
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=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_archive.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_archive.c Sat Jun 7 12:44:31 2014
@@ -692,7 +692,6 @@ static celix_status_t bundleArchive_dele
struct dirent *dp;
while ((dp = readdir(dir)) != NULL) {
if ((strcmp((dp->d_name), ".") != 0) && (strcmp((dp->d_name), "..") != 0)) {
- apr_pool_t *subpool;
char subdir[512];
snprintf(subdir, sizeof(subdir), "%s/%s", directory, dp->d_name);
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=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_cache.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_cache.c Sat Jun 7 12:44:31 2014
@@ -147,7 +147,6 @@ static celix_status_t bundleCache_delete
struct dirent *dp;
while ((dp = readdir(dir)) != NULL) {
if ((strcmp((dp->d_name), ".") != 0) && (strcmp((dp->d_name), "..") != 0)) {
- apr_pool_t *subpool;
char subdir[512];
snprintf(subdir, sizeof(subdir), "%s/%s", directory, dp->d_name);
Modified: incubator/celix/trunk/framework/private/src/bundle_context.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle_context.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_context.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_context.c Sat Jun 7 12:44:31 2014
@@ -32,35 +32,24 @@
#include "bundle.h"
#include "celix_log.h"
-celix_status_t bundleContext_create(framework_pt framework, framework_logger_pt logger, bundle_pt bundle, bundle_context_pt *bundle_context) {
+celix_status_t bundleContext_create(apr_pool_t *pool, framework_pt framework, framework_logger_pt logger, bundle_pt bundle, bundle_context_pt *bundle_context) {
celix_status_t status = CELIX_SUCCESS;
bundle_context_pt context = NULL;
if (*bundle_context != NULL && framework == NULL && bundle == NULL) {
status = CELIX_ILLEGAL_ARGUMENT;
} else {
- apr_pool_t *pool = NULL;
-
- status = bundle_getMemoryPool(bundle, &pool);
- if (status == CELIX_SUCCESS) {
- apr_pool_t *contextPool = NULL;
- if (apr_pool_create(&contextPool, pool) != APR_SUCCESS) {
- status = CELIX_ENOMEM;
- } else {
- context = apr_palloc(contextPool, sizeof(*context));
- if (!context) {
- status = CELIX_ENOMEM;
- } else {
- context->pool = contextPool;
- context->framework = framework;
- context->bundle = bundle;
- context->logger = logger;
-
- *bundle_context = context;
- }
- }
- }
+ context = malloc(sizeof(*context));
+ if (!context) {
+ status = CELIX_ENOMEM;
+ } else {
+ context->pool = pool;
+ context->framework = framework;
+ context->bundle = bundle;
+ context->logger = logger;
+ *bundle_context = context;
+ }
}
framework_logIfError(logger, status, NULL, "Failed to create context");
@@ -72,8 +61,6 @@ celix_status_t bundleContext_destroy(bun
celix_status_t status = CELIX_SUCCESS;
if (context != NULL) {
- apr_pool_t *contextPool = context->pool;
- apr_pool_destroy(context->pool);
context = NULL;
} else {
status = CELIX_ILLEGAL_ARGUMENT;
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=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/celix_errorcodes.c (original)
+++ incubator/celix/trunk/framework/private/src/celix_errorcodes.c Sat Jun 7 12:44:31 2014
@@ -23,7 +23,7 @@
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
* \copyright Apache License, Version 2.0
*/
-#include <apr_strings.h>
+#include <string.h>
#include "celix_errno.h"
@@ -53,10 +53,10 @@ static char *celix_error_string(celix_st
char *celix_strerror(celix_status_t errorcode, char *buffer, size_t bufferSize) {
if (errorcode < CELIX_START_ERROR) {
- return apr_strerror(errorcode, buffer, bufferSize);
+ return strerror(errorcode);
} else {
char * str = celix_error_string(errorcode);
- apr_cpystrn(buffer, str, bufferSize);
+ strncpy(buffer, str, bufferSize);
return buffer;
}
}
Modified: incubator/celix/trunk/framework/private/src/framework.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/framework.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/framework.c (original)
+++ incubator/celix/trunk/framework/private/src/framework.c Sat Jun 7 12:44:31 2014
@@ -30,16 +30,13 @@
#include <sys/types.h>
#include "celixbool.h"
#include <math.h>
-#include <apr_general.h>
-//#include <apr_strings.h>
-#include <apr_uuid.h>
#ifdef _WIN32
#include <winbase.h>
#include <windows.h>
#else
#include <dlfcn.h>
#endif
-
+#include <uuid/uuid.h>
#include "framework_private.h"
#include "filter.h"
@@ -163,19 +160,18 @@ typedef struct request *request_pt;
framework_logger_pt logger;
-celix_status_t framework_create(framework_pt *framework, apr_pool_t *memoryPool, properties_pt config) {
+celix_status_t framework_create(framework_pt *framework, apr_pool_t *pool, properties_pt config) {
celix_status_t status = CELIX_SUCCESS;
char *error = NULL;
logger = hashMap_get(config, "logger");
if (logger == NULL) {
- logger = apr_palloc(memoryPool, sizeof(*logger));
+ logger = malloc(sizeof(*logger));
logger->logFunction = frameworkLogger_log;
}
- *framework = (framework_pt) apr_palloc(memoryPool, sizeof(**framework));
+ *framework = (framework_pt) malloc(sizeof(**framework));
if (*framework != NULL) {
- status = CELIX_DO_IF(status, apr_pool_create(&(*framework)->mp, memoryPool));
status = CELIX_DO_IF(status, celixThreadCondition_init(&(*framework)->condition, NULL));
status = CELIX_DO_IF(status, celixThreadMutex_create(&(*framework)->mutex, NULL));
status = CELIX_DO_IF(status, celixThreadMutex_create(&(*framework)->bundleLock, NULL));
@@ -183,6 +179,7 @@ celix_status_t framework_create(framewor
status = CELIX_DO_IF(status, celixThreadMutex_create(&(*framework)->dispatcherLock, NULL));
status = CELIX_DO_IF(status, celixThreadCondition_init(&(*framework)->dispatcher, NULL));
if (status == CELIX_SUCCESS) {
+ (*framework)->pool = pool;
(*framework)->bundle = NULL;
(*framework)->installedBundleMap = NULL;
(*framework)->registry = NULL;
@@ -202,9 +199,7 @@ celix_status_t framework_create(framewor
(*framework)->logger = logger;
- apr_pool_t *pool = NULL;
- apr_pool_create(&pool, (*framework)->mp);
- status = CELIX_DO_IF(status, bundle_create(&(*framework)->bundle, (*framework)->logger, pool));
+ status = CELIX_DO_IF(status, bundle_create(&(*framework)->bundle, (*framework)->logger));
status = CELIX_DO_IF(status, arrayList_create(&(*framework)->globalLockWaitersList));
status = CELIX_DO_IF(status, bundle_setFramework((*framework)->bundle, (*framework)));
if (status == CELIX_SUCCESS) {
@@ -220,7 +215,7 @@ celix_status_t framework_create(framewor
} else {
error = "FW exception";
status = CELIX_FRAMEWORK_EXCEPTION;
- fw_logCode((*framework)->logger, OSGI_FRAMEWORK_LOG_ERROR, CELIX_ENOMEM, "Could not create framework");
+ fw_logCode(logger, OSGI_FRAMEWORK_LOG_ERROR, CELIX_ENOMEM, "Could not create framework");
}
return status;
@@ -270,8 +265,6 @@ celix_status_t framework_destroy(framewo
hashMap_destroy(framework->installedBundleMap, false, false);
- apr_pool_destroy(framework->mp);
-
return status;
}
@@ -306,7 +299,7 @@ celix_status_t fw_init(framework_pt fram
linked_list_pt wires;
array_list_pt archives;
bundle_archive_pt archive = NULL;
- char uuid[APR_UUID_FORMATTED_LENGTH+1];
+ char uuid[37];
celix_status_t status = CELIX_SUCCESS;
status = CELIX_DO_IF(status, framework_acquireBundleLock(framework, framework->bundle, OSGI_FRAMEWORK_BUNDLE_INSTALLED|OSGI_FRAMEWORK_BUNDLE_RESOLVED|OSGI_FRAMEWORK_BUNDLE_STARTING|OSGI_FRAMEWORK_BUNDLE_ACTIVE));
@@ -334,9 +327,9 @@ celix_status_t fw_init(framework_pt fram
if (status == CELIX_SUCCESS) {
/*create and store framework uuid*/
- apr_uuid_t aprUuid;
- apr_uuid_get(&aprUuid);
- apr_uuid_format(uuid, &aprUuid);
+ uuid_t uid;
+ uuid_generate(uid);
+ uuid_unparse(uid, uuid);
setenv(OSGI_FRAMEWORK_FRAMEWORK_UUID, uuid, true);
framework->installedBundleMap = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
@@ -396,7 +389,9 @@ celix_status_t fw_init(framework_pt fram
}
bundle_context_pt context = NULL;
- status = CELIX_DO_IF(status, bundleContext_create(framework, framework->logger, framework->bundle, &context));
+ apr_pool_t *bundlePool = NULL;
+ apr_pool_create(&bundlePool, framework->pool);
+ status = CELIX_DO_IF(status, bundleContext_create(bundlePool, framework, framework->logger, framework->bundle, &context));
status = CELIX_DO_IF(status, bundle_setContext(framework->bundle, context));
if (status == CELIX_SUCCESS) {
activator_pt activator = NULL;
@@ -503,7 +498,6 @@ celix_status_t fw_installBundle2(framewo
celix_status_t status = CELIX_SUCCESS;
// bundle_archive_pt bundle_archive = NULL;
bundle_state_e state;
- apr_pool_t *bundlePool;
bool locked;
status = CELIX_DO_IF(status, framework_acquireInstallLock(framework, location));
@@ -523,7 +517,6 @@ celix_status_t fw_installBundle2(framewo
return CELIX_SUCCESS;
}
- apr_pool_create(&bundlePool, framework->mp);
if (archive == NULL) {
id = framework_getNextBundleId(framework);
status = CELIX_DO_IF(status, bundleCache_createArchive(framework->cache, id, location, inputFile, &archive));
@@ -537,7 +530,7 @@ celix_status_t fw_installBundle2(framewo
if (!locked) {
status = CELIX_BUNDLE_EXCEPTION;
} else {
- status = CELIX_DO_IF(status, bundle_createFromArchive(bundle, framework, archive, bundlePool));
+ status = CELIX_DO_IF(status, bundle_createFromArchive(bundle, framework, archive));
framework_releaseGlobalLock(framework);
if (status == CELIX_SUCCESS) {
@@ -545,7 +538,6 @@ celix_status_t fw_installBundle2(framewo
} else {
status = CELIX_BUNDLE_EXCEPTION;
status = CELIX_DO_IF(status, bundleArchive_closeAndDelete(archive));
- apr_pool_destroy(bundlePool);
}
}
}
@@ -561,7 +553,7 @@ celix_status_t fw_installBundle2(framewo
return status;
}
-celix_status_t framework_getBundleEntry(framework_pt framework, bundle_pt bundle, char *name, apr_pool_t *pool, char **entry) {
+celix_status_t framework_getBundleEntry(framework_pt framework, bundle_pt bundle, char *name, char **entry) {
celix_status_t status = CELIX_SUCCESS;
bundle_revision_pt revision;
@@ -644,7 +636,9 @@ celix_status_t fw_startBundle(framework_
name = NULL;
bundle_getCurrentModule(bundle, &module);
module_getSymbolicName(module, &name);
- status = CELIX_DO_IF(status, bundleContext_create(framework, framework->logger, bundle, &context));
+ apr_pool_t *bundlePool = NULL;
+ apr_pool_create(&bundlePool, framework->pool);
+ status = CELIX_DO_IF(status, bundleContext_create(bundlePool, framework, framework->logger, bundle, &context));
status = CELIX_DO_IF(status, bundle_setContext(bundle, context));
if (status == CELIX_SUCCESS) {
@@ -1304,7 +1298,7 @@ celix_status_t fw_getService(framework_p
return serviceRegistry_getService(framework->registry, bundle, reference, service);
}
-celix_status_t fw_getBundleRegisteredServices(framework_pt framework, apr_pool_t *pool, bundle_pt bundle, array_list_pt *services) {
+celix_status_t fw_getBundleRegisteredServices(framework_pt framework, bundle_pt bundle, array_list_pt *services) {
return serviceRegistry_getRegisteredServices(framework->registry, bundle, services);
}
@@ -1782,10 +1776,10 @@ celix_status_t framework_acquireBundleLo
celix_status_t status = CELIX_SUCCESS;
bool locked;
- apr_os_thread_t lockingThread = 0;
+ celix_thread_t lockingThread = 0;
int err = celixThreadMutex_lock(&framework->bundleLock);
- if (err != APR_SUCCESS) {
+ if (err != CELIX_SUCCESS) {
fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR, "Failed to lock");
status = CELIX_BUNDLE_EXCEPTION;
} else {
@@ -1844,7 +1838,7 @@ celix_status_t framework_acquireBundleLo
bool framework_releaseBundleLock(framework_pt framework, bundle_pt bundle) {
bool unlocked;
- apr_os_thread_t lockingThread = 0;
+ celix_thread_t lockingThread = 0;
celixThreadMutex_lock(&framework->bundleLock);
@@ -1934,8 +1928,8 @@ celix_status_t framework_waitForStop(fra
return CELIX_FRAMEWORK_EXCEPTION;
}
while (!framework->shutdown) {
- apr_status_t apr_status = celixThreadCondition_wait(&framework->shutdownGate, &framework->mutex);
- if (apr_status != 0) {
+ celix_status_t status = celixThreadCondition_wait(&framework->shutdownGate, &framework->mutex);
+ if (status != 0) {
fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR, "Error waiting for shutdown gate.");
return CELIX_FRAMEWORK_EXCEPTION;
}
@@ -2072,7 +2066,7 @@ celix_status_t fw_fireFrameworkEvent(fra
}
arrayList_add(framework->requests, request);
- if (celixThreadMutex_lock(&framework->dispatcherLock) != APR_SUCCESS) {
+ if (celixThreadMutex_lock(&framework->dispatcherLock) != CELIX_SUCCESS) {
status = CELIX_FRAMEWORK_EXCEPTION;
} else {
if (celixThreadCondition_broadcast(&framework->dispatcher)) {
@@ -2096,7 +2090,7 @@ static void *fw_eventDispatcher(void *fw
while (true) {
int size;
- apr_status_t status;
+ celix_status_t status;
if (celixThreadMutex_lock(&framework->dispatcherLock) != 0) {
fw_log(framework->logger, OSGI_FRAMEWORK_LOG_ERROR, "Error locking the dispatcher");
@@ -2106,7 +2100,7 @@ static void *fw_eventDispatcher(void *fw
size = arrayList_size(framework->requests);
while (size == 0 && !framework->shutdown) {
- apr_status_t apr_status = celixThreadCondition_wait(&framework->dispatcher, &framework->dispatcherLock);
+ celix_status_t status = celixThreadCondition_wait(&framework->dispatcher, &framework->dispatcherLock);
// Ignore status and just keep waiting
size = arrayList_size(framework->requests);
}
@@ -2130,14 +2124,14 @@ static void *fw_eventDispatcher(void *fw
for (i = 0; i < size; i++) {
if (request->type == BUNDLE_EVENT_TYPE) {
fw_bundle_listener_pt listener = (fw_bundle_listener_pt) arrayList_get(request->listeners, i);
- bundle_event_pt event = (bundle_event_pt) apr_palloc(listener->listener->pool, sizeof(*event));
+ bundle_event_pt event = (bundle_event_pt) malloc(sizeof(*event));
event->bundle = request->bundle;
event->type = request->eventType;
fw_invokeBundleListener(framework, listener->listener, event, listener->bundle);
} else if (request->type == FRAMEWORK_EVENT_TYPE) {
fw_framework_listener_pt listener = (fw_framework_listener_pt) arrayList_get(request->listeners, i);
- framework_event_pt event = (framework_event_pt) apr_palloc(listener->listener->pool, sizeof(*event));
+ framework_event_pt event = (framework_event_pt) malloc(sizeof(*event));
event->bundle = request->bundle;
event->type = request->eventType;
event->error = request->error;
Modified: incubator/celix/trunk/framework/private/src/manifest.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/manifest.c?rev=1601103&r1=1601102&r2=1601103&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/manifest.c (original)
+++ incubator/celix/trunk/framework/private/src/manifest.c Sat Jun 7 12:44:31 2014
@@ -59,7 +59,7 @@ celix_status_t manifest_destroy(manifest
manifest->attributes = NULL;
manifest = NULL;
}
- return APR_SUCCESS;
+ return CELIX_SUCCESS;
}
celix_status_t manifest_createFromFile(char *filename, manifest_pt *manifest) {