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/01/14 09:03:50 UTC

svn commit: r1557960 - in /incubator/celix/trunk/framework: private/src/bundle_cache.c private/src/framework.c public/include/constants.h

Author: abroekhuis
Date: Tue Jan 14 08:03:49 2014
New Revision: 1557960

URL: http://svn.apache.org/r1557960
Log:
CELIX-102: Added support for FRAMEWORK_STORAGE and FRAMEWORK_STORAGE_CLEAN to the framework.

Modified:
    incubator/celix/trunk/framework/private/src/bundle_cache.c
    incubator/celix/trunk/framework/private/src/framework.c
    incubator/celix/trunk/framework/public/include/constants.h

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=1557960&r1=1557959&r2=1557960&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_cache.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_cache.c Tue Jan 14 08:03:49 2014
@@ -74,7 +74,6 @@ celix_status_t bundleCache_create(proper
 
 apr_status_t bundleCache_destroy(void *cacheP) {
 	bundle_cache_pt cache = (bundle_cache_pt) cacheP;
-    properties_destroy(cache->configurationMap);
     return CELIX_SUCCESS;
 }
 

Modified: incubator/celix/trunk/framework/private/src/framework.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/framework.c?rev=1557960&r1=1557959&r2=1557960&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/framework.c (original)
+++ incubator/celix/trunk/framework/private/src/framework.c Tue Jan 14 08:03:49 2014
@@ -308,15 +308,14 @@ celix_status_t fw_init(framework_pt fram
 	if (status == CELIX_SUCCESS) {
 	    if ((state == OSGI_FRAMEWORK_BUNDLE_INSTALLED) || (state == OSGI_FRAMEWORK_BUNDLE_RESOLVED)) {
 	        bundle_state_e state;
-	        properties_pt props = properties_create();
-	        properties_set(props, (char *) OSGI_FRAMEWORK_FRAMEWORK_STORAGE, ".cache");
-
-	        status = CELIX_DO_IF(status, bundleCache_create(props, framework->mp, &framework->cache));
+	        status = CELIX_DO_IF(status, bundleCache_create(framework->configurationMap, framework->mp, &framework->cache));
 	        status = CELIX_DO_IF(status, bundle_getState(framework->bundle, &state));
 	        if (status == CELIX_SUCCESS) {
 	            if (state == OSGI_FRAMEWORK_BUNDLE_INSTALLED) {
-	                // clean cache
-	                // bundleCache_delete(framework->cache);
+	                char *clean = properties_get(framework->configurationMap, (char *) OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN);
+	                if (clean != NULL && (strcmp(clean, OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT) == 0)) {
+	                    bundleCache_delete(framework->cache);
+	                }
 	            }
             }
         }

Modified: incubator/celix/trunk/framework/public/include/constants.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/public/include/constants.h?rev=1557960&r1=1557959&r2=1557960&view=diff
==============================================================================
--- incubator/celix/trunk/framework/public/include/constants.h (original)
+++ incubator/celix/trunk/framework/public/include/constants.h Tue Jan 14 08:03:49 2014
@@ -45,6 +45,8 @@ static const char * const OSGI_FRAMEWORK
 static const char * const OSGI_FRAMEWORK_IMPORT_PACKAGE = "Import-Service";
 
 static const char * const OSGI_FRAMEWORK_FRAMEWORK_STORAGE = "org.osgi.framework.storage";
+static const char * const OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN = "org.osgi.framework.storage.clean";
+static const char * const OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT = "onFirstInit";
 static const char * const OSGI_FRAMEWORK_FRAMEWORK_UUID = "org.osgi.framework.uuid";