incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1021422 - in /sling/trunk/bundles/scripting/core: ./ src/main/java/org/apache/sling/scripting/core/impl/ src/test/java/org/apache/sling/scripting/core/impl/
Date Mon, 11 Oct 2010 16:46:02 GMT
Author: cziegeler
Date: Mon Oct 11 16:46:01 2010
New Revision: 1021422

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

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

Modified: sling/trunk/bundles/scripting/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/pom.xml?rev=1021422&r1=1021421&r2=1021422&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/pom.xml (original)
+++ sling/trunk/bundles/scripting/core/pom.xml Mon Oct 11 16:46:01 2010
@@ -60,9 +60,6 @@
                             org.apache.sling.scripting.core.impl,
                             org.apache.sling.scripting.core.impl.helper
                         </Private-Package>
-                        <DynamicImport-Package>
-                            org.apache.felix.webconsole
-                        </DynamicImport-Package>
                     </instructions>
                 </configuration>
             </plugin>
@@ -106,12 +103,6 @@
             <version>2.1.0</version>
             <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>org.osgi</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=1021422&r1=1021421&r2=1021422&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
Mon Oct 11 16:46:01 2010
@@ -27,12 +27,11 @@ import java.util.List;
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
 
-import org.apache.felix.webconsole.ConfigurationPrinter;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
 
-public class ScriptEngineConsolePlugin implements ConfigurationPrinter {
+public class ScriptEngineConsolePlugin {
 
     // --------- setup and shutdown
 
@@ -124,8 +123,12 @@ public class ScriptEngineConsolePlugin i
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         props.put(Constants.SERVICE_PID, getClass().getName());
 
+        props.put("felix.webconsole.label", "slingscripting");
+        props.put("felix.webconsole.title", "Script Engines");
+        props.put("felix.webconsole.configprinter.modes", "always");
+
         serviceRegistration = context.registerService(
-            ConfigurationPrinter.class.getName(), this, props);
+            this.getClass().getName(), this, props);
     }
 
     public void deactivate() {

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java?rev=1021422&r1=1021421&r2=1021422&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
Mon Oct 11 16:46:01 2010
@@ -198,21 +198,13 @@ public class ScriptEngineManagerFactory 
             }
         }
 
-        try {
-            org.apache.sling.scripting.core.impl.ScriptEngineConsolePlugin.initPlugin(context.getBundleContext(),
this);
-        } catch (Throwable t) {
-            // so what ?
-        }
+        org.apache.sling.scripting.core.impl.ScriptEngineConsolePlugin.initPlugin(context.getBundleContext(),
this);
 
         refreshScriptEngineManager();
     }
 
     protected void deactivate(ComponentContext context) {
-        try {
-            org.apache.sling.scripting.core.impl.ScriptEngineConsolePlugin.destroyPlugin();
-        } catch (Throwable t) {
-            // so what ?
-        }
+        org.apache.sling.scripting.core.impl.ScriptEngineConsolePlugin.destroyPlugin();
 
         context.getBundleContext().removeBundleListener(this);
 

Modified: sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java?rev=1021422&r1=1021421&r2=1021422&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java
(original)
+++ sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactoryTest.java
Mon Oct 11 16:46:01 2010
@@ -16,7 +16,9 @@
  */
 package org.apache.sling.scripting.core.impl;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -75,7 +77,7 @@ public class ScriptEngineManagerFactoryT
             one(bundleCtx).getBundles();
             will(returnValue(new Bundle[0]));
 
-            allowing(bundleCtx).registerService(with(equal("org.apache.felix.webconsole.ConfigurationPrinter")),
with(any(Object.class)), with(any(Dictionary.class)));
+            allowing(bundleCtx).registerService(with(equal("org.apache.sling.scripting.core.impl.ScriptEngineConsolePlugin")),
with(any(Object.class)), with(any(Dictionary.class)));
             will(returnValue(new MockServiceRegistration()));
 
 



Mime
View raw message