sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r1786997 - /sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/internal/RhinoJavaScriptEngineFactory.java
Date Wed, 15 Mar 2017 08:29:48 GMT
Author: olli
Date: Wed Mar 15 08:29:48 2017
New Revision: 1786997

URL: http://svn.apache.org/viewvc?rev=1786997&view=rev
Log:
SLING-6644 Add extensions, mime types and names to RhinoJavaScriptEngineFactory's component
properties

Modified:
    sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/internal/RhinoJavaScriptEngineFactory.java

Modified: sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/internal/RhinoJavaScriptEngineFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/internal/RhinoJavaScriptEngineFactory.java?rev=1786997&r1=1786996&r2=1786997&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/internal/RhinoJavaScriptEngineFactory.java
(original)
+++ sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/internal/RhinoJavaScriptEngineFactory.java
Wed Mar 15 08:29:48 2017
@@ -27,6 +27,7 @@ import javax.script.ScriptEngineFactory;
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Properties;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
@@ -79,13 +80,39 @@ import org.slf4j.LoggerFactory;
         bind = "addHostObjectProvider",
         unbind = "removeHostObjectProvider"
 )
-@Property(
+@Properties({
+    @Property(
         name = RhinoJavaScriptEngineFactory.OPTIMIZATION_CONFIG,
         label = "Rhino optimization level",
         intValue = RhinoJavaScriptEngineFactory.DEFAULT_OPTIMIZATION_LEVEL,
         description = "The level of optimization for the bytecode generated by Rhino. Provide
values between 0-9, 9 being the most " +
-                "aggressive level of optimization. A value of -1 will run scripts in interpreted
mode."
-)
+            "aggressive level of optimization. A value of -1 will run scripts in interpreted
mode."
+    ),
+    @Property(
+        name = "extensions",
+        value = {
+            RhinoJavaScriptEngineFactory.ECMA_SCRIPT_EXTENSION,
+            RhinoJavaScriptEngineFactory.ESP_SCRIPT_EXTENSION
+        }
+    ),
+    @Property(
+        name = "mimeTypes",
+        value = {
+            "text/javascript",
+            "application/ecmascript",
+            "application/javascript"
+        }
+    ),
+    @Property(
+        name = "names",
+        value = {
+            "javascript",
+            "JavaScript",
+            "ecmascript",
+            "ECMAScript"
+        }
+    )
+})
 public class RhinoJavaScriptEngineFactory extends AbstractScriptEngineFactory implements
ScopeProvider {
 
     public final static String OPTIMIZATION_CONFIG = "org.apache.sling.scripting.javascript.rhino.optLevel";



Mime
View raw message