incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r896497 - in /sling/trunk/bundles/scripting/core: pom.xml src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineConsolePlugin.java
Date Wed, 06 Jan 2010 15:57:18 GMT
Author: cziegeler
Date: Wed Jan  6 15:57:15 2010
New Revision: 896497

URL: http://svn.apache.org/viewvc?rev=896497&view=rev
Log:
SLING-1268 : Remove direct dependency to web console

Modified:
    sling/trunk/bundles/scripting/core/pom.xml
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineConsolePlugin.java

Modified: sling/trunk/bundles/scripting/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/pom.xml?rev=896497&r1=896496&r2=896497&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/pom.xml (original)
+++ sling/trunk/bundles/scripting/core/pom.xml Wed Jan  6 15:57:15 2010
@@ -159,12 +159,6 @@
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.webconsole</artifactId>
-            <version>1.2.0</version>
-            <scope>provided</scope>
-        </dependency>
 
         <dependency>
             <groupId>org.slf4j</groupId>

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineConsolePlugin.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineConsolePlugin.java?rev=896497&r1=896496&r2=896497&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineConsolePlugin.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineConsolePlugin.java
Wed Jan  6 15:57:15 2010
@@ -27,16 +27,15 @@
 
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
+import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.felix.webconsole.AbstractWebConsolePlugin;
-import org.apache.felix.webconsole.WebConsoleConstants;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
 
-public class ScriptEngineConsolePlugin extends AbstractWebConsolePlugin {
+public class ScriptEngineConsolePlugin extends HttpServlet {
 
     private static final String LABEL = "scriptengines";
 
@@ -75,17 +74,7 @@
     }
 
     @Override
-    public String getLabel() {
-        return LABEL;
-    }
-
-    @Override
-    public String getTitle() {
-        return "Script Engines";
-    }
-
-    @Override
-    protected void renderContent(HttpServletRequest req, HttpServletResponse res)
+    protected void service(HttpServletRequest req, HttpServletResponse res)
             throws IOException {
         PrintWriter pw = res.getWriter();
 
@@ -159,17 +148,16 @@
     }
 
     public void activate(BundleContext context) {
-        super.activate(context);
-
-        Dictionary<String, Object> props = new Hashtable<String, Object>();
+        final Dictionary<String, Object> props = new Hashtable<String, Object>();
         props.put(Constants.SERVICE_DESCRIPTION,
             "Web Console Plugin for ScriptEngine implementations");
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         props.put(Constants.SERVICE_PID, getClass().getName());
-        props.put(WebConsoleConstants.PLUGIN_LABEL, LABEL);
+        props.put("felix.webconsole.label", LABEL);
+        props.put("felix.webconsole.title", "Script Engines");
 
         serviceRegistration = context.registerService(
-            WebConsoleConstants.SERVICE_NAME, this, props);
+            "javax.servlet.Servlet", this, props);
     }
 
     public void deactivate() {
@@ -177,8 +165,5 @@
             serviceRegistration.unregister();
             serviceRegistration = null;
         }
-
-        super.deactivate();
     }
-
 }



Mime
View raw message