incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r709108 - /incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/SlingScriptEngineManager.java
Date Thu, 30 Oct 2008 07:56:33 GMT
Author: fmeschbe
Date: Thu Oct 30 00:56:32 2008
New Revision: 709108

URL: http://svn.apache.org/viewvc?rev=709108&view=rev
Log:
Return all ScriptEngineFactorys from the SlingScriptEngineManager

Modified:
    incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/SlingScriptEngineManager.java

Modified: incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/SlingScriptEngineManager.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/SlingScriptEngineManager.java?rev=709108&r1=709107&r2=709108&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/SlingScriptEngineManager.java
(original)
+++ incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/helper/SlingScriptEngineManager.java
Thu Oct 30 00:56:32 2008
@@ -19,18 +19,38 @@
 package org.apache.sling.scripting.core.impl.helper;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
 
 public class SlingScriptEngineManager extends ScriptEngineManager {
 
-    List<ScriptEngineFactory> factories = new ArrayList<ScriptEngineFactory>();
-
+    private final List<ScriptEngineFactory> factories = new ArrayList<ScriptEngineFactory>();
+    
     public SlingScriptEngineManager(ClassLoader classLoader) {
         super(classLoader);
     }
+    
+    public SlingScriptEngineManager() {
+        super();
+    }
+
+    @Override
+    public List<ScriptEngineFactory> getEngineFactories() {
+        @SuppressWarnings("unchecked")
+        List<ScriptEngineFactory> baseFactories = super.getEngineFactories();
+        
+        List<ScriptEngineFactory> result = new ArrayList<ScriptEngineFactory>();
+        result.addAll(factories);
+        result.addAll(baseFactories);
+        return result;
+    }
 
     public void registerScriptEngineFactory(ScriptEngineFactory factory) {
         for (Object ext : factory.getExtensions()) {
@@ -48,9 +68,4 @@
         factories.add(factory);
     }
 
-    @Override
-    public List<ScriptEngineFactory> getEngineFactories() {
-        return factories;
-    }
-
 }



Mime
View raw message