incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1021389 - in /sling/trunk/contrib/extensions/rewriter: pom.xml src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java src/main/java/org/apache/sling/rewriter/impl/WebConsoleConfigPrinter.java
Date Mon, 11 Oct 2010 15:37:35 GMT
Author: cziegeler
Date: Mon Oct 11 15:37:35 2010
New Revision: 1021389

URL: http://svn.apache.org/viewvc?rev=1021389&view=rev
Log:
SLING-1840 : Remove direct dependency to web console by using new configuration printer support

Modified:
    sling/trunk/contrib/extensions/rewriter/pom.xml
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
    sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/WebConsoleConfigPrinter.java

Modified: sling/trunk/contrib/extensions/rewriter/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/pom.xml?rev=1021389&r1=1021388&r2=1021389&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/pom.xml (original)
+++ sling/trunk/contrib/extensions/rewriter/pom.xml Mon Oct 11 15:37:35 2010
@@ -70,9 +70,6 @@
                             org.apache.sling.rewriter.impl,
                             org.apache.sling.rewriter.impl.components
                         </Private-Package>
-                        <DynamicImport-Package>
-                            org.apache.felix.webconsole
-                        </DynamicImport-Package>
                     </instructions>
                 </configuration>
             </plugin>
@@ -117,12 +114,6 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.webconsole</artifactId>
-            <version>2.0.6</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
         </dependency>

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java?rev=1021389&r1=1021388&r2=1021389&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java
Mon Oct 11 15:37:35 2010
@@ -117,11 +117,8 @@ public class ProcessorManagerImpl
                   .registerService(EventHandler.class.getName(), this, props);
 
         this.factoryCache.start();
-        try {
-            WebConsoleConfigPrinter.register(this.bundleContext, this);
-        } catch (Exception ignore) {
-            // ignore
-        }
+
+        WebConsoleConfigPrinter.register(this.bundleContext, this);
     }
 
     /**
@@ -139,11 +136,9 @@ public class ProcessorManagerImpl
             this.resourceResolver.close();
             this.resourceResolver = null;
         }
-        try {
-            WebConsoleConfigPrinter.unregister();
-        } catch (Exception ignore) {
-            // ignore
-        }
+
+        WebConsoleConfigPrinter.unregister();
+
         this.bundleContext = null;
     }
 

Modified: sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/WebConsoleConfigPrinter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/WebConsoleConfigPrinter.java?rev=1021389&r1=1021388&r2=1021389&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/WebConsoleConfigPrinter.java
(original)
+++ sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/WebConsoleConfigPrinter.java
Mon Oct 11 15:37:35 2010
@@ -22,7 +22,6 @@ import java.io.PrintWriter;
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import org.apache.felix.webconsole.ConfigurationPrinter;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
@@ -32,7 +31,7 @@ import org.osgi.framework.ServiceRegistr
  * prints out the currently configured processors/pipelines.
  *
  */
-public class WebConsoleConfigPrinter implements ConfigurationPrinter {
+public class WebConsoleConfigPrinter {
 
     final ProcessorManagerImpl manager;
 
@@ -49,8 +48,11 @@ public class WebConsoleConfigPrinter imp
         serviceProps.put(Constants.SERVICE_DESCRIPTION,
             "Apache Sling Rewriter Configuration Printer");
         serviceProps.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
+        serviceProps.put("felix.webconsole.label", "slingrewriter");
+        serviceProps.put("felix.webconsole.title", "Sling Rewriter");
+        serviceProps.put("felix.webconsole.configprinter.modes", "always");
 
-        REG = bundleContext.registerService(ConfigurationPrinter.class.getName(),
+        REG = bundleContext.registerService(WebConsoleConfigPrinter.class.getName(),
                 printer,
                 serviceProps);
     }
@@ -63,14 +65,6 @@ public class WebConsoleConfigPrinter imp
     }
 
     /**
-     * Return the title for the configuration printer
-     * @see org.apache.felix.webconsole.ConfigurationPrinter#getTitle()
-     */
-    public String getTitle() {
-        return "Rewriter";
-    }
-
-    /**
      * Print out the rewriter configs.
      * @see org.apache.felix.webconsole.ConfigurationPrinter#printConfiguration(java.io.PrintWriter)
      */



Mime
View raw message