diff --git a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
index 31a47fd..aa67456 100644
--- a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
+++ b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
@@ -35,7 +35,6 @@
 import java.util.Set;
 
 import org.apache.felix.framework.util.FelixConstants;
-import org.apache.felix.framework.util.PropertyResolver;
 import org.apache.felix.framework.util.Util;
 import org.apache.felix.framework.util.manifestparser.Capability;
 import org.apache.felix.framework.util.manifestparser.ManifestParser;
@@ -133,7 +132,7 @@
      * @param config the configuration to read properties from.
      * @param systemBundleInfo the info to change if we need to add exports.
      */
-    ExtensionManager(Logger logger, PropertyResolver config, BundleInfo systemBundleInfo)
+    ExtensionManager(Logger logger, Map configMap, BundleInfo systemBundleInfo)
     {
         m_logger = logger;
         m_systemBundleInfo = systemBundleInfo;
@@ -143,7 +142,7 @@
         Map map = ((SystemBundleArchive) m_systemBundleInfo.getArchive()).getManifestHeader(0);
         // Initialize header map as a case insensitive map.
         map.put(FelixConstants.BUNDLE_VERSION,
-            config.get(FelixConstants.FELIX_VERSION_PROPERTY));
+            configMap.get(FelixConstants.FELIX_VERSION_PROPERTY));
         map.put(FelixConstants.BUNDLE_SYMBOLICNAME,
             FelixConstants.SYSTEM_BUNDLE_SYMBOLICNAME);
         map.put(FelixConstants.BUNDLE_NAME, "System Bundle");
@@ -162,7 +161,7 @@
         try
         {
             setCapabilities(ManifestParser.parseExportHeader(
-                config.get(Constants.FRAMEWORK_SYSTEMPACKAGES)));
+                (String) configMap.get(Constants.FRAMEWORK_SYSTEMPACKAGES)));
         }
         catch (Exception ex)
         {
@@ -170,7 +169,7 @@
             m_logger.log(
                 Logger.LOG_ERROR,
                 "Error parsing system bundle export statement: "
-                + config.get(Constants.FRAMEWORK_SYSTEMPACKAGES), ex);
+                + configMap.get(Constants.FRAMEWORK_SYSTEMPACKAGES), ex);
         }
     }
 
@@ -567,4 +566,4 @@
             m_extensions.add(extension);
         }
     }
-}
\ No newline at end of file
+}
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 4573d02..8ca1113 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -43,10 +43,10 @@
     
     // Logging related member variables.
     private Logger m_logger = null; // TODO: KARL - Why package private?
-    // Config properties.
-    private PropertyResolver m_config = null;
-    // Configuration properties passed into constructor.
-    private MutablePropertyResolver m_configMutable = null;
+    // Immutable config properties.
+    private Map m_configMap = null;
+    // Mutable configuration properties passed into constructor.
+    private Map m_configMutableMap = null;
 
     // MODULE FACTORY.
     private IModuleFactory m_factory = null;
@@ -115,21 +115,24 @@
      * <p>
      * This method starts the framework instance; instances of the framework
      * are dormant until this method is called. The caller may also provide
-     * <tt>MutablePropertyResolver</tt> implementations that the instance will
-     * use to obtain configuration or framework properties. Configuration
-     * properties are used internally by the framework and its extensions to alter
-     * its default behavior. Framework properties are used by bundles
-     * and are accessible from <tt>BundleContext.getProperty()</tt>.
+     * <tt>Map</tt> instance that will be used to obtain configuration or
+     * framework properties. Configuration properties are used internally by
+     * the framework and its extensions to alter its default behavior.
+     * Framework properties are used by bundles and are accessible from
+     * <tt>BundleContext.getProperty()</tt>. This map instance is used
+     * directly (i.e., it is not copied), which means that it is possible to
+     * change the property values externally at run time, but this is strongly
+     * discouraged for the framework's configuration properties.
      * </p>
      * <p>
      * Configuration properties are the sole means to configure the framework's
      * default behavior; the framework does not refer to any system properties for
-     * configuration information. If a <tt>MutablePropertyResolver</tt> is
-     * supplied to this method for configuration properties, then the framework will
-     * consult the <tt>MutablePropertyResolver</tt> instance for any and all
-     * configuration properties. It is possible to specify a <tt>null</tt>
-     * configuration property resolver, in which case the framework will use its
-     * default behavior in all cases. However, if the
+     * configuration information. If a <tt>Map</tt> is supplied to this method
+     * for configuration properties, then the framework will consult the
+     * <tt>Map</tt> instance for any and all configuration properties. It is
+     * possible to specify a <tt>null</tt> for the configuration property map,
+     * in which case the framework will use its default behavior in all cases.
+     * However, if the
      * <a href="cache/DefaultBundleCache.html"><tt>DefaulBundleCache</tt></a>
      * is used, then at a minimum a profile name or profile directory must
      * be specified.
@@ -207,17 +210,16 @@
      * class documentation for more information.
      * </p>
      *
-     * @param configMutable An object for obtaining configuration properties,
+     * @param configMutableMap An map for obtaining configuration properties,
      *        may be <tt>null</tt>.
      * @param activatorList A list of System Bundle activators.
     **/
-    public Felix(MutablePropertyResolver configMutable, List activatorList)
+    public Felix(Map configMutableMap, List activatorList)
     {
         // Initialize member variables.
-        m_factory = null;
-        m_configMutable = (configMutable == null)
-            ? new MutablePropertyResolverImpl(new StringMap(false)) : configMutable;
-        m_config = new PropertyResolverImpl(m_configMutable);
+        m_configMutableMap = (configMutableMap == null)
+            ? new StringMap(false) : configMutableMap;
+        m_configMap = Collections.unmodifiableMap(m_configMutableMap);
         m_activatorList = activatorList;
 
         // Create logger with appropriate log level. Even though the
@@ -225,7 +227,7 @@
         // services, it is created now because it is needed before
         // the system bundle is created. The system bundle's context
         // will be set below after the system bundle is created.
-        m_logger = new Logger(m_configMutable.get(FelixConstants.LOG_LEVEL_PROP));
+        m_logger = new Logger((String) m_configMutableMap.get(FelixConstants.LOG_LEVEL_PROP));
 
         // Initialize other member variables.
         m_activeStartLevel = FelixConstants.FRAMEWORK_INACTIVE_STARTLEVEL;
@@ -247,7 +249,7 @@
         m_systemBundleInfo = new BundleInfo(
             m_logger, new SystemBundleArchive(), null);
         m_extensionManager = 
-            new ExtensionManager(m_logger, m_config, m_systemBundleInfo);
+            new ExtensionManager(m_logger, m_configMap, m_systemBundleInfo);
         m_systemBundleInfo.addModule(
             m_factory.createModule("0", m_extensionManager));
     }
@@ -577,7 +579,7 @@
 
         try
         {
-            m_cache = new BundleCache(m_logger, m_config);
+            m_cache = new BundleCache(m_logger, m_configMap);
         }
         catch (Exception ex)
         {
@@ -585,7 +587,7 @@
             ex.printStackTrace();
 
             // Only shutdown the JVM if the framework is running stand-alone.
-            String embedded = m_config.get(
+            String embedded = (String) m_configMap.get(
                 FelixConstants.EMBEDDED_EXECUTION_PROP);
             boolean isEmbedded = (embedded == null)
                 ? false : embedded.equals("true");
@@ -600,7 +602,7 @@
         }
 
         // Create search policy for module loader.
-        m_policyCore = new R4SearchPolicyCore(m_logger, m_config);
+        m_policyCore = new R4SearchPolicyCore(m_logger, m_configMap);
 
         // Add a resolver listener to the search policy
         // so that we will be notified when modules are resolved
@@ -783,7 +785,7 @@
 
         // Get the framework's default start level.
         int startLevel = FelixConstants.FRAMEWORK_DEFAULT_STARTLEVEL;
-        String s = m_config.get(FelixConstants.FRAMEWORK_STARTLEVEL_PROP);
+        String s = (String) m_configMap.get(FelixConstants.FRAMEWORK_STARTLEVEL_PROP);
         if (s != null)
         {
             try
@@ -1107,7 +1109,7 @@
     **/
     protected int getInitialBundleStartLevel()
     {
-        String s = m_config.get(FelixConstants.BUNDLE_STARTLEVEL_PROP);
+        String s = (String) m_configMap.get(FelixConstants.BUNDLE_STARTLEVEL_PROP);
 
         if (s != null)
         {
@@ -1143,7 +1145,7 @@
                 "Initial start level must be greater than zero.");
         }
 
-        m_configMutable.put(
+        m_configMutableMap.put(
             FelixConstants.BUNDLE_STARTLEVEL_PROP, Integer.toString(startLevel));
     }
 
@@ -1910,7 +1912,7 @@
             // Try to save the activator in the cache.
             // NOTE: This is non-standard OSGi behavior and only
             // occurs if strictness is disabled.
-            String strict = m_config.get(FelixConstants.STRICT_OSGI_PROP);
+            String strict = (String) m_configMap.get(FelixConstants.STRICT_OSGI_PROP);
             boolean isStrict = (strict == null) ? true : strict.equals("true");
             if (!isStrict)
             {
@@ -2124,7 +2126,7 @@
     protected String getProperty(String key)
     {
         // First, check the config properties.
-        String val = (String) m_config.get(key);
+        String val = (String) m_configMap.get(key);
         // If not found, then try the system properties.
         return (val == null) ? System.getProperty(key) : val;
     }
@@ -3297,7 +3299,7 @@
         Object securityContext, boolean isExtensionBundle)
         throws Exception
     {
-        ManifestParser mp = new ManifestParser(m_logger, m_config, headerMap);
+        ManifestParser mp = new ManifestParser(m_logger, m_configMap, headerMap);
 
         // Verify that the bundle symbolic name and version is unique.
         if (mp.getManifestVersion().equals("2"))
@@ -3374,7 +3376,7 @@
 
         BundleActivator activator = null;
 
-        String strict = m_config.get(FelixConstants.STRICT_OSGI_PROP);
+        String strict = (String) m_configMap.get(FelixConstants.STRICT_OSGI_PROP);
         boolean isStrict = (strict == null) ? true : strict.equals("true");
         if (!isStrict)
         {
@@ -3515,25 +3517,25 @@
     private void initializeFrameworkProperties()
     {
         // Standard OSGi properties.
-        m_configMutable.put(
+        m_configMutableMap.put(
             FelixConstants.FRAMEWORK_VERSION,
             FelixConstants.FRAMEWORK_VERSION_VALUE);
-        m_configMutable.put(
+        m_configMutableMap.put(
             FelixConstants.FRAMEWORK_VENDOR,
             FelixConstants.FRAMEWORK_VENDOR_VALUE);
-        m_configMutable.put(
+        m_configMutableMap.put(
             FelixConstants.FRAMEWORK_LANGUAGE,
             System.getProperty("user.language"));
-        m_configMutable.put(
+        m_configMutableMap.put(
             FelixConstants.FRAMEWORK_OS_VERSION,
             System.getProperty("os.version"));
 
         String s = null;
         s = R4LibraryClause.normalizeOSName(System.getProperty("os.name"));
-        m_configMutable.put(FelixConstants.FRAMEWORK_OS_NAME, s);
+        m_configMutableMap.put(FelixConstants.FRAMEWORK_OS_NAME, s);
         s = R4LibraryClause.normalizeProcessor(System.getProperty("os.arch"));
-        m_configMutable.put(FelixConstants.FRAMEWORK_PROCESSOR, s);
-        m_configMutable.put(
+        m_configMutableMap.put(FelixConstants.FRAMEWORK_PROCESSOR, s);
+        m_configMutableMap.put(
             FelixConstants.FELIX_VERSION_PROPERTY, getFrameworkVersion());
     }
 
@@ -3575,21 +3577,21 @@
         // the start level to which the bundles are assigned is specified by
         // appending a ".n" to the auto-install property name, where "n" is
         // the desired start level for the list of bundles.
-        String[] keys = m_config.getKeys();
-        for (int i = 0; (keys != null) && (i < keys.length); i++)
+        for (Iterator i = m_configMap.keySet().iterator(); i.hasNext(); )
         {
-            if (keys[i].startsWith(FelixConstants.AUTO_INSTALL_PROP))
+            String key = (String) i.next();
+            if (key.startsWith(FelixConstants.AUTO_INSTALL_PROP))
             {
                 int startLevel = 1;
                 try
                 {
-                    startLevel = Integer.parseInt(keys[i].substring(keys[i].lastIndexOf('.') + 1));
+                    startLevel = Integer.parseInt(key.substring(key.lastIndexOf('.') + 1));
                 }
                 catch (NumberFormatException ex)
                 {
-                    m_logger.log(Logger.LOG_ERROR, "Invalid property: " + keys[i]);
+                    m_logger.log(Logger.LOG_ERROR, "Invalid property: " + key);
                 }
-                StringTokenizer st = new StringTokenizer(m_config.get(keys[i]), "\" ",true);
+                StringTokenizer st = new StringTokenizer((String) m_configMap.get(key), "\" ",true);
                 if (st.countTokens() > 0)
                 {
                     String location = null;
@@ -3622,20 +3624,21 @@
         // where "n" is the desired start level for the list of bundles.
         // The following code starts bundles in two passes, first it installs
         // them, then it starts them.
-        for (int i = 0; (keys != null) && (i < keys.length); i++)
+        for (Iterator i = m_configMap.keySet().iterator(); i.hasNext(); )
         {
-            if (keys[i].startsWith(FelixConstants.AUTO_START_PROP))
+            String key = (String) i.next();
+            if (key.startsWith(FelixConstants.AUTO_START_PROP))
             {
                 int startLevel = 1;
                 try
                 {
-                    startLevel = Integer.parseInt(keys[i].substring(keys[i].lastIndexOf('.') + 1));
+                    startLevel = Integer.parseInt(key.substring(key.lastIndexOf('.') + 1));
                 }
                 catch (NumberFormatException ex)
                 {
-                    m_logger.log(Logger.LOG_ERROR, "Invalid property: " + keys[i]);
+                    m_logger.log(Logger.LOG_ERROR, "Invalid property: " + key);
                 }
-                StringTokenizer st = new StringTokenizer(m_config.get(keys[i]), "\" ",true);
+                StringTokenizer st = new StringTokenizer((String) m_configMap.get(key), "\" ",true);
                 if (st.countTokens() > 0)
                 {
                     String location = null;
@@ -3661,11 +3664,12 @@
         }
 
         // Now loop through and start the installed bundles.
-        for (int i = 0; (keys != null) && (i < keys.length); i++)
+        for (Iterator i = m_configMap.keySet().iterator(); i.hasNext(); )
         {
-            if (keys[i].startsWith(FelixConstants.AUTO_START_PROP))
+            String key = (String) i.next();
+            if (key.startsWith(FelixConstants.AUTO_START_PROP))
             {
-                StringTokenizer st = new StringTokenizer(m_config.get(keys[i]), "\" ",true);
+                StringTokenizer st = new StringTokenizer((String) m_configMap.get(key), "\" ",true);
                 if (st.countTokens() > 0)
                 {
                     String location = null;
@@ -3786,7 +3790,7 @@
             // Add the bundle activator for the start level service.
             m_activatorList.add(new StartLevelActivator(m_logger, Felix.this));
             // Add the bundle activator for the url handler service.
-            m_activatorList.add(new URLHandlersActivator(m_config, Felix.this));
+            m_activatorList.add(new URLHandlersActivator(m_configMap, Felix.this));
 
             // Start all activators.
             for (int i = 0; i < m_activatorList.size(); i++)
@@ -3949,7 +3953,7 @@
             }
 
             // Finally shutdown the JVM if the framework is running stand-alone.
-            String embedded = m_config.get(FelixConstants.EMBEDDED_EXECUTION_PROP);
+            String embedded = (String) m_configMap.get(FelixConstants.EMBEDDED_EXECUTION_PROP);
             boolean isEmbedded = (embedded == null) ? false : embedded.equals("true");
             if (!isEmbedded)
             {
diff --git a/framework/src/main/java/org/apache/felix/framework/URLHandlersActivator.java b/framework/src/main/java/org/apache/felix/framework/URLHandlersActivator.java
index f801134..8608185 100644
--- a/framework/src/main/java/org/apache/felix/framework/URLHandlersActivator.java
+++ b/framework/src/main/java/org/apache/felix/framework/URLHandlersActivator.java
@@ -18,8 +18,8 @@
  */
 package org.apache.felix.framework;
 
+import java.util.Map;
 import org.apache.felix.framework.util.FelixConstants;
-import org.apache.felix.framework.util.PropertyResolver;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 
@@ -34,13 +34,13 @@
 **/
 class URLHandlersActivator implements BundleActivator
 {
-    private PropertyResolver m_config = null;
+    private Map m_configMap = null;
     private Felix m_framework = null;
     private BundleContext m_context = null;
 
-    public URLHandlersActivator(PropertyResolver config, Felix framework)
+    public URLHandlersActivator(Map configMap, Felix framework)
     {
-        m_config = config;
+        m_configMap = configMap;
         m_framework = framework;
     }
 
@@ -53,10 +53,10 @@
         m_context = context;
         // Only register the framework with the URL Handlers service
         // if the service is enabled.
-        boolean enable = (m_config.get(
+        boolean enable = (m_configMap.get(
                 FelixConstants.SERVICE_URLHANDLERS_PROP) == null)
                 ? true
-                : !m_config.get(FelixConstants.SERVICE_URLHANDLERS_PROP).equals("false");
+                : !m_configMap.get(FelixConstants.SERVICE_URLHANDLERS_PROP).equals("false");
         URLHandlers.registerInstance(m_framework, m_context, enable);
     }
 
@@ -64,4 +64,4 @@
     {
         URLHandlers.unregisterInstance(m_framework);
     }
-}
\ No newline at end of file
+}
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java b/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
index 2b70548..908fe20 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
@@ -22,7 +22,6 @@
 import java.util.*;
 
 import org.apache.felix.framework.Logger;
-import org.apache.felix.framework.util.PropertyResolver;
 import org.apache.felix.framework.util.SecureAction;
 
 /**
@@ -81,17 +80,17 @@
     protected static transient final String CACHE_DIR_NAME = ".felix";
     protected static transient final String BUNDLE_DIR_PREFIX = "bundle";
 
-    private PropertyResolver m_cfg = null;
+    private Map m_configMap = null;
     private Logger m_logger = null;
     private File m_profileDir = null;
     private BundleArchive[] m_archives = null;
 
     private static SecureAction m_secureAction = new SecureAction();
 
-    public BundleCache(Logger logger, PropertyResolver cfg)
+    public BundleCache(Logger logger, Map configMap)
         throws Exception
     {
-        m_cfg = cfg;
+        m_configMap = configMap;
         m_logger = logger;
         initialize();
     }
@@ -252,7 +251,7 @@
         // Get buffer size value.
         try
         {
-            String sBufSize = m_cfg.get(CACHE_BUFSIZE_PROP);
+            String sBufSize = (String) m_configMap.get(CACHE_BUFSIZE_PROP);
             if (sBufSize != null)
             {
                 BUFSIZE = Integer.parseInt(sBufSize);
@@ -264,7 +263,7 @@
         }
 
         // See if the profile directory is specified.
-        String profileDirStr = m_cfg.get(CACHE_PROFILE_DIR_PROP);
+        String profileDirStr = (String) m_configMap.get(CACHE_PROFILE_DIR_PROP);
         if (profileDirStr != null)
         {
             m_profileDir = new File(profileDirStr);
@@ -277,7 +276,7 @@
 
             // First, determine the location of the cache directory; it
             // can either be specified or in the default location.
-            String cacheDirStr = m_cfg.get(CACHE_DIR_PROP);
+            String cacheDirStr = (String) m_configMap.get(CACHE_DIR_PROP);
             if (cacheDirStr == null)
             {
                 // Since no cache directory was specified, put it
@@ -289,7 +288,7 @@
             }
 
             // Now, get the profile name.
-            String profileName = m_cfg.get(CACHE_PROFILE_PROP);
+            String profileName = (String) m_configMap.get(CACHE_PROFILE_PROP);
             if (profileName == null)
             {
                 throw new IllegalArgumentException(
diff --git a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
index 93b9886..ebaab48 100755
--- a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
+++ b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
@@ -33,7 +33,7 @@
 public class R4SearchPolicyCore implements ModuleListener
 {
     private Logger m_logger = null;
-    private PropertyResolver m_config = null;
+    private Map m_configMap = null;
     private IModuleFactory m_factory = null;
     // Maps a package name to an array of modules.
     private Map m_availPkgIndexMap = new HashMap();
@@ -59,13 +59,13 @@
     // Re-usable security manager for accessing class context.
     private static SecurityManagerEx m_sm = new SecurityManagerEx();
 
-    public R4SearchPolicyCore(Logger logger, PropertyResolver config)
+    public R4SearchPolicyCore(Logger logger, Map configMap)
     {
         m_logger = logger;
-        m_config = config;
+        m_configMap = configMap;
 
         // Read the boot delegation property and parse it.
-        String s = m_config.get(Constants.FRAMEWORK_BOOTDELEGATION);
+        String s = (String) m_configMap.get(Constants.FRAMEWORK_BOOTDELEGATION);
         s = (s == null) ? "java.*" : s + ",java.*";
         StringTokenizer st = new StringTokenizer(s, " ,");
         m_bootPkgs = new String[st.countTokens()];
diff --git a/framework/src/main/java/org/apache/felix/framework/util/MutablePropertyResolver.java b/framework/src/main/java/org/apache/felix/framework/util/MutablePropertyResolver.java
deleted file mode 100644
index ec37556..0000000
--- a/framework/src/main/java/org/apache/felix/framework/util/MutablePropertyResolver.java
+++ /dev/null
@@ -1,24 +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.
- */
-package org.apache.felix.framework.util;
-
-public interface MutablePropertyResolver extends PropertyResolver
-{
-    public String put(String key, String value);
-}
\ No newline at end of file
diff --git a/framework/src/main/java/org/apache/felix/framework/util/MutablePropertyResolverImpl.java b/framework/src/main/java/org/apache/felix/framework/util/MutablePropertyResolverImpl.java
deleted file mode 100644
index 16f6ff1..0000000
--- a/framework/src/main/java/org/apache/felix/framework/util/MutablePropertyResolverImpl.java
+++ /dev/null
@@ -1,46 +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.
- */
-package org.apache.felix.framework.util;
-
-import java.util.Map;
-
-public class MutablePropertyResolverImpl implements MutablePropertyResolver
-{
-    private Map m_props = null;
-
-    public MutablePropertyResolverImpl(Map props)
-    {
-        m_props = props;
-    }
-
-    public synchronized String put(String key, String value)
-    {
-        return (String) m_props.put(key, value);
-    }
-
-    public synchronized String get(String key)
-    {
-        return (String) m_props.get(key);
-    }
-
-    public synchronized String[] getKeys()
-    {
-        return (String[]) m_props.keySet().toArray(new String[0]);
-    }
-}
\ No newline at end of file
diff --git a/framework/src/main/java/org/apache/felix/framework/util/PropertyResolver.java b/framework/src/main/java/org/apache/felix/framework/util/PropertyResolver.java
deleted file mode 100644
index 1816bd8..0000000
--- a/framework/src/main/java/org/apache/felix/framework/util/PropertyResolver.java
+++ /dev/null
@@ -1,25 +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.
- */
-package org.apache.felix.framework.util;
-
-public interface PropertyResolver
-{
-    public String get(String key);
-    public String[] getKeys();
-}
\ No newline at end of file
diff --git a/framework/src/main/java/org/apache/felix/framework/util/PropertyResolverImpl.java b/framework/src/main/java/org/apache/felix/framework/util/PropertyResolverImpl.java
deleted file mode 100644
index 416e7cc..0000000
--- a/framework/src/main/java/org/apache/felix/framework/util/PropertyResolverImpl.java
+++ /dev/null
@@ -1,39 +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.
- */
-package org.apache.felix.framework.util;
-
-public class PropertyResolverImpl implements PropertyResolver
-{
-    private MutablePropertyResolver m_resolver = null;
-
-    public PropertyResolverImpl(MutablePropertyResolver resolver)
-    {
-        m_resolver = resolver;
-    }
-
-    public String get(String key)
-    {
-        return (m_resolver == null) ? null : m_resolver.get(key);
-    }
-
-    public String[] getKeys()
-    {
-        return (m_resolver == null) ? null : m_resolver.getKeys();
-    }
-}
\ No newline at end of file
diff --git a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
index b478a8d..cdad237 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
@@ -30,7 +30,7 @@
 public class ManifestParser
 {
     private Logger m_logger = null;
-    private PropertyResolver m_config = null;
+    private Map m_configMap = null;
     private Map m_headerMap = null;
     private String m_bundleSymbolicName = null;
     private Version m_bundleVersion = null;
@@ -40,11 +40,11 @@
     private R4LibraryClause[] m_libraryHeaders = null;
     private boolean m_libraryHeadersOptional = false;
 
-    public ManifestParser(Logger logger, PropertyResolver config, Map headerMap)
+    public ManifestParser(Logger logger, Map configMap, Map headerMap)
         throws BundleException
     {
         m_logger = logger;
-        m_config = config;
+        m_configMap = configMap;
         m_headerMap = headerMap;
 
         // Verify that only manifest version 2 is specified.
@@ -329,7 +329,7 @@
             // Search for matching native clauses.
             for (int i = 0; i < m_libraryHeaders.length; i++)
             {
-                if (m_libraryHeaders[i].match(m_config))
+                if (m_libraryHeaders[i].match(m_configMap))
                 {
                     clauseList.add(m_libraryHeaders[i]);
                 }
diff --git a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
index 9d2a16f..ee33c85 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/R4LibraryClause.java
@@ -86,12 +86,12 @@
         return m_selectionFilter;
     }
 
-    public boolean match(PropertyResolver config) throws BundleException
+    public boolean match(Map configMap) throws BundleException
     {
-        String normal_osname = normalizeOSName(config.get(Constants.FRAMEWORK_OS_NAME));
-        String normal_processor = normalizeProcessor(config.get(Constants.FRAMEWORK_PROCESSOR));
-        String normal_osversion = normalizeOSVersion(config.get(Constants.FRAMEWORK_OS_VERSION));
-        String normal_language = config.get(Constants.FRAMEWORK_LANGUAGE);
+        String normal_osname = normalizeOSName((String) configMap.get(Constants.FRAMEWORK_OS_NAME));
+        String normal_processor = normalizeProcessor((String) configMap.get(Constants.FRAMEWORK_PROCESSOR));
+        String normal_osversion = normalizeOSVersion((String) configMap.get(Constants.FRAMEWORK_OS_VERSION));
+        String normal_language = (String) configMap.get(Constants.FRAMEWORK_LANGUAGE);
 
         // Check library's osname.
         if (!checkOSNames(normal_osname, getOSNames()))
@@ -124,7 +124,7 @@
         // Check library's selection-filter if specified.
         if ((getSelectionFilter() != null) &&
             (getSelectionFilter().length() >= 0) &&
-            !checkSelectionFilter(config, getSelectionFilter()))
+            !checkSelectionFilter(configMap, getSelectionFilter()))
         {
             return false;
         }
@@ -190,15 +190,15 @@
         return false;
     }
 
-    private boolean checkSelectionFilter(PropertyResolver config, String expr)
+    private boolean checkSelectionFilter(Map configMap, String expr)
         throws BundleException
     {
         // Get all framework properties
         Dictionary dict = new Hashtable();
-        String[] keys = config.getKeys();
-        for (int i = 0; i < keys.length; i++)
+        for (Iterator i = configMap.keySet().iterator(); i.hasNext(); )
         {
-            dict.put(keys[i], config.get(keys[i]));
+            Object key = i.next();
+            dict.put(key, configMap.get(key));
         }
         // Compute expression
         try
diff --git a/main/src/main/java/org/apache/felix/main/Main.java b/main/src/main/java/org/apache/felix/main/Main.java
index d70eacd..c69f74a 100644
--- a/main/src/main/java/org/apache/felix/main/Main.java
+++ b/main/src/main/java/org/apache/felix/main/Main.java
@@ -25,7 +25,6 @@
 
 import org.apache.felix.framework.Felix;
 import org.apache.felix.framework.cache.BundleCache;
-import org.apache.felix.framework.util.MutablePropertyResolverImpl;
 import org.apache.felix.framework.util.StringMap;
 
 /**
@@ -97,8 +96,8 @@
      *       the desired URL using the <tt>felix.config.properties</tt>
      *       system property; this should be set using the <tt>-D</tt> syntax
      *       when executing the JVM. Refer to the
-     *       <a href="Felix.html#start(org.apache.felix.framework.util.MutablePropertyResolver, org.apache.felix.framework.util.MutablePropertyResolver, java.util.List)">
-     *       <tt>Felix.start()</tt></a> method documentation for more
+     *       <a href="Felix.html#Felix(java.util.Map, java.util.List)">
+     *       <tt>Felix</tt></a> constructor documentation for more
      *       information on the framework configuration options.
      *   </li>
      *   <li><i><b>Perform system property variable substitution on configuration
@@ -116,10 +115,11 @@
      *       <a href="cache/DefaultBundleCache.html"><tt>DefaultBundleCache</tt></a>
      *       documentation for more details its configuration options.
      *   </li>
-     *   <li><i><b>Creates and starts a framework instance.</b></i> A simple
-     *       <a href="util/MutablePropertyResolver.html"><tt>MutablePropertyResolver</tt></a>
+     *   <li><i><b>Creates and starts a framework instance.</b></i> A 
+     *       case insensitive
+     *       <a href="util/StringMap.html"><tt>StringMap</tt></a>
      *       is created for the configuration property file and is passed
-     *       into the framework when it is started.
+     *       into the framework.
      *   </li>
      * </ol>
      * <p>
@@ -131,8 +131,8 @@
      * the configuration property file cannot be found, the framework will appear to
      * be hung or deadlocked. This is not the case, it is executing correctly,
      * there is just no way to interact with it. Refer to the
-     * <a href="Felix.html#start(org.apache.felix.framework.util.MutablePropertyResolver, org.apache.felix.framework.util.MutablePropertyResolver, java.util.List)">
-     * <tt>Felix.start()</tt></a> method documentation for more information on
+     * <a href="Felix.html#Felix(java.util.Map, java.util.List)">
+     * <tt>Felix</tt></a> constructor documentation for more information on
      * framework configuration options.
      * </p>
      * @param argv An array of arguments, all of which are ignored.
@@ -191,10 +191,7 @@
         try
         {
             // Now create an instance of the framework.
-            m_felix = new Felix(
-                new MutablePropertyResolverImpl(
-                    new StringMap(configProps, false)),
-                null);
+            m_felix = new Felix(new StringMap(configProps, false), null);
             m_felix.start();
         }
         catch (Exception ex)
