felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvalc...@apache.org
Subject svn commit: r1694635 - in /felix/trunk/webconsole-plugins/packageadmin: ./ src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/
Date Fri, 07 Aug 2015 08:59:17 GMT
Author: vvalchev
Date: Fri Aug  7 08:59:16 2015
New Revision: 1694635

URL: http://svn.apache.org/r1694635
Log:
Fixed FELIX-4996 : Dependency Finder should use Inventory instead of deprecated ConfigurationPrinter
https://issues.apache.org/jira/browse/FELIX-4996

Modified:
    felix/trunk/webconsole-plugins/packageadmin/pom.xml
    felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/Activator.java
    felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePrinter.java

Modified: felix/trunk/webconsole-plugins/packageadmin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/packageadmin/pom.xml?rev=1694635&r1=1694634&r2=1694635&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/packageadmin/pom.xml (original)
+++ felix/trunk/webconsole-plugins/packageadmin/pom.xml Fri Aug  7 08:59:16 2015
@@ -148,6 +148,12 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.inventory</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
             <version>20070829</version>

Modified: felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/Activator.java?rev=1694635&r1=1694634&r2=1694635&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/Activator.java
(original)
+++ felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/Activator.java
Fri Aug  7 08:59:16 2015
@@ -21,9 +21,9 @@ package org.apache.felix.webconsole.plug
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import org.apache.felix.webconsole.ConfigurationPrinter;
+import org.apache.felix.inventory.Format;
+import org.apache.felix.inventory.InventoryPrinter;
 import org.apache.felix.webconsole.SimpleWebConsolePlugin;
-import org.apache.felix.webconsole.WebConsoleConstants;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -55,10 +55,12 @@ public class Activator implements Bundle
 
         // register configuration printer
         final Dictionary/*<String, Object>*/props = new Hashtable/*<String, Object>*/();
-        props.put(WebConsoleConstants.CONFIG_PRINTER_MODES, new String[] {
-                ConfigurationPrinter.MODE_ZIP, ConfigurationPrinter.MODE_TXT });
+        props.put(InventoryPrinter.NAME, "duplicate_exports"); //$NON-NLS-1$
+        props.put(InventoryPrinter.TITLE, "Duplicate Exports"); //$NON-NLS-1$
+        props.put(InventoryPrinter.FORMAT, new String[] { Format.TEXT.toString() });
+
         printerReg = context.registerService(
-            "org.apache.felix.webconsole.ConfigurationPrinter", //$NON-NLS-1$
+            InventoryPrinter.class.getName(),
             new WebConsolePrinter(context, pkgAdminTracker), props);
     }
 

Modified: felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePrinter.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePrinter.java?rev=1694635&r1=1694634&r2=1694635&view=diff
==============================================================================
--- felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePrinter.java
(original)
+++ felix/trunk/webconsole-plugins/packageadmin/src/main/java/org/apache/felix/webconsole/plugins/packageadmin/internal/WebConsolePrinter.java
Fri Aug  7 08:59:16 2015
@@ -23,17 +23,18 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
 
-import org.apache.felix.webconsole.ConfigurationPrinter;
+import org.apache.felix.inventory.Format;
+import org.apache.felix.inventory.InventoryPrinter;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.packageadmin.ExportedPackage;
 import org.osgi.service.packageadmin.PackageAdmin;
 import org.osgi.util.tracker.ServiceTracker;
 
-class WebConsolePrinter implements ConfigurationPrinter
+class WebConsolePrinter implements InventoryPrinter
 {
 
     private final ServiceTracker tracker;
@@ -46,9 +47,10 @@ class WebConsolePrinter implements Confi
     }
 
     /**
-     * @see org.apache.felix.webconsole.ConfigurationPrinter#printConfiguration(java.io.PrintWriter)
+     * @see org.apache.felix.inventory.InventoryPrinter#print(
+     *  java.io.PrintWriter, org.apache.felix.inventory.Format, boolean)
      */
-    public void printConfiguration(PrintWriter pw)
+    public void print(PrintWriter pw, Format format, boolean isZip) 
     {
         final PackageAdmin pa = (PackageAdmin) tracker.getService();
         if (pa == null)
@@ -160,7 +162,7 @@ class WebConsolePrinter implements Confi
     }
 
     /**
-     * @see org.apache.felix.webconsole.ConfigurationPrinter#getTitle()
+     * @return
      */
     public String getTitle()
     {



Mime
View raw message