sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r986780 - in /sling/trunk/bundles/extensions/groovy: ./ src/main/java/org/apache/sling/extensions/groovy/scripting/internal/
Date Wed, 18 Aug 2010 16:38:25 GMT
Author: justin
Date: Wed Aug 18 16:38:24 2010
New Revision: 986780

URL: http://svn.apache.org/viewvc?rev=986780&view=rev
Log:
SLING-1667 - using dynamic classloader for GSP script engine

Modified:
    sling/trunk/bundles/extensions/groovy/pom.xml
    sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngine.java
    sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngineFactory.java

Modified: sling/trunk/bundles/extensions/groovy/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/groovy/pom.xml?rev=986780&r1=986779&r2=986780&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/groovy/pom.xml (original)
+++ sling/trunk/bundles/extensions/groovy/pom.xml Wed Aug 18 16:38:24 2010
@@ -105,5 +105,11 @@
             <version>2.0.2-incubator</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.classloader</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 </project>
\ No newline at end of file

Modified: sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngine.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngine.java?rev=986780&r1=986779&r2=986780&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngine.java
(original)
+++ sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngine.java
Wed Aug 18 16:38:24 2010
@@ -38,9 +38,9 @@ public class GSPScriptEngine extends Abs
 
     private TemplateEngine templateEngine;
 
-    public GSPScriptEngine(ScriptEngineFactory scriptEngineFactory) {
+    public GSPScriptEngine(ScriptEngineFactory scriptEngineFactory, ClassLoader classLoader)
{
         super(scriptEngineFactory);
-        this.templateEngine = new GStringTemplateEngine();
+        this.templateEngine = new GStringTemplateEngine(classLoader);
     }
     
     public Object eval(Reader reader, ScriptContext ctx) throws ScriptException {

Modified: sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngineFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngineFactory.java?rev=986780&r1=986779&r2=986780&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngineFactory.java
(original)
+++ sling/trunk/bundles/extensions/groovy/src/main/java/org/apache/sling/extensions/groovy/scripting/internal/GSPScriptEngineFactory.java
Wed Aug 18 16:38:24 2010
@@ -22,7 +22,9 @@ import java.util.List;
 import javax.script.ScriptEngine;
 
 import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.commons.classloader.DynamicClassLoaderManager;
 import org.apache.sling.scripting.api.AbstractScriptEngineFactory;
 
 /**
@@ -31,6 +33,9 @@ import org.apache.sling.scripting.api.Ab
 @Component
 @Service
 public class GSPScriptEngineFactory extends AbstractScriptEngineFactory {
+    
+    @Reference
+    private DynamicClassLoaderManager dynamicClassLoaderManager;
 
     public String getLanguageName() {
         return "Groovy Scripting Pages";
@@ -46,7 +51,7 @@ public class GSPScriptEngineFactory exte
     }
 
     public ScriptEngine getScriptEngine() {
-        return new GSPScriptEngine(this);
+        return new GSPScriptEngine(this, dynamicClassLoaderManager.getDynamicClassLoader());
     }
 
 }



Mime
View raw message