Small upgrade to the R4.2 API. Modernized the pom in preparation for a release.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1097268 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/deploymentadmin/autoconf/pom.xml b/deploymentadmin/autoconf/pom.xml
index ead7b06..d82d652 100644
--- a/deploymentadmin/autoconf/pom.xml
+++ b/deploymentadmin/autoconf/pom.xml
@@ -17,69 +17,70 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
-  <parent>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>felix</artifactId>
-    <version>1.0.4</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.0.1</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.apache.felix.dependencymanager</artifactId>
-      <version>3.0.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.4</version-->
-      <version>1.0.5-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
         <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>
-            <Deployment-ProvidesResourceProcessor>org.osgi.deployment.rp.autoconf</Deployment-ProvidesResourceProcessor>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+        <artifactId>felix-parent</artifactId>
+        <version>1.2.0</version>
+        <relativePath>../../pom/pom.xml</relativePath>
+    </parent>
+    <properties>
+        <osgi.version>4.2.0</osgi.version>
+    </properties>
+    <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>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>${osgi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>${osgi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>org.apache.felix.dependencymanager</artifactId>
+            <version>3.0.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.5-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.3.4</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>
+                        <Deployment-ProvidesResourceProcessor>org.osgi.deployment.rp.autoconf</Deployment-ProvidesResourceProcessor>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/deploymentadmin/deploymentadmin/pom.xml b/deploymentadmin/deploymentadmin/pom.xml
index 9a5181d..f940caa 100644
--- a/deploymentadmin/deploymentadmin/pom.xml
+++ b/deploymentadmin/deploymentadmin/pom.xml
@@ -17,56 +17,58 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
-  <parent>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>felix</artifactId>
-    <version>1.0.4</version>
-    <relativePath>../pom/pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>Apache Felix Deployment Admin</name>
-  <version>0.9.0-SNAPSHOT</version>
-  <artifactId>org.apache.felix.deploymentadmin</artifactId>
-  <dependencies>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>1.2.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.apache.felix.dependencymanager</artifactId>
-      <version>3.0.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
         <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.deploymentadmin</Bundle-SymbolicName>
-            <Bundle-Activator>org.apache.felix.deploymentadmin.Activator</Bundle-Activator>
-            <Bundle-Name>Apache Felix Deployment Admin</Bundle-Name>
-            <Bundle-Description>A bundle that implements the Deployment Admin.</Bundle-Description>
-            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
-            <Private-Package>org.apache.felix.deploymentadmin.*</Private-Package>
-            <Export-Package>org.osgi.service.deploymentadmin.*;version="1.0"</Export-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+        <artifactId>felix-parent</artifactId>
+        <version>1.2.0</version>
+        <relativePath>../../pom/pom.xml</relativePath>
+    </parent>
+    <properties>
+        <osgi.version>4.2.0</osgi.version>
+    </properties>
+    <name>Apache Felix Deployment Admin</name>
+    <artifactId>org.apache.felix.deploymentadmin</artifactId>
+    <version>0.9.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>${osgi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>${osgi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${pom.groupId}</groupId>
+            <artifactId>org.apache.felix.dependencymanager</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.3.4</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>org.apache.felix.deploymentadmin</Bundle-SymbolicName>
+                        <Bundle-Activator>org.apache.felix.deploymentadmin.Activator</Bundle-Activator>
+                        <Bundle-Name>Apache Felix Deployment Admin</Bundle-Name>
+                        <Bundle-Description>A bundle that implements the Deployment Admin.</Bundle-Description>
+                        <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
+                        <Private-Package>org.apache.felix.deploymentadmin.*</Private-Package>
+                        <Export-Package>org.osgi.service.deploymentadmin.*;version="1.0"</Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/AbstractDeploymentPackage.java b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/AbstractDeploymentPackage.java
index 837a1b2..f0288c3 100644
--- a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/AbstractDeploymentPackage.java
+++ b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/AbstractDeploymentPackage.java
@@ -20,6 +20,8 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.jar.Manifest;
@@ -39,7 +41,6 @@
  * deployment package data is obtained, this should be handled by extending classes.
  */
 public abstract class AbstractDeploymentPackage implements DeploymentPackage {
-
     private final BundleContext m_bundleContext;
     private final DeploymentPackageManifest m_manifest;
     private final Map m_nameToBundleInfo = new HashMap();
@@ -70,6 +71,8 @@
         public ResourceInfoImpl[] getOrderedResourceInfos() { return new ResourceInfoImpl[] {}; }
         public InputStream getCurrentEntryStream() { throw new UnsupportedOperationException(); }
         public AbstractInfo getNextEntry() throws IOException { throw new UnsupportedOperationException(); }
+        public String getDisplayName() { return ""; }
+        public URL getIcon() { return null; }
     };
 
     /* Constructor only for use by the emptyPackage static variable */
@@ -158,6 +161,27 @@
     public String getName() {
         return m_manifest.getSymbolicName();
     }
+    
+    public String getDisplayName() {
+        return getHeader("DeploymentPackage-Name");
+    }
+
+    public URL getIcon() {
+        String icon = getHeader("DeploymentPackage-Icon");
+        if (icon == null) {
+            return null;
+        }
+        else {
+            try {
+                // TODO spec states this must be a local resource, but we don't make
+                // sure of that yet
+                return new URL(icon);
+            }
+            catch (MalformedURLException e) {
+                return null;
+            }
+        }
+    }
 
     public String getResourceHeader(String resource, String header) {
         AbstractInfo info = (AbstractInfo) m_pathToEntry.get(resource);
diff --git a/deploymentadmin/pom.xml b/deploymentadmin/pom.xml
index a86f77e..f23335f 100644
--- a/deploymentadmin/pom.xml
+++ b/deploymentadmin/pom.xml
@@ -1,3 +1,4 @@
+<?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
@@ -16,20 +17,20 @@
 specific language governing permissions and limitations
 under the License. 
 -->
-<project>
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-	    <groupId>org.apache.felix</groupId>
-	    <artifactId>felix-parent</artifactId>
-	    <version>1.2.0</version>
-	    <relativePath>../../pom/pom.xml</relativePath>
-	</parent>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>felix-parent</artifactId>
+        <version>1.2.0</version>
+        <relativePath>../../pom/pom.xml</relativePath>
+    </parent>
     <packaging>pom</packaging>
     <name>Apache Felix Deployment Admin Subproject</name>
     <artifactId>deploymentadmin-reactor</artifactId>
     <version>1</version>
     <modules>
-        <module>service</module>
+        <module>deploymentadmin</module>
         <module>autoconf</module>
     </modules>
 </project>