incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1021415 - in /sling/trunk/bundles/extensions/threaddump: pom.xml src/main/java/org/apache/sling/extensions/threaddump/internal/Activator.java src/main/java/org/apache/sling/extensions/threaddump/internal/ThreadDumperPanel.java
Date Mon, 11 Oct 2010 16:34:16 GMT
Author: cziegeler
Date: Mon Oct 11 16:34:15 2010
New Revision: 1021415

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

Modified:
    sling/trunk/bundles/extensions/threaddump/pom.xml
    sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/Activator.java
    sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/ThreadDumperPanel.java

Modified: sling/trunk/bundles/extensions/threaddump/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/threaddump/pom.xml?rev=1021415&r1=1021414&r2=1021415&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/threaddump/pom.xml (original)
+++ sling/trunk/bundles/extensions/threaddump/pom.xml Mon Oct 11 16:34:15 2010
@@ -61,8 +61,7 @@
                             org.osgi.framework,
                             org.slf4j.*,
                             javax.servlet.*;
-                            org.apache.felix.shell;
-                            org.apache.felix.webconsole;resolution:=optional
+                            org.apache.felix.shell;resolution:=optional
                         </Import-Package>
                         <Private-Package>
                             org.apache.sling.extensions.threaddump.*
@@ -90,11 +89,6 @@
             <version>1.0.0</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.webconsole</artifactId>
-            <version>1.2.0</version>
-        </dependency>
-        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
         </dependency>

Modified: sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/Activator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/Activator.java?rev=1021415&r1=1021414&r2=1021415&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/Activator.java
(original)
+++ sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/Activator.java
Mon Oct 11 16:34:15 2010
@@ -45,20 +45,20 @@ public class Activator implements Bundle
         try {
             register(bundleContext,
                 new String[] { "org.apache.felix.shell.Command" },
-                new ThreadDumpCommand());
+                new ThreadDumpCommand(), null);
         } catch (Throwable t) {
             // shell service might not be available, don't care
         }
 
         // install Web Console configuration printer
-        try {
-            ThreadDumperPanel tdp = new ThreadDumperPanel();
-
-            register(bundleContext, new String[] {
-                "org.apache.felix.webconsole.ConfigurationPrinter" }, tdp);
-        } catch (Throwable t) {
-            // web console might not be available, don't care
-        }
+        Dictionary<String, Object> props = new Hashtable<String, Object>();
+        props.put("felix.webconsole.label", "slingthreads");
+        props.put("felix.webconsole.title", "Threads");
+        props.put("felix.webconsole.configprinter.modes", "always");
+
+        register(bundleContext, new String[] {
+                ThreadDumperPanel.class.getName() },
+                new ThreadDumperPanel(), props);
     }
 
     public void stop(BundleContext bundleContext) {
@@ -66,9 +66,12 @@ public class Activator implements Bundle
     }
 
     private void register(BundleContext context, String[] serviceNames,
-            Object service) {
+            Object service,
+            Dictionary<String, Object> properties) {
 
-        final Dictionary<String, Object> properties = new Hashtable<String, Object>();
+        if ( properties == null ) {
+            properties = new Hashtable<String, Object>();
+        }
 
         // default settings
         properties.put(Constants.SERVICE_DESCRIPTION, "Thread Dumper ("

Modified: sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/ThreadDumperPanel.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/ThreadDumperPanel.java?rev=1021415&r1=1021414&r2=1021415&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/ThreadDumperPanel.java
(original)
+++ sling/trunk/bundles/extensions/threaddump/src/main/java/org/apache/sling/extensions/threaddump/internal/ThreadDumperPanel.java
Mon Oct 11 16:34:15 2010
@@ -20,21 +20,10 @@ package org.apache.sling.extensions.thre
 
 import java.io.PrintWriter;
 
-import org.apache.felix.webconsole.ConfigurationPrinter;
-
-public class ThreadDumperPanel implements ConfigurationPrinter {
-
-    private static final String TITLE = "Threads";
+public class ThreadDumperPanel {
 
     private BaseThreadDumper baseThreadDumper = new BaseThreadDumper();
 
-    /**
-     * @see org.apache.felix.webconsole.ConfigurationPrinter#getTitle()
-     */
-    public String getTitle() {
-        return TITLE;
-    }
-
     // ---------- ConfigurationPrinter
 
     /**



Mime
View raw message