diff --git a/deploymentadmin/autoconf/LICENSE b/deploymentadmin/autoconf/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/deploymentadmin/autoconf/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
diff --git a/deploymentadmin/autoconf/NOTICE b/deploymentadmin/autoconf/NOTICE
new file mode 100644
index 0000000..fb681e0
--- /dev/null
+++ b/deploymentadmin/autoconf/NOTICE
@@ -0,0 +1,10 @@
+Apache Felix Framework
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+This product includes software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright 2006 The OSGi Alliance.
+Licensed under the Apache License 2.0.
diff --git a/deploymentadmin/autoconf/pom.xml b/deploymentadmin/autoconf/pom.xml
new file mode 100644
index 0000000..ba73c3b
--- /dev/null
+++ b/deploymentadmin/autoconf/pom.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project>
+  <parent>
+    <groupId>org.apache.felix</groupId>
+    <artifactId>felix</artifactId>
+    <version>1.0.2</version>
+    <relativePath>../../pom/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>bundle</packaging>
+  <name>Apache Felix AutoConf Resource Processor</name>
+  <version>0.1.0-SNAPSHOT</version>
+  <artifactId>org.apache.felix.deployment.rp.autoconf</artifactId>
+  <dependencies>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.apache.felix.dependencymanager</artifactId>
+      <version>1.1.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.apache.felix.deploymentadmin</artifactId>
+      <version>0.9.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.apache.felix.metatype</artifactId>
+      <version>1.0.1-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>1.4.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>org.apache.felix.deployment.rp.autoconf</Bundle-SymbolicName>
+            <Bundle-Activator>org.apache.felix.deployment.rp.autoconf.Activator</Bundle-Activator>
+            <Bundle-Name>Apache Felix AutoConf Resource Processor</Bundle-Name>
+            <Bundle-Description>A customizer bundle that publishes a Resource Processor service that processes configuration resources shipped in a Deployment Package.</Bundle-Description>
+            <Bundle-Vendor>Apache Software Foundation</Bundle-Vendor>
+            <Private-Package>org.apache.felix.deployment.rp.autoconf, org.apache.felix.metatype, org.apache.felix.metatype.internal.l10n, org.apache.felix.metatype.internal, org.kxml2.io;-split-package:=merge-first, org.xmlpull.v1;-split-package:=merge-first, org.osgi.service.metatype;-split-package:=merge-first</Private-Package>
+            <Export-Package>org.osgi.service.deploymentadmin.spi;version="1.0"</Export-Package>
+            <DeploymentPackage-Customizer>true</DeploymentPackage-Customizer>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/Activator.java b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/Activator.java
new file mode 100644
index 0000000..0754c52
--- /dev/null
+++ b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/Activator.java
@@ -0,0 +1,59 @@
+/*
+ * 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.deployment.rp.autoconf;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+import org.apache.felix.dependencymanager.DependencyActivatorBase;
+import org.apache.felix.dependencymanager.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.deploymentadmin.spi.ResourceProcessor;
+import org.osgi.service.log.LogService;
+import org.osgi.service.metatype.MetaTypeService;
+
+/**
+ * Bundle activator for the AutoConf Resource Processor Customizer bundle
+ */
+public class Activator extends DependencyActivatorBase {
+
+    public void init(BundleContext context, DependencyManager manager) throws Exception {
+    	Dictionary properties = new Properties();
+        properties.put(Constants.SERVICE_PID, "org.osgi.deployment.rp.autoconf");
+        
+        manager.add(createService()
+            .setInterface(ResourceProcessor.class.getName(), properties)
+            .setImplementation(AutoConfResourceProcessor.class)
+            .add(createServiceDependency()
+                .setService(ConfigurationAdmin.class)
+                .setRequired(true))
+            .add(createServiceDependency()
+                .setService(MetaTypeService.class)
+                .setRequired(false))
+            .add(createServiceDependency()
+                .setService(LogService.class)
+                .setRequired(false)));
+    }
+
+    public void destroy(BundleContext context, DependencyManager manager) throws Exception {
+        // do nothing
+    }
+}
\ No newline at end of file
diff --git a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AttributeDefinitionImpl.java b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AttributeDefinitionImpl.java
new file mode 100644
index 0000000..6cef598
--- /dev/null
+++ b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AttributeDefinitionImpl.java
@@ -0,0 +1,68 @@
+/*
+ * 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.deployment.rp.autoconf;
+
+import org.apache.felix.metatype.AD;
+import org.osgi.service.metatype.AttributeDefinition;
+
+public class AttributeDefinitionImpl implements AttributeDefinition {
+
+	private final AD m_ad;
+
+	public AttributeDefinitionImpl(AD ad) {
+		m_ad = ad;
+	}
+	
+	public int getCardinality() {
+		return m_ad.getCardinality();
+	}
+
+	public String[] getDefaultValue() {
+		return m_ad.getDefaultValue();
+	}
+
+	public String getDescription() {
+		return m_ad.getDescription();
+	}
+
+	public String getID() {
+		return m_ad.getID();
+	}
+
+	public String getName() {
+		return m_ad.getName();
+	}
+
+	public String[] getOptionLabels() {
+		return m_ad.getOptionLabels();
+	}
+
+	public String[] getOptionValues() {
+		return m_ad.getOptionValues();
+	}
+
+	public int getType() {
+		return m_ad.getType();
+	}
+
+	public String validate(String value) {
+        return m_ad.validate(value);
+	}
+
+}
diff --git a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResource.java b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResource.java
new file mode 100644
index 0000000..3a5b097
--- /dev/null
+++ b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResource.java
@@ -0,0 +1,105 @@
+/*
+ * 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.deployment.rp.autoconf;
+
+import java.io.Serializable;
+import java.util.Dictionary;
+
+public class AutoConfResource implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+	
+	private final String m_pid;
+	private final String m_factoryPid;
+	private final Dictionary m_properties;
+	private final String m_bundleLoc;
+	private final boolean m_merge;
+	private final String m_name;
+
+	private String m_alias = null;
+	
+	public AutoConfResource(String name, String pid, String factoryPid, String bundleLocation, boolean merge, Dictionary properties) {
+		m_name = name;
+		m_pid = pid;
+		m_factoryPid = (factoryPid == null) ? "" : factoryPid;
+		m_bundleLoc = bundleLocation;
+		m_merge = merge;
+		m_properties = properties;
+	}
+
+	public String getName() {
+		return m_name;
+	}
+	
+	public String getPid() {
+		return m_pid;
+	}
+
+	/**
+	 * Returns empty string if this configuration is not a factory configuration, otherwise the factory
+	 * PID is returned.
+	 * 
+	 * @return Empty string if this is not a factory configuration resource, else the factory PID is returned.
+	 */
+	public String getFactoryPid() {
+		return m_factoryPid;
+	}
+
+	public Dictionary getProperties() {
+		return m_properties;
+	}
+	
+	public String getBundleLocation() {
+		return m_bundleLoc;
+	}
+	
+	public boolean isMerge() {
+		return m_merge;
+	}
+	
+	public boolean isFactoryConfig() {
+		return !(m_factoryPid == null || "".equals(m_factoryPid));
+	}
+	
+	public void setGeneratedPid(String alias) {
+		m_alias = alias;
+	}
+	
+	public String getGeneratedPid() {
+		if (m_alias == null) {
+			throw new IllegalStateException("Must set an alias first.");
+		}
+		return m_alias;
+	}
+	
+	/**
+	 * Determine if the specified <code>AutoConfResource</code> is meant to be used for the same <code>Configuration</code> as this object.
+	 *  
+	 * @param resource The <code>AutoConfResource</code> to compare with.
+	 * @return Returns <code>true</code> if the two resources are meant to be used for the same <code>Configuration</code> object, false otherwise.
+	 */
+	public boolean equalsTargetConfiguration(AutoConfResource resource) {
+		if (isFactoryConfig()) {
+			return m_pid.equals(resource.getPid()) && m_factoryPid.equals(resource.getFactoryPid());
+		}
+		else {
+			return m_pid.equals(resource.getPid());
+		}
+	}
+}
diff --git a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
new file mode 100644
index 0000000..d34375b
--- /dev/null
+++ b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/AutoConfResourceProcessor.java
@@ -0,0 +1,531 @@
+/*
+ * 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.deployment.rp.autoconf;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+import org.apache.felix.metatype.Attribute;
+import org.apache.felix.metatype.Designate;
+import org.apache.felix.metatype.MetaData;
+import org.apache.felix.metatype.MetaDataReader;
+import org.apache.felix.metatype.OCD;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.deploymentadmin.spi.DeploymentSession;
+import org.osgi.service.deploymentadmin.spi.ResourceProcessor;
+import org.osgi.service.deploymentadmin.spi.ResourceProcessorException;
+import org.osgi.service.log.LogService;
+import org.osgi.service.metatype.AttributeDefinition;
+import org.osgi.service.metatype.MetaTypeInformation;
+import org.osgi.service.metatype.MetaTypeService;
+import org.osgi.service.metatype.ObjectClassDefinition;
+import org.xmlpull.v1.XmlPullParserException;
+
+public class AutoConfResourceProcessor implements ResourceProcessor {
+
+	private static final String LOCATION_PREFIX = "osgi-dp:";
+	
+	private volatile LogService m_log;					// injected by dependency manager
+	private volatile ConfigurationAdmin m_configAdmin;	// injected by dependency manager
+	private volatile MetaTypeService m_metaService;		// injected by dependency manager
+	private volatile BundleContext m_bc;				// injected by dependency manager
+	
+	private DeploymentSession m_session = null;
+	private Map m_toBeInstalled = new HashMap(); // Map<String, List<AutoConfResource>>
+	private Map m_toBeDeleted = new HashMap();
+	
+	private PersistencyManager m_persistencyManager;
+
+	public void start() throws IOException {
+		File root = m_bc.getDataFile("");
+		if (root == null) {
+			throw new IOException("No file system support");
+		}
+		m_persistencyManager = new PersistencyManager(root);
+	}
+	
+    public void begin(DeploymentSession session) {
+	    m_session = session;
+    }
+ 
+    public void process(String name, InputStream stream) throws ResourceProcessorException {
+	   
+	   // initial validation
+	   if (m_session == null) {
+		   throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Can not process resource without a Deployment Session");
+	   }
+	   MetaDataReader reader = new MetaDataReader();
+	   MetaData data = null;
+	   try {
+		   data = reader.parse(stream);
+	   } catch (IOException e) {
+		   throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Unable to process resource.", e);
+	   } catch (XmlPullParserException e) {
+		   throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Supplied configuration is not conform the metatype xml specification.", e);
+	   }
+	   if (data == null) {
+		   throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Supplied configuration is not conform the metatype xml specification.");
+	   }
+
+	   // process resources
+	   Map designates = data.getDesignates();
+	   Map localOcds = data.getObjectClassDefinitions();
+	   Iterator i = designates.keySet().iterator();
+	   while (i.hasNext()) {
+		   Designate designate = (Designate) designates.get(i.next());
+		   
+		   // determine OCD
+		   ObjectClassDefinition ocd = null;
+		   String ocdRef = designate.getObject().getOcdRef();
+		   OCD localOcd = (OCD) localOcds.get(ocdRef);
+		   // ask meta type service for matching OCD if no local OCD has been defined
+		   ocd = (localOcd != null) ? new ObjectClassDefinitionImpl(localOcd) : getMetaTypeOCD(data, designate);
+		   if (ocd == null) {
+			   throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "No Object Class Definition found with id=" + ocdRef);
+		   }
+		   
+		   // determine configuration data based on the values and their type definition
+		   Dictionary dict = getProperties(designate, ocd);
+		   if (dict == null) {
+			   // designate does not match it's definition, but was marked optional, ignore it
+			   continue;
+		   }
+		   
+		   // add to session data
+		   if (!m_toBeInstalled.containsKey(name)) {
+			   m_toBeInstalled.put(name, new ArrayList());
+		   }
+		   List resources = (List) m_toBeInstalled.get(name);
+		   resources.add(new AutoConfResource(name, designate.getPid(), designate.getFactoryPid(), designate.getBundleLocation(), designate.isMerge(), dict));
+	   }
+    }
+
+    public void dropped(String name) throws ResourceProcessorException {
+    	if (m_session == null) {
+    		throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Can not process resource without a Deployment Session");
+    	}
+    	try {
+    		List resources = m_persistencyManager.load(name);
+    		if (!m_toBeDeleted.containsKey(name)) {
+    			m_toBeDeleted.put(name, new ArrayList());
+    		}
+    		((List) m_toBeDeleted.get(name)).addAll(resources);
+    	}
+    	catch (IOException ioe) {
+    		throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Unable to drop resource: " + name, ioe);
+    	}
+    }
+
+    public void dropAllResources() throws ResourceProcessorException {
+    	if (m_session == null) {
+    		throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Can not drop all resources without a Deployment Session");
+    	}
+    	try {
+    		Map loadAll = m_persistencyManager.loadAll();
+    		for (Iterator i = loadAll.keySet().iterator(); i.hasNext();) {
+    			String name = (String) i.next();
+    			dropped(name);
+    		}
+    	}
+    	catch (IOException ioe) {
+    		throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Unable to drop all resources.", ioe);
+    	}
+
+    	File basedir = m_bc.getDataFile("");
+    	if (basedir != null && basedir.isDirectory()) {
+    		String[] files = basedir.list();
+    		for (int i = 0; i < files.length; i++) {
+    			dropped(files[i]);
+    		}
+    	}
+    	else {
+    		throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Unable to drop resources, data area is not accessible");
+    	}
+    }
+
+    public void prepare() throws ResourceProcessorException {
+    	if (m_session == null) {
+    		throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Can not process resource without a Deployment Session");
+    	}
+
+    	try {
+    		// delete dropped resources
+    		for (Iterator i = m_toBeDeleted.keySet().iterator(); i.hasNext();) {
+    			String name = (String) i.next();
+    			List resources = (List) m_toBeDeleted.get(name);
+    			for (Iterator j = resources.iterator(); j.hasNext();) {
+    				AutoConfResource resource = (AutoConfResource) j.next();
+    				if (resource.isFactoryConfig()) {
+    					Configuration configuration = m_configAdmin.getConfiguration(resource.getGeneratedPid(), resource.getBundleLocation());
+    					configuration.delete();
+    				} else {
+    					Configuration configuration = m_configAdmin.getConfiguration(resource.getPid(), resource.getBundleLocation());
+    					configuration.delete();
+    				}
+    			}
+    			m_persistencyManager.delete(name);
+    		}
+
+    		// install new/updated resources
+    		for (Iterator j = m_toBeInstalled.keySet().iterator(); j.hasNext();) {
+    			String name = (String) j.next();
+    			List existingResources = null;
+    			try {
+    				existingResources = m_persistencyManager.load(name);
+    			} catch (IOException ioe) {
+    				throw new ResourceProcessorException(ResourceProcessorException.CODE_PREPARE, "Unable to read existing resources for resource " + name, ioe);
+    			}
+    			List resources = (List) m_toBeInstalled.get(name);
+    			for (Iterator iterator = resources.iterator(); iterator.hasNext();) {
+    				AutoConfResource resource = (AutoConfResource) iterator.next();
+
+    				Dictionary properties = resource.getProperties();
+    				String bundleLocation = resource.getBundleLocation();
+    				Configuration configuration = null;
+
+    				// update configuration
+    				if (resource.isFactoryConfig()) {
+    					// check if this is an factory config instance update
+    					for (Iterator i = existingResources.iterator(); i.hasNext();) {
+    						AutoConfResource existingResource = (AutoConfResource) i.next();
+    						if (resource.equalsTargetConfiguration(existingResource)) {
+    							// existing instance found
+    							configuration = m_configAdmin.getConfiguration(existingResource.getGeneratedPid(), bundleLocation);
+    							existingResources.remove(existingResource);
+    							break;
+    						}
+    					}
+    					if (configuration == null) {
+    						// no existing instance, create new
+    						configuration = m_configAdmin.createFactoryConfiguration(resource.getFactoryPid(), bundleLocation);
+    					}
+    					resource.setGeneratedPid(configuration.getPid());
+    				}
+    				else {
+    					for (Iterator i = existingResources.iterator(); i.hasNext();) {
+    						AutoConfResource existingResource = (AutoConfResource) i.next();
+    						if (resource.getPid().equals(existingResource.getPid())) {
+    							// existing resource found
+    							existingResources.remove(existingResource);
+    							break;
+    						}
+    					}
+    					configuration = m_configAdmin.getConfiguration(resource.getPid(), bundleLocation);
+    					if (!bundleLocation.equals(configuration.getBundleLocation())) {
+    						// an existing configuration exists that is bound to a different location, which is not allowed
+    						throw new ResourceProcessorException(ResourceProcessorException.CODE_PREPARE, "Existing configuration was not unbound and not bound to the specified bundlelocation");
+    					}
+    				}
+    				if (resource.isMerge()) {
+    					Dictionary existingProperties = configuration.getProperties();
+    					if (existingProperties != null) {
+    						Enumeration keys = existingProperties.keys();
+    						while (keys.hasMoreElements()) {
+    							Object key = keys.nextElement();
+    							properties.put(key, existingProperties.get(key));
+    						}
+    					}
+    				}
+    				configuration.update(properties);
+    			}
+
+    			// remove existing configurations that were not in the new version of the resource
+    			for (Iterator i = existingResources.iterator(); i.hasNext();) {
+    				AutoConfResource existingResource = (AutoConfResource) i.next();
+    				Configuration configuration = null;
+    				if (existingResource.isFactoryConfig()) {
+    					configuration = m_configAdmin.getConfiguration(existingResource.getGeneratedPid(), existingResource.getBundleLocation());
+    				} else {
+    					configuration = m_configAdmin.getConfiguration(existingResource.getPid(), existingResource.getBundleLocation());
+    				}
+    				configuration.delete();
+    			}
+    			m_persistencyManager.store(name, resources);
+    		}
+    	}
+    	catch (IOException ioe) {
+    		m_toBeInstalled.clear();
+    		throw new ResourceProcessorException(ResourceProcessorException.CODE_PREPARE, "Unable to prepare for commit for resource", ioe);
+    	}
+    }
+
+    public synchronized void commit() {
+    	m_toBeInstalled.clear();
+    	m_toBeDeleted.clear();
+    	m_session = null;
+    }
+
+    public void rollback() {
+    	Set keys = m_toBeInstalled.keySet();
+    	for (Iterator i = keys.iterator(); i.hasNext();) {
+    		List configs = (List) m_toBeInstalled.get(i.next());
+    		for (Iterator j = configs.iterator(); j.hasNext();) {
+    			AutoConfResource resource = (AutoConfResource) j.next();
+    			String name = resource.getName();
+    			try {
+    				dropped(name);
+    			} catch (ResourceProcessorException e) {
+    				m_log.log(LogService.LOG_ERROR, "Unable to roll back resource '" + name + "', reason: " + e.getMessage() + ", caused by: " + e.getCause().getMessage());
+    			}
+    			break;
+    		}
+    	}
+    	m_toBeInstalled.clear();
+    	m_session = null;
+    }
+
+    public void cancel() {
+    	rollback();
+    	m_session = null;
+    }
+
+    /**
+     * Determines the actual configuration data based on the specified designate and object class definition
+     * 
+     * @param designate The designate object containing the values for the properties
+     * @param ocd The object class definition
+     * @return A dictionary containing data as described in the designate and ocd objects, or <code>null</code> if the designate does not match it's
+     * definition and the designate was marked as optional.
+     * @throws ResourceProcessorException If the designate does not match the ocd and the designate is not marked as optional.
+     */
+    private Dictionary getProperties(Designate designate, ObjectClassDefinition ocd) throws ResourceProcessorException {
+    	Dictionary properties = new Hashtable();
+    	AttributeDefinition[] attributeDefs = ocd.getAttributeDefinitions(ObjectClassDefinition.ALL);
+    	List attributes = designate.getObject().getAttributes();
+
+    	for (Iterator i = attributes.iterator(); i.hasNext();) {
+    		Attribute attribute = (Attribute) i.next();
+
+    		String adRef = attribute.getAdRef();
+    		boolean found = false;
+    		for(int j = 0; j < attributeDefs.length; j++) {
+    			AttributeDefinition ad = attributeDefs[j];
+    			if (adRef.equals(ad.getID())) {
+    				// found attribute definition
+    				Object value = getValue(attribute, ad);
+    				if (value == null) {
+    					if (designate.isOptional()) {
+    						properties = null;
+    						break;
+    					}
+    					else {
+    						throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Could not match attribute to it's definition: adref=" + adRef);
+    					}
+    				}
+    				properties.put(adRef, value);
+    				found = true;
+    				break;
+    			}
+    		}
+    		if (!found) {
+    			if (designate.isOptional()) {
+    				properties = null;
+    				break;
+    			} else {
+    				throw new ResourceProcessorException(ResourceProcessorException.CODE_OTHER_ERROR, "Could not find attribute definition: adref=" + adRef);
+    			}
+    		}
+    	}
+
+    	return properties;
+    }
+
+    /**
+     * Determines the object class definition matching the specified designate.
+     * 
+     * @param data The meta data containing 'local' object class definitions.
+     * @param designate The designate whose object class definition should be determined.
+     * @return
+     * @throws ResourceProcessorException
+     */
+    private ObjectClassDefinition getMetaTypeOCD(MetaData data, Designate designate) throws ResourceProcessorException {
+    	ObjectClassDefinition ocd = null;
+    	String ocdRef = designate.getObject().getOcdRef();
+    	Bundle bundle = getBundle(designate.getBundleLocation(), isFactoryConfig(designate));
+    	if (bundle != null) {
+    		MetaTypeInformation mti = m_metaService.getMetaTypeInformation(bundle);
+    		if (mti != null) {
+    			String pid = isFactoryConfig(designate) ? pid = designate.getFactoryPid() : designate.getPid();
+    			try {
+    				ObjectClassDefinition tempOcd = mti.getObjectClassDefinition(pid, null);
+    				// tempOcd will always have a value, if pid was not known IAE will be thrown
+    				if (ocdRef.equals(tempOcd.getID())) {
+    					ocd = tempOcd;
+    				}
+    			}
+    			catch (IllegalArgumentException iae) {
+    				// let null be returned
+    			}
+    		}
+    	}
+    	return ocd;
+    }
+
+    private boolean isFactoryConfig(Designate designate) {
+    	String factoryPid = designate.getFactoryPid();
+    	return (factoryPid != null || !"".equals(factoryPid));
+    }
+
+    private Bundle getBundle(String bundleLocation, boolean isFactory) throws ResourceProcessorException {
+    	Bundle bundle = null;
+    	if (!isFactory) {
+    		// singleton configuration, no foreign bundles allowed, use source deployment package to find specified bundle
+    		if (bundleLocation.startsWith(LOCATION_PREFIX)) {
+    			bundle = m_session.getSourceDeploymentPackage().getBundle(bundleLocation.substring(LOCATION_PREFIX.length()));
+    		}
+    	}
+    	else {
+    		// factory configuration, foreign bundles allowed, use bundle context to find the specified bundle
+    		Bundle[] bundles = m_bc.getBundles();                                                                               
+    		for (int i = 0; i < bundles.length; i++) {
+    			String location = bundles[i].getLocation();
+    			if (bundleLocation.equals(location)) {
+    				bundle = bundles[i];
+    				break;
+    			}
+    		}
+    	}
+    	return bundle;
+    }
+
+    /**
+     * Determines the value of an attribute based on an attribute definition
+     * 
+     * @param attribute The attribute containing value(s)
+     * @param ad The attribute definition
+     * @return An <code>Object</code> reflecting what was specified in the attribute and it's definition or <code>null</code> if
+     * the value did not match it's definition.
+     */
+    private Object getValue(Attribute attribute, AttributeDefinition ad) {
+    	if (attribute == null || ad == null || !attribute.getAdRef().equals(ad.getID())) {
+    		// wrong attribute or definition
+    		return null;
+    	}
+    	String[] content = attribute.getContent();
+
+    	// verify correct type of the value(s)
+    	int type = ad.getType();
+    	Object[] typedContent = null;
+    	try {
+    		for (int i = 0; i < content.length; i++) {
+    			String value = content[i];
+    			switch (type) {
+    			case AttributeDefinition.BOOLEAN:
+    				typedContent = (typedContent == null) ? new Boolean[content.length] : typedContent;
+    				typedContent[i] = Boolean.valueOf(value);	
+    				break;
+    			case AttributeDefinition.BYTE:
+    				typedContent = (typedContent == null) ? new Byte[content.length] : typedContent;
+    				typedContent[i] = Byte.valueOf(value);
+    				break;
+    			case AttributeDefinition.CHARACTER:
+    				typedContent = (typedContent == null) ? new Character[content.length] : typedContent;
+    				char[] charArray = value.toCharArray();
+    				if (charArray.length == 1) {
+    					typedContent[i] = new Character(charArray[0]);
+    				}
+    				else {
+    					return null;
+    				}
+    				break;
+    			case AttributeDefinition.DOUBLE:
+    				typedContent = (typedContent == null) ? new Double[content.length] : typedContent;
+    				typedContent[i] = Double.valueOf(value);
+    				break;
+    			case AttributeDefinition.FLOAT:
+    				typedContent = (typedContent == null) ? new Float[content.length] : typedContent;
+    				typedContent[i] = Float.valueOf(value);
+    				break;
+    			case AttributeDefinition.INTEGER:
+    				typedContent = (typedContent == null) ? new Integer[content.length] : typedContent;
+    				typedContent[i] = Integer.valueOf(value);
+    				break;
+    			case AttributeDefinition.LONG:
+    				typedContent = (typedContent == null) ? new Long[content.length] : typedContent;
+    				typedContent[i] = Long.valueOf(value);
+    				break;
+    			case AttributeDefinition.SHORT:
+    				typedContent = (typedContent == null) ? new Short[content.length] : typedContent;
+    				typedContent[i] = Short.valueOf(value);
+    				break;
+    			case AttributeDefinition.STRING:
+    				typedContent = (typedContent == null) ? new String[content.length] : typedContent;
+    				typedContent[i] = value;
+    				break;
+    			default:
+    				// unsupported type
+    				return null;
+    			}
+    		}
+    	}
+    	catch (NumberFormatException nfe) {
+    		return null;
+    	}
+
+    	// verify cardinality of value(s)
+    	int cardinality = ad.getCardinality();
+    	Object result = null;
+    	if (cardinality == 0) {
+    		if (typedContent.length == 1) {
+    			result = typedContent[0];
+    		}
+    		else {
+    			result = null;
+    		}
+    	}
+    	else if (cardinality == Integer.MIN_VALUE) {
+    		result = new Vector(Arrays.asList(typedContent));
+    	}
+    	else if (cardinality == Integer.MAX_VALUE) {
+    		result = typedContent;
+    	}
+    	else if (cardinality < 0) {
+    		if (typedContent.length == cardinality) {
+    			result = new Vector(Arrays.asList(typedContent));
+    		}
+    		else {
+    			result = null;
+    		}
+    	}
+    	else if (cardinality > 0) {
+    		if (typedContent.length == cardinality) {
+    			result = typedContent;
+    		}
+    		else {
+    			result = null;
+    		}
+    	}
+    	return result;
+    }
+}
diff --git a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/ObjectClassDefinitionImpl.java b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/ObjectClassDefinitionImpl.java
new file mode 100644
index 0000000..e4217d2
--- /dev/null
+++ b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/ObjectClassDefinitionImpl.java
@@ -0,0 +1,83 @@
+/*
+ * 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.deployment.rp.autoconf;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.felix.metatype.AD;
+import org.apache.felix.metatype.OCD;
+import org.osgi.service.metatype.AttributeDefinition;
+import org.osgi.service.metatype.ObjectClassDefinition;
+
+public class ObjectClassDefinitionImpl implements ObjectClassDefinition {
+
+   	private final OCD m_ocd;
+
+	public ObjectClassDefinitionImpl(OCD ocd) {
+		m_ocd = ocd;
+	}
+	
+	public AttributeDefinition[] getAttributeDefinitions(int filter) {
+		if (m_ocd.getAttributeDefinitions() == null) {
+            return null;
+        }
+        if (filter != ObjectClassDefinition.OPTIONAL && filter != ObjectClassDefinition.REQUIRED && filter != ObjectClassDefinition.ALL) {
+            return null;
+        }
+
+        List result = new ArrayList();
+        for (Iterator i = m_ocd.getAttributeDefinitions().values().iterator(); i.hasNext();) {
+        	AD ad = (AD) i.next();
+        	if (filter != ObjectClassDefinition.ALL) {
+        		if (ad.isRequired() && filter == ObjectClassDefinition.REQUIRED) {
+        			result.add(new AttributeDefinitionImpl(ad));
+        		}
+        		else if (!ad.isRequired() && filter == ObjectClassDefinition.OPTIONAL) {
+        			result.add(new AttributeDefinitionImpl(ad));
+        		}
+        	} else {
+        		result.add(new AttributeDefinitionImpl(ad));
+        	}
+        }
+
+        return (AttributeDefinition[]) result.toArray(new AttributeDefinition[result.size()]);
+	}
+
+	public InputStream getIcon(int size) throws IOException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getDescription() {
+		return m_ocd.getDescription();
+	}
+
+	public String getID() {
+		return m_ocd.getID();
+	}
+
+	public String getName() {
+		return m_ocd.getName();
+	}
+
+}
diff --git a/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/PersistencyManager.java b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/PersistencyManager.java
new file mode 100644
index 0000000..b253a65
--- /dev/null
+++ b/deploymentadmin/autoconf/src/main/java/org/apache/felix/deployment/rp/autoconf/PersistencyManager.java
@@ -0,0 +1,140 @@
+/*
+ * 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.deployment.rp.autoconf;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PersistencyManager {
+	
+	private final File m_root;
+
+	public PersistencyManager(File root) {
+		m_root = root;
+	}
+
+	/**
+	 * Stores a resource.
+	 * 
+	 * @param name Name of the resource.
+	 * @param configs List of <code>AutoConfResource</code>s representing the specified resource.
+	 * @throws IOException If the resource could not be stored.
+	 */
+	public void store(String name, List configs) throws IOException {
+		if (configs.isEmpty()) {
+			return;
+		}
+		File targetDir = m_root;
+		name = name.replaceAll("/", File.separator);
+		if (name.startsWith(File.separator)) {
+			name = name.substring(1);
+		}
+		int lastSeparator = name.lastIndexOf(File.separator);
+		File target = null;
+		if (lastSeparator != -1) {
+			targetDir = new File(targetDir, name.substring(0, lastSeparator));
+			targetDir.mkdirs();
+		}
+		target = new File(targetDir, name.substring(lastSeparator + 1));
+
+		ObjectOutputStream out = null;
+		try {
+			out = new ObjectOutputStream(new FileOutputStream(target));
+			out.writeObject(configs);
+		} finally {
+			if (out != null) {
+				try {
+					out.close();
+				} catch (Exception e) {
+					// not much we can do
+				}
+			}
+		}
+	}
+
+	/**
+	 * Deletes a resource.
+	 * 
+	 * @param name Name of the resource.
+	 * @throws IOException If the resource could not be deleted.
+	 */
+	public void delete(String name) throws IOException {
+		name = name.replace('/', File.separatorChar);
+		File target = new File(m_root, name);
+		if (!target.delete()) {
+			throw new IOException("Unable to delete file: " + target.getAbsolutePath());
+		}
+		while (target.getParentFile().list().length == 0 && !target.getParentFile().getAbsolutePath().equals(m_root.getAbsolutePath())) {
+			target = target.getParentFile();
+			target.delete();
+		}
+	}
+
+	/**
+	 * Loads a stored resource.
+	 * 
+	 * @param name Name of the resource.
+	 * @return List of <code>AutoConfResource</code>s representing the specified resource, if the resource is unknown an empty list is returned.
+	 * @throws IOException If the resource could not be properly read.
+	 */
+	public List load(String name) throws IOException {
+		name = name.replaceAll("/", File.separator);
+		List resources = new ArrayList();
+		File resourcesFile = new File(m_root, name);
+		if (resourcesFile.exists()) {
+			ObjectInputStream in = null;
+			try {
+				in = new ObjectInputStream(new FileInputStream(resourcesFile));
+				resources = (List) in.readObject();
+			} catch (FileNotFoundException fnfe) {
+				throw new IOException("Resource does not exist: " + name);
+			} catch (ClassNotFoundException cnfe) {
+				throw new IOException("Unable to recreate persisted object from file: " + name);
+			} finally {
+				if (in != null) {
+					try {
+						in.close();
+					} catch (Exception e) {
+						// not much we can do
+					}
+				}
+			}
+		}
+		return resources;
+	}
+	
+	/**
+	 * Loads all stored resources.
+	 * 
+	 * @return A map containing all persisted resources which is typed <String, List<AutoConfResource>>
+	 * @throws IOException If not all resources could be loaded.
+	 */
+	public Map loadAll() throws IOException {
+		return new HashMap();
+	}
+}
diff --git a/deploymentadmin/pom.xml b/deploymentadmin/pom.xml
index 3dc0c07..489fa44 100644
--- a/deploymentadmin/pom.xml
+++ b/deploymentadmin/pom.xml
@@ -30,5 +30,6 @@
   <version>1</version>
   <modules>
       <module>service</module>
+      <module>autoconf</module>
   </modules>
 </project>
