Added configuration property to replace Felix' cache implementation.
(FELIX-1120)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@774821 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index 10c98cf..b2afc02 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -486,15 +486,21 @@
// Initialize event dispatcher.
m_dispatcher = EventDispatcher.start(m_logger);
- // Create the bundle cache so that we can reload any installed bundles.
- try
+ // Create the bundle cache, if necessary, so that we can reload any
+ // installed bundles.
+ m_cache = (BundleCache) m_configMutableMap.get(
+ FelixConstants.FRAMEWORK_BUNDLECACHE_IMPL);
+ if (m_cache == null)
{
- m_cache = new BundleCache(m_logger, m_configMap);
- }
- catch (Exception ex)
- {
- m_logger.log(Logger.LOG_ERROR, "Error creating bundle cache.", ex);
- throw new BundleException("Error creating bundle cache.", ex);
+ try
+ {
+ m_cache = new BundleCache(m_logger, m_configMap);
+ }
+ catch (Exception ex)
+ {
+ m_logger.log(Logger.LOG_ERROR, "Error creating bundle cache.", ex);
+ throw new BundleException("Error creating bundle cache.", ex);
+ }
}
// If this is the first time init is called, check to see if
diff --git a/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java b/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
index 70e1461..4892c50 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
@@ -42,6 +42,8 @@
public static final String BUNDLE_URL_PROTOCOL = "bundle";
// Miscellaneous framework configuration property names.
+ public static final String FRAMEWORK_BUNDLECACHE_IMPL
+ = "felix.bundlecache.impl";
public static final String LOG_LEVEL_PROP = "felix.log.level";
public static final String LOG_LOGGER_PROP = "felix.log.logger";
public static final String SYSTEMBUNDLE_ACTIVATORS_PROP