You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:03:34 UTC

[sling-org-apache-sling-scripting-java] annotated tag org.apache.sling.scripting.java-1.0.0 created (now 4e060de)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git.


      at 4e060de  (tag)
 tagging 22d8eb1de6ade9641ed97764dcdf041e21bdcd64 (commit)
      by Carsten Ziegeler
      on Thu Nov 26 15:56:04 2009 +0000

- Log -----------------------------------------------------------------
org.apache.sling.scripting.java-1.0.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new b709f59  SLING-619 Add a scripting engine for java servlets.
     new 72382c3  Add descriptions for the configuration, fix type in config and add missing licence and notice files.
     new bc49398  SLING-619 - add README.txt with info on how to test this bundle
     new cbbc933  svn:ignore Eclipse files
     new c6be7e3  SLING-808 : Increase version to 5-incubator-SNAPSHOT
     new 3536bde  Update notice files to include 2009 in copyright statement.
     new 3574a99  SLING-829 Cosmetics to the bundle/project names
     new f6e4fab  SLING-829 Ensure Apache Sling prefix on all configuration names
     new b12c7b4  SLING-825 : Return the resource name as source file name.
     new 925cb36  SLING-865 : Move to bundles
     new 1c32a95  SLING-865 : Move to contrib
     new 8da570b  SLING-865 : Adjust reactor pom and svn information in each module.
     new c42dbbb  SLING-865 : Adjust path to parent pom and add profiles for samples and contrib
     new 202f6f3  Use release parent pom
     new dbb6ae9  Use new dev parent pom for contrib.
     new f85a876  Set parent pom to released version.
     new 2cf48b5  Move Sling to new TLP location
     new 2e639e2  SLING-1011 : Remove disclaimer file.
     new 73f8ccd  SLING-1011 : Adjust svn location
     new 3a4b8e1  SLING-1011 : Remove disclaimer from readme's, adjust links to webite, fix versions in poms.
     new 758a535  SLING-1033 Upgrade to Sling parent POM 6 (and ensure web app has the leglize stuff, too)
     new dda6e2f  Don't wrap Sling exception.
     new 04c964c  Correctly set version to 0.9.0
     new e815996  Improve exception messages.
     new 025f546  Do not silently swallow exception
     new d55d8f0  SLING-1050 : Use dynamic class loader instead of dynamic import package.
     new beb532d  Use new class loader writer.
     new 16c4505  Store script resource resolver in script context, return script resource with request resource resolver.
     new af551b1  Correct dependency
     new 76f52ae  SLING-1021 - Use the global scope for the script resource resolver to avoid having this in the bindings for the script.
     new 04fbce0  SLING-1021 : Use own sling scope to store private attributes.
     new 5445803  Use latest Sling API release.
     new 346e33c  Fix wrong org.apache.sling.commons.classloader version number
     new 07ac4e7  Update to latest Sling releases.
     new d4de31f  Update to latest release.
     new 7a1a68b  Use latest parent pom.
     new f8ca64a  [maven-release-plugin] prepare release org.apache.sling.scripting.java-1.0.0
     new 0365ac5  [maven-scm] copy for tag org.apache.sling.scripting.java-1.0.0
     new 7ea3c6f  [maven-release-plugin] prepare for next development iteration
     new 45524e5  [maven-release-plugin] prepare release org.apache.sling.scripting.java-1.0.0
     new 22d8eb1  [maven-scm] copy for tag org.apache.sling.scripting.java-1.0.0

The 41 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-scripting-java] 38/41: [maven-scm] copy for tag org.apache.sling.scripting.java-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 0365ac58db99836c6b846c31a4afc612332a3cb8
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Nov 26 15:46:43 2009 +0000

    [maven-scm] copy for tag org.apache.sling.scripting.java-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0@884605 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 15/41: Use new dev parent pom for contrib.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit dbb6ae9031fd382e1b4c9746bd4ee235b342b068
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 5 15:08:36 2009 +0000

    Use new dev parent pom for contrib.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java@771769 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index bccda65..6dfb75b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>5-incubator</version>
+        <version>6-incubator-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 26/41: SLING-1050 : Use dynamic class loader instead of dynamic import package.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit d55d8f0f8727a3fa4c63e9eb20c513e7a6e403a3
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 16 07:18:17 2009 +0000

    SLING-1050 : Use dynamic class loader instead of dynamic import package.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@794562 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  5 ++-
 .../scripting/java/JavaScriptEngineFactory.java    | 40 +++++++---------------
 .../sling/scripting/java/SlingIOProvider.java      | 27 ++-------------
 3 files changed, 16 insertions(+), 56 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2ef4995..4b5008a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,7 +60,6 @@
                             org.apache.sling.scripting.java.jdt,
                             org.eclipse.jdt.*
                         </Private-Package>
-                        <DynamicImport-Package>*</DynamicImport-Package>
 
                         <ScriptEngine-Name>${pom.name}</ScriptEngine-Name>
                         <ScriptEngine-Version>${pom.version}</ScriptEngine-Version>
@@ -106,8 +105,8 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.jcr.classloader</artifactId>
-            <version>2.0.2-incubator</version>
+            <artifactId>org.apache.sling.commons.classloader</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
 
      <!-- We use the same eclipse jdt as the jsp bundle -->
diff --git a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
index e50a78d..0425c08 100644
--- a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
@@ -20,7 +20,6 @@ import static org.apache.sling.api.scripting.SlingBindings.SLING;
 
 import java.io.Reader;
 
-import javax.jcr.RepositoryException;
 import javax.script.Bindings;
 import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
@@ -34,8 +33,7 @@ import org.apache.sling.api.SlingServletException;
 import org.apache.sling.api.scripting.SlingBindings;
 import org.apache.sling.api.scripting.SlingScript;
 import org.apache.sling.api.scripting.SlingScriptHelper;
-import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.jcr.classloader.RepositoryClassLoaderProvider;
+import org.apache.sling.commons.classloader.DynamicClassLoaderManager;
 import org.apache.sling.scripting.api.AbstractScriptEngineFactory;
 import org.apache.sling.scripting.api.AbstractSlingScriptEngine;
 import org.osgi.service.component.ComponentContext;
@@ -60,18 +58,13 @@ import org.slf4j.LoggerFactory;
  */
 public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
 
-    private static final String CLASSLOADER_NAME = "admin";
-
     /** default logger */
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    /** @scr.reference */
-    private SlingRepository repository;
-
     /**
      * @scr.reference
      */
-    private RepositoryClassLoaderProvider repoCLProvider;
+    private DynamicClassLoaderManager dynamicClassLoaderManager;
 
     /**
      * The class loader
@@ -127,7 +120,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
      * @param componentContext
      */
     protected void activate(ComponentContext componentContext) {
-        this.ioProvider = new SlingIOProvider(repository);
+        this.ioProvider = new SlingIOProvider();
         this.servletCache = new ServletCache();
 
         this.javaServletContext = new JavaServletContext(ioProvider,
@@ -166,7 +159,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
      */
     private void callServlet(Bindings bindings, SlingScriptHelper scriptHelper) {
 
-        ioProvider.setRequestResourceResolver(scriptHelper.getRequest().getResourceResolver());
+        ioProvider.setRequestResourceResolver(scriptHelper.getScript().getScriptResource().getResourceResolver());
         try {
             ServletWrapper servlet = getWrapperAdapter(scriptHelper);
             // create a SlingBindings object
@@ -206,7 +199,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
      * Bind the class load provider.
      * @param repositoryClassLoaderProvider the new provider
      */
-    protected void bindRepositoryClassLoaderProvider(RepositoryClassLoaderProvider rclp) {
+    protected void bindDynamicClassLoaderManager(DynamicClassLoaderManager rclp) {
         if ( this.javaClassLoader != null ) {
             this.ungetClassLoader();
         }
@@ -217,8 +210,8 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
      * Unbind the class loader provider.
      * @param repositoryClassLoaderProvider the old provider
      */
-    protected void unbindRepositoryClassLoaderProvider(RepositoryClassLoaderProvider rclp) {
-        if ( this.repoCLProvider == rclp ) {
+    protected void unbindDynamicClassLoaderManager(DynamicClassLoaderManager rclp) {
+        if ( this.dynamicClassLoaderManager == rclp ) {
             this.ungetClassLoader();
         }
     }
@@ -226,26 +219,17 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
     /**
      * Get the class loader
      */
-    private void getClassLoader(RepositoryClassLoaderProvider rclp) {
-        try {
-            this.repoCLProvider = rclp;
-            this.javaClassLoader = rclp.getClassLoader(CLASSLOADER_NAME);
-        } catch (RepositoryException re) {
-            log.error("Cannot get Java class loader", re);
-        }
+    private void getClassLoader(DynamicClassLoaderManager rclp) {
+        this.dynamicClassLoaderManager = rclp;
+        this.javaClassLoader = rclp.getDynamicClassLoader();
     }
 
     /**
      * Unget the class loader
      */
     private void ungetClassLoader() {
-        if ( this.repoCLProvider != null ) {
-            if ( this.javaClassLoader != null ) {
-                this.repoCLProvider.ungetClassLoader(this.javaClassLoader);
-                this.javaClassLoader = null;
-            }
-            this.repoCLProvider = null;
-        }
+        this.dynamicClassLoaderManager = null;
+        this.javaClassLoader = null;
     }
     // ---------- Internal -----------------------------------------------------
 
diff --git a/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java b/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
index 00e714a..34908ab 100644
--- a/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
+++ b/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
@@ -38,7 +38,6 @@ import org.apache.sling.api.SlingException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.jcr.api.SlingRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,17 +49,10 @@ public class SlingIOProvider  {
     /** default log */
     private static final Logger log = LoggerFactory.getLogger(SlingIOProvider.class);
 
-    private final SlingRepository repository;
-
     private ThreadLocal<ResourceResolver> requestResourceResolver;
 
-    // private session for write access
-    private ThreadLocal<Session> privateSession;
-
-    SlingIOProvider(SlingRepository repository) {
-        this.repository = repository;
+    SlingIOProvider() {
         this.requestResourceResolver = new ThreadLocal<ResourceResolver>();
-        this.privateSession = new ThreadLocal<Session>();
     }
 
     void setRequestResourceResolver(ResourceResolver resolver) {
@@ -69,15 +61,6 @@ public class SlingIOProvider  {
 
     void resetRequestResourceResolver() {
         requestResourceResolver.remove();
-
-        // at the same time logout this thread's session
-        Session session = privateSession.get();
-        if (session != null) {
-            if (session.isLive()) {
-                session.logout();
-            }
-            privateSession.remove();
-        }
     }
 
     // ---------- IOProvider interface -----------------------------------------
@@ -210,13 +193,7 @@ public class SlingIOProvider  {
     // ---------- internal -----------------------------------------------------
 
     private Session getPrivateSession() throws RepositoryException {
-        Session session = privateSession.get();
-        if (session == null) {
-            session = repository.loginAdministrative(null);
-            privateSession.set(session);
-        }
-
-        return session;
+        return requestResourceResolver.get().adaptTo(Session.class);
     }
 
     private static void checkNode(Node node, String path) {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 41/41: [maven-scm] copy for tag org.apache.sling.scripting.java-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 22d8eb1de6ade9641ed97764dcdf041e21bdcd64
Merge: 0365ac5 45524e5
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Nov 26 15:56:04 2009 +0000

    [maven-scm] copy for tag org.apache.sling.scripting.java-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0@884610 13f79535-47bb-0310-9956-ffa450edef68

 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 22/41: Don't wrap Sling exception.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit dda6e2f43598bc66c5fa304b97bb3af62f0d7850
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 7 07:47:30 2009 +0000

    Don't wrap Sling exception.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@791738 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/scripting/java/ServletWrapper.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java b/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
index a052c8b..9d0a59d 100644
--- a/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
+++ b/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
@@ -217,6 +217,8 @@ public class ServletWrapper {
                 logger.error("Java servlet source not found." +
                        ex.getMessage(), ex);
             }
+        } catch (SlingException ex) {
+            throw ex;
         } catch (ServletException ex) {
             throw ex;
         } catch (IOException ex) {
@@ -252,6 +254,8 @@ public class ServletWrapper {
             response.sendError
                 (HttpServletResponse.SC_SERVICE_UNAVAILABLE,
                  ex.getMessage());
+        } catch (SlingException ex) {
+            throw ex;
         } catch (ServletException ex) {
             throw ex;
         } catch (IOException ex) {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 39/41: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 7ea3c6fb089409337dded4e4e2156daf0e8cf1bf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Nov 26 15:47:02 2009 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@884606 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index e65a1e3..15fafff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.scripting.java</artifactId>
-    <version>1.0.0</version>
+    <version>1.0.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Scripting Java Support</name>
     <description>Support for scripting Java</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.scripting.java-1.0.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 28/41: Store script resource resolver in script context, return script resource with request resource resolver.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 16c4505d5ca470f69cdb56e55a60ff09a0527b9d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 17 11:48:35 2009 +0000

    Store script resource resolver in script context, return script resource with request resource resolver.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@795055 13f79535-47bb-0310-9956-ffa450edef68
---
 .../scripting/java/JavaScriptEngineFactory.java    | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
index c0f6e38..698937c 100644
--- a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
@@ -30,8 +30,10 @@ import javax.servlet.ServletContext;
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.SlingIOException;
 import org.apache.sling.api.SlingServletException;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.scripting.SlingBindings;
 import org.apache.sling.api.scripting.SlingScript;
+import org.apache.sling.api.scripting.SlingScriptConstants;
 import org.apache.sling.api.scripting.SlingScriptHelper;
 import org.apache.sling.commons.classloader.ClassLoaderWriter;
 import org.apache.sling.commons.classloader.DynamicClassLoaderManager;
@@ -156,16 +158,24 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
 
     /**
      * Call the servlet.
-     * @param scriptHelper
+     * @param binding The bindings for the script invocation
+     * @param scriptHelper The script helper.
+     * @param context The script context.
      * @throws SlingServletException
      * @throws SlingIOException
      */
     @SuppressWarnings("unchecked")
-    private void callServlet(Bindings bindings, SlingScriptHelper scriptHelper) {
-
-        ioProvider.setRequestResourceResolver(scriptHelper.getScript().getScriptResource().getResourceResolver());
+    private void callServlet(final Bindings bindings,
+                             final SlingScriptHelper scriptHelper,
+                             final ScriptContext context) {
+        ResourceResolver resolver = (ResourceResolver) context.getAttribute(SlingScriptConstants.ATTR_SCRIPT_RESOURCE_RESOLVER,
+                ScriptContext.ENGINE_SCOPE);
+        if ( resolver == null ) {
+            resolver = scriptHelper.getScript().getScriptResource().getResourceResolver();
+        }
+        ioProvider.setRequestResourceResolver(resolver);
         try {
-            ServletWrapper servlet = getWrapperAdapter(scriptHelper);
+            final ServletWrapper servlet = getWrapperAdapter(scriptHelper);
             // create a SlingBindings object
             final SlingBindings slingBindings = new SlingBindings();
             slingBindings.putAll(bindings);
@@ -251,7 +261,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
             final Bindings props = context.getBindings(ScriptContext.ENGINE_SCOPE);
             final SlingScriptHelper scriptHelper = (SlingScriptHelper) props.get(SLING);
             if (scriptHelper != null) {
-                ((JavaScriptEngineFactory)this.getFactory()).callServlet(props, scriptHelper);
+                ((JavaScriptEngineFactory)this.getFactory()).callServlet(props, scriptHelper, context);
             }
             return null;
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 05/41: SLING-808 : Increase version to 5-incubator-SNAPSHOT

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit c6be7e382a021cb5145e7af27b5378ec50fbc955
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jan 5 11:07:35 2009 +0000

    SLING-808 : Increase version to 5-incubator-SNAPSHOT
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@731526 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c2894dd..98a3969 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>4-incubator-SNAPSHOT</version>
+        <version>5-incubator-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 16/41: Set parent pom to released version.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit f85a87690e2b83cc712c301c53ae37d4156af4d7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu May 14 14:49:51 2009 +0000

    Set parent pom to released version.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java@774798 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 6dfb75b..bccda65 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>6-incubator-SNAPSHOT</version>
+        <version>5-incubator</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 33/41: Fix wrong org.apache.sling.commons.classloader version number

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 346e33c4d16b5904ebf8432761491be5a5fc3192
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Oct 5 20:44:10 2009 +0000

    Fix wrong org.apache.sling.commons.classloader version number
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@822000 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 21e01c7..bfbaed1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,7 +101,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.classloader</artifactId>
-            <version>0.9.0-SNAPSHOT</version>
+            <version>0.9.1-SNAPSHOT</version>
         </dependency>
 
      <!-- We use the same eclipse jdt as the jsp bundle -->

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 37/41: [maven-release-plugin] prepare release org.apache.sling.scripting.java-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit f8ca64aa8b46014264d0e2fd84d2c7df930f4c65
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Nov 26 15:46:11 2009 +0000

    [maven-release-plugin] prepare release org.apache.sling.scripting.java-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@884604 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4ff986a..e65a1e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.scripting.java</artifactId>
-    <version>0.9.0-SNAPSHOT</version>
+    <version>1.0.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Scripting Java Support</name>
     <description>Support for scripting Java</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.scripting.java-1.0.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 10/41: SLING-865 : Move to bundles

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 925cb36984426219366ee2fa96b112330c3dfd79
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Feb 22 13:45:12 2009 +0000

    SLING-865 : Move to bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/scripting/java@746681 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 29/41: Correct dependency

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit af551b1edf0cadc4b516a0b23c2ab59eaf576f3b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 17 12:01:41 2009 +0000

    Correct dependency
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@795058 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 744f786..9f61994 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.2-incubator</version>
+            <version>2.0.5-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 13/41: SLING-865 : Adjust path to parent pom and add profiles for samples and contrib

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit c42dbbb23ab6a28ac6ced8dad2cae590fc9c66c7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Feb 22 15:19:05 2009 +0000

    SLING-865 : Adjust path to parent pom and add profiles for samples and contrib
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java@746728 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2a6ff7c..b2f75d7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>5-incubator-SNAPSHOT</version>
-        <relativePath>../../parent/pom.xml</relativePath>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
     <artifactId>org.apache.sling.scripting.java</artifactId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 18/41: SLING-1011 : Remove disclaimer file.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 2e639e24a22d6b96436f89e5921ffb48210591a4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jun 18 09:57:04 2009 +0000

    SLING-1011 : Remove disclaimer file.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@785993 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/resources/META-INF/DISCLAIMER | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/main/resources/META-INF/DISCLAIMER b/src/main/resources/META-INF/DISCLAIMER
deleted file mode 100644
index 90850c2..0000000
--- a/src/main/resources/META-INF/DISCLAIMER
+++ /dev/null
@@ -1,7 +0,0 @@
-Apache Sling is an effort undergoing incubation at The Apache Software Foundation (ASF),
-sponsored by the Apache Jackrabbit PMC. Incubation is required of all newly accepted
-projects until a further review indicates that the infrastructure, communications,
-and decision making process have stabilized in a manner consistent with other
-successful ASF projects. While incubation status is not necessarily a reflection of
-the completeness or stability of the code, it does indicate that the project has yet
-to be fully endorsed by the ASF.
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 21/41: SLING-1033 Upgrade to Sling parent POM 6 (and ensure web app has the leglize stuff, too)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 758a535244a6d4d067d6bfe428152ef642becd5b
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Sun Jul 5 11:27:40 2009 +0000

    SLING-1033 Upgrade to Sling parent POM 6 (and ensure web app has the leglize stuff, too)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@791223 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 04bb66b..77200e0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>5-incubator</version>
+        <version>6</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 27/41: Use new class loader writer.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit beb532d941f087ad30e1d86f8851ed118581ecf5
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 17 06:18:00 2009 +0000

    Use new class loader writer.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@794979 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   5 -
 .../sling/scripting/java/CompilationContext.java   |   4 +-
 .../scripting/java/JavaScriptEngineFactory.java    |   8 +-
 .../org/apache/sling/scripting/java/Options.java   |   8 +-
 .../sling/scripting/java/ServletWrapper.java       |   2 +-
 .../sling/scripting/java/SlingIOProvider.java      | 193 ++-------------------
 .../OSGI-INF/metatype/metatype.properties          |   5 -
 7 files changed, 24 insertions(+), 201 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4b5008a..744f786 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,11 +100,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.jcr.api</artifactId>
-            <version>2.0.2-incubator</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.classloader</artifactId>
             <version>0.9.0-SNAPSHOT</version>
         </dependency>
diff --git a/src/main/java/org/apache/sling/scripting/java/CompilationContext.java b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
index 2de7af7..89af03d 100644
--- a/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
+++ b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
@@ -55,7 +55,7 @@ public class CompilationContext {
     private long lastModificationTest = 0L;
     private int removed = 0;
 
-    private Class servletClass;
+    private Class<?> servletClass;
 
     private final ServletWrapper wrapper;
 
@@ -194,7 +194,7 @@ public class CompilationContext {
     /**
      * Load the class.
      */
-    public Class load()
+    public Class<?> load()
     throws ServletException, FileNotFoundException {
         final String name = this.getClassFilePath().substring(1).replace('/', '.');
         try {
diff --git a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
index 0425c08..c0f6e38 100644
--- a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
@@ -33,6 +33,7 @@ import org.apache.sling.api.SlingServletException;
 import org.apache.sling.api.scripting.SlingBindings;
 import org.apache.sling.api.scripting.SlingScript;
 import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.commons.classloader.ClassLoaderWriter;
 import org.apache.sling.commons.classloader.DynamicClassLoaderManager;
 import org.apache.sling.scripting.api.AbstractScriptEngineFactory;
 import org.apache.sling.scripting.api.AbstractSlingScriptEngine;
@@ -52,7 +53,6 @@ import org.slf4j.LoggerFactory;
  * @scr.property name="java.compilerSourceVM" value="1.5"
  * @scr.property name="java.compilerTargetVM" value="1.5"
  * @scr.property name="java.development" value="true"
- * @scr.property name="java.outputPath" value="/var/classes"
  * @scr.property name="java.modificationTestInterval" value="-1"
  * @scr.property name="java.classdebuginfo" value="true"
  */
@@ -74,6 +74,9 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
     /** @scr.reference */
     private ServletContext slingServletContext;
 
+    /** @scr.reference */
+    private ClassLoaderWriter classLoaderWriter;
+
     private SlingIOProvider ioProvider;
 
     private JavaServletContext javaServletContext;
@@ -120,7 +123,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
      * @param componentContext
      */
     protected void activate(ComponentContext componentContext) {
-        this.ioProvider = new SlingIOProvider();
+        this.ioProvider = new SlingIOProvider(this.classLoaderWriter);
         this.servletCache = new ServletCache();
 
         this.javaServletContext = new JavaServletContext(ioProvider,
@@ -157,6 +160,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
      * @throws SlingServletException
      * @throws SlingIOException
      */
+    @SuppressWarnings("unchecked")
     private void callServlet(Bindings bindings, SlingScriptHelper scriptHelper) {
 
         ioProvider.setRequestResourceResolver(scriptHelper.getScript().getScriptResource().getResourceResolver());
diff --git a/src/main/java/org/apache/sling/scripting/java/Options.java b/src/main/java/org/apache/sling/scripting/java/Options.java
index bc445ac..375c348 100644
--- a/src/main/java/org/apache/sling/scripting/java/Options.java
+++ b/src/main/java/org/apache/sling/scripting/java/Options.java
@@ -36,8 +36,6 @@ public class Options {
 
     private static final String PROPERTY_DEVELOPMENT = "development";
 
-    private static final String PROPERTY_OUTPUT_PATH = "outputPath";
-
     private static final String PROPERTY_MODIFICATION_TEST_INTERVAL = "modificationTestInterval";
 
     private static final String PROPERTY_CLASSDEBUGINFO = "classdebuginfo";
@@ -80,8 +78,6 @@ public class Options {
      */
     private final ClassLoader classLoader;
 
-    private final String destinationDir;
-
     /**
      * Create an compiler options object using data available from
      * the component configuration.
@@ -100,7 +96,6 @@ public class Options {
         properties.put(PROPERTY_COMPILER_TARGET_V_M, DEFAULT_VM_VERSION);
         properties.put(PROPERTY_COMPILER_SOURCE_V_M, DEFAULT_VM_VERSION);
         properties.put(PROPERTY_JAVA_ENCODING, "UTF-8");
-        properties.put(PROPERTY_OUTPUT_PATH, "/var/classes");
 
         // now check component properties
         Dictionary<?, ?> config = componentContext.getProperties();
@@ -116,7 +111,6 @@ public class Options {
             }
         }
 
-        this.destinationDir = properties.get(PROPERTY_OUTPUT_PATH).toString();
         this.classDebugInfo = Boolean.valueOf(properties.get(PROPERTY_CLASSDEBUGINFO).toString());
         this.modificationTestInterval = Integer.valueOf(properties.get(PROPERTY_MODIFICATION_TEST_INTERVAL).toString());
         this.development = Boolean.valueOf(properties.get(PROPERTY_DEVELOPMENT).toString());
@@ -129,7 +123,7 @@ public class Options {
      * Return the destination directory.
      */
     public String getDestinationPath() {
-        return this.destinationDir;
+        return ":";
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java b/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
index 9d0a59d..4d948f5 100644
--- a/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
+++ b/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
@@ -102,7 +102,7 @@ public class ServletWrapper {
                     Servlet servlet = null;
 
                     try {
-                        final Class servletClass = ctxt.load();
+                        final Class<?> servletClass = ctxt.load();
                         servlet = (Servlet) servletClass.newInstance();
                     } catch (IllegalAccessException e) {
                         throw new ServletException(e);
diff --git a/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java b/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
index 34908ab..4e07e44 100644
--- a/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
+++ b/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
@@ -16,8 +16,6 @@
  */
 package org.apache.sling.scripting.java;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -27,32 +25,30 @@ import java.net.URL;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
-import java.util.StringTokenizer;
-
-import javax.jcr.Item;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
 
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.commons.classloader.ClassLoaderWriter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * The <code>SlingIOProvider</code> TODO
+ * The <code>SlingIOProvider</code>
  */
 public class SlingIOProvider  {
 
     /** default log */
-    private static final Logger log = LoggerFactory.getLogger(SlingIOProvider.class);
+    private final Logger log = LoggerFactory.getLogger(SlingIOProvider.class);
 
     private ThreadLocal<ResourceResolver> requestResourceResolver;
 
-    SlingIOProvider() {
+    private final ClassLoaderWriter classLoaderWriter;
+
+    SlingIOProvider(final ClassLoaderWriter classLoaderWriter) {
         this.requestResourceResolver = new ThreadLocal<ResourceResolver>();
+        this.classLoaderWriter = classLoaderWriter;
     }
 
     void setRequestResourceResolver(ResourceResolver resolver) {
@@ -72,7 +68,9 @@ public class SlingIOProvider  {
      */
     public InputStream getInputStream(String fileName)
     throws FileNotFoundException, IOException {
-
+        if ( fileName.startsWith(":") ) {
+            return this.classLoaderWriter.getInputStream(fileName.substring(1));
+        }
         try {
 
             Resource resource = getResourceInternal(fileName);
@@ -100,6 +98,9 @@ public class SlingIOProvider  {
      * returned.
      */
     public long lastModified(String fileName) {
+        if ( fileName.startsWith(":") ) {
+            return this.classLoaderWriter.getLastModified(fileName.substring(1));
+        }
         try {
             Resource resource = getResourceInternal(fileName);
             if (resource != null) {
@@ -117,36 +118,10 @@ public class SlingIOProvider  {
     }
 
     /**
-     * Removes the named item from the repository.
-     */
-    public boolean delete(String fileName) {
-        Node parentNode = null;
-        try {
-            fileName = cleanPath(fileName);
-            Session session = getPrivateSession();
-            if (session.itemExists(fileName)) {
-                Item fileItem = session.getItem(fileName);
-                parentNode = fileItem.getParent();
-                fileItem.remove();
-                parentNode.save();
-                return true;
-            }
-        } catch (RepositoryException re) {
-            log.error("Cannot remove " + fileName, re);
-        } finally {
-            checkNode(parentNode, fileName);
-        }
-
-        // fall back to false if item does not exist or in case of error
-        return false;
-    }
-
-    /**
      * Returns an output stream to write to the repository.
      */
     public OutputStream getOutputStream(String fileName) {
-        fileName = cleanPath(fileName);
-        return new RepositoryOutputStream(this, fileName);
+        return this.classLoaderWriter.getOutputStream(fileName.substring(1));
     }
 
     /* package */URL getURL(String path) throws MalformedURLException {
@@ -192,21 +167,6 @@ public class SlingIOProvider  {
 
     // ---------- internal -----------------------------------------------------
 
-    private Session getPrivateSession() throws RepositoryException {
-        return requestResourceResolver.get().adaptTo(Session.class);
-    }
-
-    private static void checkNode(Node node, String path) {
-        if (node != null && node.isModified()) {
-            try {
-                node.refresh(false);
-            } catch (RepositoryException re) {
-                log.error("Cannot refresh node for " + path
-                    + " after failed save", re);
-            }
-        }
-    }
-
     private String cleanPath(String path) {
         // replace backslash by slash
         path = path.replace('\\', '/');
@@ -218,129 +178,4 @@ public class SlingIOProvider  {
 
         return path;
     }
-
-    private static class RepositoryOutputStream extends ByteArrayOutputStream {
-
-        private final SlingIOProvider repositoryOutputProvider;
-
-        private final String fileName;
-
-        RepositoryOutputStream(SlingIOProvider repositoryOutputProvider,
-                String fileName) {
-            this.repositoryOutputProvider = repositoryOutputProvider;
-            this.fileName = fileName;
-        }
-
-        public void close() throws IOException {
-            super.close();
-
-            Node parentNode = null;
-            try {
-                Session session = repositoryOutputProvider.getPrivateSession();
-                Node fileNode = null;
-                Node contentNode = null;
-                if (session.itemExists(fileName)) {
-                    Item item = session.getItem(fileName);
-                    if (item.isNode()) {
-                        Node node = item.isNode()
-                                ? (Node) item
-                                : item.getParent();
-                        if ("jcr:content".equals(node.getName())) {
-                            // replace the content properties of the jcr:content
-                            // node
-                            parentNode = node;
-                            contentNode = node;
-                        } else if (node.isNodeType("nt:file")) {
-                            // try to set the content properties of jcr:content
-                            // node
-                            parentNode = node;
-                            contentNode = node.getNode("jcr:content");
-                        } else { // fileName is a node
-                            // try to set the content properties of the node
-                            parentNode = node;
-                            contentNode = node;
-                        }
-                    } else {
-                        // replace property with an nt:file node (if possible)
-                        parentNode = item.getParent();
-                        String name = item.getName();
-                        fileNode = parentNode.addNode(name, "nt:file");
-                        item.remove();
-                    }
-                } else {
-                    fileNode = createPath(fileName, "nt:folder", "nt:file", session);
-                    parentNode = session.getRootNode();
-                }
-
-                // if we have a file node, create the contentNode
-                if (fileNode != null) {
-                    contentNode = fileNode.addNode("jcr:content", "nt:resource");
-                }
-
-                contentNode.setProperty("jcr:lastModified",
-                    System.currentTimeMillis());
-                contentNode.setProperty("jcr:data", new ByteArrayInputStream(
-                    buf, 0, size()));
-                contentNode.setProperty("jcr:mimeType",
-                    "application/octet-stream");
-
-                parentNode.save();
-            } catch (RepositoryException re) {
-                log.error("Cannot write file " + fileName, re);
-                throw new IOException("Cannot write file " + fileName
-                    + ", reason: " + re.toString());
-            } finally {
-                checkNode(parentNode, fileName);
-            }
-        }
-    }
-
-    /**
-     * Creates or gets the {@link javax.jcr.Node Node} at the given Path.
-     * In case it has to create the Node all non-existent intermediate path-elements
-     * will be create with the given intermediate node type and the returned node
-     * will be created with the given nodeType
-     *
-     * @param path to create
-     * @param intermediateNodeType to use for creation of intermediate nodes
-     * @param nodeType to use for creation of the final node
-     * @param session to use
-     * @return the Node at path
-     * @throws RepositoryException in case of exception accessing the Repository
-     */
-    private static Node createPath(String path,
-                                  String intermediateNodeType,
-                                  String nodeType,
-                                  Session session)
-            throws RepositoryException {
-        if (path == null || path.length() == 0 || "/".equals(path)) {
-            return session.getRootNode();
-        } else if (!session.itemExists(path)) {
-            Node node = session.getRootNode();
-            path = path.substring(1);
-            int pos = path.lastIndexOf('/');
-            if ( pos != -1 ) {
-                final StringTokenizer st = new StringTokenizer(path.substring(0, pos), "/");
-                while ( st.hasMoreTokens() ) {
-                    final String token = st.nextToken();
-                    if ( !node.hasNode(token) ) {
-                        try {
-                            node.addNode(token, intermediateNodeType);
-                        } catch (RepositoryException re) {
-                            // we ignore this as this folder might be created from a different task
-                            node.refresh(false);
-                        }
-                    }
-                    node = node.getNode(token);
-                }
-                path = path.substring(pos + 1);
-            }
-            if ( !node.hasNode(path) ) {
-                node.addNode(path, nodeType);
-            }
-            return node.getNode(path);
-        } else {
-            return (Node) session.getItem(path);
-        }
-    }
 }
diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties b/src/main/resources/OSGI-INF/metatype/metatype.properties
index 666d78f..c6e2467 100644
--- a/src/main/resources/OSGI-INF/metatype/metatype.properties
+++ b/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -51,8 +51,3 @@ java.compilerSourceVM.description = Java Specification to be used to read \
 java.compilerTargetVM.name = Target VM
 java.compilerTargetVM.description = Java Specification to be used to generate \
  the compiled output.
-
-java.outputPath.name = Compilation Location
-java.outputPath.description = What directory should we use when \
- compiling Java files? Default is /var/classes.
- 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 12/41: SLING-865 : Adjust reactor pom and svn information in each module.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 8da570b77e99741c69485211b9ff575505534f47
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Feb 22 14:22:36 2009 +0000

    SLING-865 : Adjust reactor pom and svn information in each module.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java@746707 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4ed4b7c..2a6ff7c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,9 +35,9 @@
     <description>Support for scripting Java</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java</developerConnection>
-        <url>http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/java</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java</developerConnection>
+        <url>http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/java</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 01/41: SLING-619 Add a scripting engine for java servlets.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit b709f596557bf0799f3220c7bb761a95ca57da5d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Aug 20 15:22:10 2008 +0000

    SLING-619 Add a scripting engine for java servlets.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@687373 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 139 ++++++++
 .../sling/scripting/java/CompilationContext.java   | 232 +++++++++++++
 .../apache/sling/scripting/java/CompilerError.java | 161 +++++++++
 .../apache/sling/scripting/java/CompilerUtil.java  | 129 +++++++
 .../scripting/java/JavaScriptEngineFactory.java    | 271 +++++++++++++++
 .../sling/scripting/java/JavaServletConfig.java    |  94 ++++++
 .../sling/scripting/java/JavaServletContext.java   | 285 ++++++++++++++++
 .../org/apache/sling/scripting/java/Options.java   | 177 ++++++++++
 .../apache/sling/scripting/java/ServletCache.java  |  72 ++++
 .../sling/scripting/java/ServletWrapper.java       | 275 +++++++++++++++
 .../sling/scripting/java/SlingIOProvider.java      | 369 +++++++++++++++++++++
 .../sling/scripting/java/jdt/CompilationUnit.java  | 282 ++++++++++++++++
 .../scripting/java/jdt/EclipseJavaCompiler.java    | 118 +++++++
 13 files changed, 2604 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..c2894dd
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>4-incubator-SNAPSHOT</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>org.apache.sling.scripting.java</artifactId>
+    <version>2.0.0-incubator-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Sling - Scripting - Java Support</name>
+    <description>Support for scripting Java</description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java</developerConnection>
+        <url>http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/java</url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Import-Package>
+                            !org.eclipse.*, *
+                        </Import-Package>
+                        <Private-Package>
+                            org.apache.sling.scripting.java,
+                            org.apache.sling.scripting.java.jdt,
+                            org.eclipse.jdt.*
+                        </Private-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+
+                        <ScriptEngine-Name>${pom.name}</ScriptEngine-Name>
+                        <ScriptEngine-Version>${pom.version}</ScriptEngine-Version>
+
+                        <Embed-Dependency>
+                            jasper*
+                        </Embed-Dependency>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                  <!-- No javadocs -->
+                    <excludePackageNames>
+                        org.apache.sling.scripting
+                    </excludePackageNames>
+                </configuration>
+            </plugin>
+        </plugins>
+    </reporting>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.0.2-incubator</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.api</artifactId>
+            <version>2.0.2-incubator</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.api</artifactId>
+            <version>2.0.2-incubator</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.classloader</artifactId>
+            <version>2.0.2-incubator</version>
+        </dependency>
+
+     <!-- We use the same eclipse jdt as the jsp bundle -->
+        <dependency>
+            <groupId>org.apache.tomcat</groupId>
+            <artifactId>jasper-jdt</artifactId>
+            <version>6.0.18</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/scripting/java/CompilationContext.java b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
new file mode 100644
index 0000000..8c5e41b
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java;
+
+import java.io.FileNotFoundException;
+import java.util.List;
+
+import javax.servlet.ServletException;
+
+import org.apache.sling.scripting.java.jdt.EclipseJavaCompiler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ */
+public class CompilationContext {
+
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    /** The name of the generated class. */
+    private final String className;
+
+    /** The path to the servlet. */
+    private final String sourcePath;
+
+    /** The mapped path. */
+    private final String mappedSourcePath;
+
+    /** Compilation options. */
+    private final Options options;
+
+    /** The compiler instance. */
+    private final EclipseJavaCompiler compiler;
+
+    /** Sling IO Provider. */
+    private final SlingIOProvider ioProvider;
+
+    private ServletCache servletCache;
+
+    private long lastModificationTest = 0L;
+    private int removed = 0;
+
+    private Class servletClass;
+
+    private final ServletWrapper wrapper;
+
+    /**
+     * A new compilation context.
+     * @param sourcePath The path to the servlet source.
+     * @param options The compiler options
+     * @param provider The Sling IO Provider
+     * @param servletCache
+     */
+    public CompilationContext(final String sourcePath,
+                              final Options options,
+                              final SlingIOProvider provider,
+                              ServletCache servletCache,
+                              final ServletWrapper wrapper) {
+        this.sourcePath = sourcePath;
+        this.mappedSourcePath = CompilerUtil.mapSourcePath(this.sourcePath);
+        this.className = CompilerUtil.makeClassPath(this.mappedSourcePath);
+
+        this.options = options;
+        this.ioProvider = provider;
+        this.compiler = new EclipseJavaCompiler(this);
+
+        this.servletCache = servletCache;
+        this.wrapper = wrapper;
+    }
+
+    /**
+     * Options
+     */
+    public Options getCompilerOptions() {
+        return options;
+    }
+
+    /**
+     * Provider
+     */
+    public SlingIOProvider getIOProvider() {
+        return this.ioProvider;
+    }
+
+    /**
+     * Return the path to the java servlet source file
+     * @return The source file path.
+     */
+    public String getSourcePath() {
+        return this.sourcePath;
+    }
+
+    public String getJavaClassName() {
+        return this.mappedSourcePath.replace('/', '.');
+    }
+
+    /**
+     * Return the path to the generated class file.
+     * @return The class file path.
+     */
+    public String getClassFilePath() {
+        return this.className;
+    }
+
+    public void incrementRemoved() {
+        if (removed == 0 && servletCache != null) {
+            servletCache.removeWrapper(sourcePath);
+        }
+        removed++;
+    }
+
+    public boolean isRemoved() {
+        if (removed > 1 ) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Check if the compiled class file is older than the source file
+     */
+    public boolean isOutDated() {
+        if (this.options.getModificationTestInterval() > 0) {
+
+            if (this.lastModificationTest
+                + (this.options.getModificationTestInterval() * 1000) > System.currentTimeMillis()) {
+                return false;
+            }
+            this.lastModificationTest = System.currentTimeMillis();
+        }
+
+        final long sourceLastModified = this.ioProvider.lastModified(getSourcePath());
+
+        final long targetLastModified = this.ioProvider.lastModified(getCompleteClassPath());
+        if (targetLastModified < 0) {
+            return true;
+        }
+
+        if (targetLastModified < sourceLastModified) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("Compiler: outdated: " + getClassFilePath() + " "
+                        + targetLastModified);
+            }
+            return true;
+        }
+
+        return false;
+
+    }
+
+    private String getCompleteClassPath() {
+        return options.getDestinationPath() + getClassFilePath() + ".class";
+    }
+
+    // ==================== Compile and reload ====================
+
+    public void compile() throws ServletException, FileNotFoundException {
+        if (this.isOutDated()) {
+            try {
+                final List<CompilerError> errors = this.compiler.compile();
+                if ( errors != null ) {
+                    //this.ioProvider.delete(getCompleteClassPath());
+                    throw CompilerException.create(errors);
+                }
+                this.wrapper.setReload(true);
+                this.wrapper.setCompilationException(null);
+            } catch (ServletException se) {
+                this.wrapper.setCompilationException(se);
+                throw se;
+            } catch (Exception ex) {
+                final ServletException se = new ServletException("Unable to compile servlet.", ex);
+                // Cache compilation exception
+                this.wrapper.setCompilationException(se);
+                throw se;
+            }
+        }
+    }
+
+    /**
+     * Load the class.
+     */
+    public Class load()
+    throws ServletException, FileNotFoundException {
+        try {
+            servletClass = this.options.getClassLoader().loadClass(this.getClassFilePath().substring(1).replace('/', '.'));
+        } catch (ClassNotFoundException cex) {
+            throw new ServletException("Unable to load servlet class.", cex);
+        } catch (Exception ex) {
+            throw new ServletException("Unable to compile servlet.", ex);
+        }
+        removed = 0;
+        return servletClass;
+    }
+
+    protected final static class CompilerException extends ServletException {
+
+        public static CompilerException create(List<CompilerError> errors) {
+            final StringBuffer buffer = new StringBuffer();
+            buffer.append("Compilation errors:\n");
+            for(final CompilerError e : errors) {
+                buffer.append(e.getFile());
+                buffer.append(", line ");
+                buffer.append(e.getStartLine());
+                buffer.append(", column ");
+                buffer.append(e.getStartColumn());
+                buffer.append(" : " );
+                buffer.append(e.getMessage());
+                buffer.append("\n");
+            }
+            return new CompilerException(buffer.toString());
+        }
+
+        public CompilerException(final String message) {
+           super(message);
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/CompilerError.java b/src/main/java/org/apache/sling/scripting/java/CompilerError.java
new file mode 100644
index 0000000..e29f67c
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/CompilerError.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java;
+
+/**
+ * This class encapsulates an error message produced by a programming language
+ * processor (whether interpreted or compiled)
+ * @version $Id$
+ * @since 2.0
+ */
+
+public class CompilerError {
+  /**
+   * Is this a severe error or a warning?
+   */
+  private boolean error;
+  /**
+   * The start line number of the offending program text
+   */
+  private int startline;
+  /**
+   * The start column number of the offending program text
+   */
+  private int startcolumn;
+  /**
+   * The end line number of the offending program text
+   */
+  private int endline;
+  /**
+   * The end column number of the offending program text
+   */
+  private int endcolumn;
+  /**
+   * The name of the file containing the offending program text
+   */
+  private String file;
+  /**
+   * The actual error text produced by the language processor
+   */
+  private String message;
+
+  /**
+   * The error message constructor.
+   *
+   * @param file The name of the file containing the offending program text
+   * @param error The actual error text produced by the language processor
+   * @param startline The start line number of the offending program text
+   * @param startcolumn The start column number of the offending program text
+   * @param endline The end line number of the offending program text
+   * @param endcolumn The end column number of the offending program text
+   * @param message The actual error text produced by the language processor
+   */
+  public CompilerError(
+    String file,
+    boolean error,
+    int startline,
+    int startcolumn,
+    int endline,
+    int endcolumn,
+    String message
+  )
+  {
+    this.file = file;
+    this.error = error;
+    this.startline = startline;
+    this.startcolumn = startcolumn;
+    this.endline = endline;
+    this.endcolumn = endcolumn;
+    this.message = message;
+  }
+
+  /**
+   * The error message constructor.
+   *
+   * @param message The actual error text produced by the language processor
+   */
+  public CompilerError(String message) {
+    this.message = message;
+  }
+
+  /**
+   * Return the filename associated with this compiler error.
+   *
+   * @return The filename associated with this compiler error
+   */
+  public String getFile() {
+    return file;
+  }
+
+  /**
+   * Assert whether this is a severe error or a warning
+   *
+   * @return Whether the error is severe
+   */
+  public boolean isError() {
+    return error;
+  }
+
+  /**
+   * Return the starting line number of the program text originating this error
+   *
+   * @return The starting line number of the program text originating this error
+   */
+  public int getStartLine() {
+    return startline;
+  }
+
+  /**
+   * Return the starting column number of the program text originating this
+   * error
+   *
+   * @return The starting column number of the program text originating this
+   * error
+   */
+  public int getStartColumn() {
+    return startcolumn;
+  }
+
+  /**
+   * Return the ending line number of the program text originating this error
+   *
+   * @return The ending line number of the program text originating this error
+   */
+  public int getEndLine() {
+    return endline;
+  }
+
+  /**
+   * Return the ending column number of the program text originating this
+   * error
+   *
+   * @return The ending column number of the program text originating this
+   * error
+   */
+  public int getEndColumn() {
+    return endcolumn;
+  }
+
+  /**
+   * Return the message produced by the language processor
+   *
+   * @return The message produced by the language processor
+   */
+  public String getMessage() {
+    return message;
+  }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java b/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java
new file mode 100644
index 0000000..d415ed7
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/CompilerUtil.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java;
+
+public class CompilerUtil {
+
+    /**
+     * The path has to be mapped to form a proper java class name.
+     * @param path
+     * @return The mapped source path.
+     */
+    public static String mapSourcePath(final String path) {
+        final String str;
+        if ( path.endsWith(".java") ) {
+            str = path.substring(0, path.length() - 5);
+        } else {
+            str = path;
+        }
+        final int pos = str.lastIndexOf("/");
+        if ( pos == -1 ) {
+            return makeJavaIdentifier(str);
+        }
+        return str.substring(0, pos + 1) + makeJavaIdentifier(str.substring(pos + 1));
+    }
+
+    /**
+     * Create the class name from the source name
+     * @param sourcePath The source path
+     * @return The corresponding class file path.
+     */
+    public static String makeClassPath(String sourcePath) {
+        String str = sourcePath;
+        if (str.endsWith(".java")) {
+            str = str.substring(0, str.length() - 5);
+        }
+        return str;
+    }
+
+
+    /**
+     * Converts the given identifier to a legal Java identifier
+     *
+     * @param identifier Identifier to convert
+     *
+     * @return Legal Java identifier corresponding to the given identifier
+     */
+    public static final String makeJavaIdentifier(String identifier) {
+        StringBuffer modifiedIdentifier =
+            new StringBuffer(identifier.length());
+        if (!Character.isJavaIdentifierStart(identifier.charAt(0))) {
+            modifiedIdentifier.append('_');
+        }
+        for (int i = 0; i < identifier.length(); i++) {
+            char ch = identifier.charAt(i);
+            if (Character.isJavaIdentifierPart(ch) && ch != '_') {
+                modifiedIdentifier.append(ch);
+            } else if (ch == '.') {
+                modifiedIdentifier.append('_');
+            } else {
+                modifiedIdentifier.append(mangleChar(ch));
+            }
+        }
+        if (isJavaKeyword(modifiedIdentifier.toString())) {
+            modifiedIdentifier.append('_');
+        }
+        return modifiedIdentifier.toString();
+    }
+
+    /**
+     * Mangle the specified character to create a legal Java class name.
+     */
+    public static final String mangleChar(char ch) {
+        char[] result = new char[5];
+        result[0] = '_';
+        result[1] = Character.forDigit((ch >> 12) & 0xf, 16);
+        result[2] = Character.forDigit((ch >> 8) & 0xf, 16);
+        result[3] = Character.forDigit((ch >> 4) & 0xf, 16);
+        result[4] = Character.forDigit(ch & 0xf, 16);
+        return new String(result);
+    }
+
+    private static final String javaKeywords[] = {
+        "abstract", "assert", "boolean", "break", "byte", "case",
+        "catch", "char", "class", "const", "continue",
+        "default", "do", "double", "else", "enum", "extends",
+        "final", "finally", "float", "for", "goto",
+        "if", "implements", "import", "instanceof", "int",
+        "interface", "long", "native", "new", "package",
+        "private", "protected", "public", "return", "short",
+        "static", "strictfp", "super", "switch", "synchronized",
+        "this", "throws", "transient", "try", "void",
+        "volatile", "while" };
+
+    /**
+     * Test whether the argument is a Java keyword
+     */
+    public static boolean isJavaKeyword(String key) {
+        int i = 0;
+        int j = javaKeywords.length;
+        while (i < j) {
+            int k = (i+j)/2;
+            int result = javaKeywords[k].compareTo(key);
+            if (result == 0) {
+                return true;
+            }
+            if (result < 0) {
+                i = k+1;
+            } else {
+                j = k;
+            }
+        }
+        return false;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
new file mode 100644
index 0000000..70190f2
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java;
+
+import static org.apache.sling.api.scripting.SlingBindings.SLING;
+
+import java.io.Reader;
+
+import javax.jcr.RepositoryException;
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+
+import org.apache.sling.api.SlingException;
+import org.apache.sling.api.SlingIOException;
+import org.apache.sling.api.SlingServletException;
+import org.apache.sling.api.scripting.SlingBindings;
+import org.apache.sling.api.scripting.SlingScript;
+import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.apache.sling.jcr.classloader.RepositoryClassLoaderProvider;
+import org.apache.sling.scripting.api.AbstractScriptEngineFactory;
+import org.apache.sling.scripting.api.AbstractSlingScriptEngine;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Java engine
+ *
+ * @scr.component label="%javahandler.name" description="%javahandler.description"
+ * @scr.property name="service.description" value="Java Servlet Script Handler"
+ * @scr.property name="service.vendor" value="The Apache Software Foundation"
+ * @scr.service
+ *
+ * @scr.property name="java.javaEncoding" value="UTF-8"
+ * @scr.property name="java.compilerSourceVM" value="1.5"
+ * @scr.property name="java.compilerTargetVM" value="1.5"
+ * @scr.property name="java.development" value="true"
+ * @scr.property name="java.outputPath" value="/var/classes"
+ * @scr.property name="java.modificationTestInterval" value="-1"
+ * @scr.property name="java.classdebuginfo" value="truie"
+ */
+public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
+
+    private static final String CLASSLOADER_NAME = "admin";
+
+    /** default logger */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    /** @scr.reference */
+    private SlingRepository repository;
+
+    /**
+     * @scr.reference
+     */
+    private RepositoryClassLoaderProvider repoCLProvider;
+
+    /**
+     * The class loader
+     */
+    private ClassLoader javaClassLoader;
+
+    /** @scr.reference */
+    private ServletContext slingServletContext;
+
+    private SlingIOProvider ioProvider;
+
+    private JavaServletContext javaServletContext;
+
+    private ServletConfig servletConfig;
+
+    private ServletCache servletCache;
+
+    /** Compiler options. */
+    private Options compilerOptions;
+
+    public static final String SCRIPT_TYPE = "java";
+
+    /**
+     * Constructor
+     */
+    public JavaScriptEngineFactory() {
+        setExtensions(SCRIPT_TYPE);
+    }
+
+    /**
+     * @see javax.script.ScriptEngineFactory#getScriptEngine()
+     */
+    public ScriptEngine getScriptEngine() {
+        return new JavaScriptEngine(this);
+    }
+
+    /**
+     * @see javax.script.ScriptEngineFactory#getLanguageName()
+     */
+    public String getLanguageName() {
+        return "Java Servlet Compiler";
+    }
+
+    /**
+     * @see javax.script.ScriptEngineFactory#getLanguageVersion()
+     */
+    public String getLanguageVersion() {
+        return "1.5";
+    }
+
+    /**
+     * Activate this engine
+     * @param componentContext
+     */
+    protected void activate(ComponentContext componentContext) {
+        this.ioProvider = new SlingIOProvider(repository);
+        this.servletCache = new ServletCache();
+
+        this.javaServletContext = new JavaServletContext(ioProvider,
+            slingServletContext);
+
+        this.servletConfig = new JavaServletConfig(javaServletContext,
+            componentContext.getProperties());
+        this.compilerOptions = new Options(componentContext,
+                                           this.javaClassLoader);
+        if (log.isDebugEnabled()) {
+            log.debug("JavaServletScriptEngine.activate()");
+        }
+    }
+
+    /**
+     * Deactivate this engine
+     * @param oldComponentContext
+     */
+    protected void deactivate(ComponentContext oldComponentContext) {
+        if (log.isDebugEnabled()) {
+            log.debug("JavaServletScriptEngine.deactivate()");
+        }
+
+        ioProvider = null;
+        javaServletContext = null;
+        servletConfig = null;
+        servletCache = null;
+        compilerOptions = null;
+    }
+
+    /**
+     * Call the servlet.
+     * @param scriptHelper
+     * @throws SlingServletException
+     * @throws SlingIOException
+     */
+    private void callServlet(Bindings bindings, SlingScriptHelper scriptHelper) {
+
+        ioProvider.setRequestResourceResolver(scriptHelper.getRequest().getResourceResolver());
+        try {
+            ServletWrapper servlet = getWrapperAdapter(scriptHelper);
+            // create a SlingBindings object
+            final SlingBindings slingBindings = new SlingBindings();
+            slingBindings.putAll(bindings);
+            servlet.service(slingBindings);
+        } finally {
+            ioProvider.resetRequestResourceResolver();
+        }
+    }
+
+    private ServletWrapper getWrapperAdapter(
+            SlingScriptHelper scriptHelper) throws SlingException {
+
+        SlingScript script = scriptHelper.getScript();
+        final String scriptName = script.getScriptResource().getPath();
+        ServletWrapper wrapper = this.servletCache.getWrapper(scriptName);
+        if (wrapper != null) {
+            return wrapper;
+        }
+
+        synchronized (this) {
+            wrapper = this.servletCache.getWrapper(scriptName);
+            if (wrapper != null) {
+                return wrapper;
+            }
+
+            wrapper = new ServletWrapper(servletConfig,
+                    this.compilerOptions, ioProvider, scriptName, this.servletCache);
+            this.servletCache.addWrapper(scriptName, wrapper);
+
+            return wrapper;
+        }
+    }
+
+    /**
+     * Bind the class load provider.
+     * @param repositoryClassLoaderProvider the new provider
+     */
+    protected void bindRepositoryClassLoaderProvider(RepositoryClassLoaderProvider rclp) {
+        if ( this.javaClassLoader != null ) {
+            this.ungetClassLoader();
+        }
+        this.getClassLoader(rclp);
+    }
+
+    /**
+     * Unbind the class loader provider.
+     * @param repositoryClassLoaderProvider the old provider
+     */
+    protected void unbindRepositoryClassLoaderProvider(RepositoryClassLoaderProvider rclp) {
+        if ( this.repoCLProvider == rclp ) {
+            this.ungetClassLoader();
+        }
+    }
+
+    /**
+     * Get the class loader
+     */
+    private void getClassLoader(RepositoryClassLoaderProvider rclp) {
+        try {
+            this.repoCLProvider = rclp;
+            this.javaClassLoader = rclp.getClassLoader(CLASSLOADER_NAME);
+        } catch (RepositoryException re) {
+            log.error("Cannot get Java class loader", re);
+        }
+    }
+
+    /**
+     * Unget the class loader
+     */
+    private void ungetClassLoader() {
+        if ( this.repoCLProvider != null ) {
+            if ( this.javaClassLoader != null ) {
+                this.repoCLProvider.ungetClassLoader(this.javaClassLoader);
+                this.javaClassLoader = null;
+            }
+            this.repoCLProvider = null;
+        }
+    }
+    // ---------- Internal -----------------------------------------------------
+
+    private static class JavaScriptEngine extends AbstractSlingScriptEngine {
+
+        JavaScriptEngine(JavaScriptEngineFactory factory) {
+            super(factory);
+        }
+
+        /**
+         * @see javax.script.ScriptEngine#eval(java.io.Reader, javax.script.ScriptContext)
+         */
+        public Object eval(Reader script, ScriptContext context)
+        throws ScriptException {
+            final Bindings props = context.getBindings(ScriptContext.ENGINE_SCOPE);
+            final SlingScriptHelper scriptHelper = (SlingScriptHelper) props.get(SLING);
+            if (scriptHelper != null) {
+                ((JavaScriptEngineFactory)this.getFactory()).callServlet(props, scriptHelper);
+            }
+            return null;
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/JavaServletConfig.java b/src/main/java/org/apache/sling/scripting/java/JavaServletConfig.java
new file mode 100644
index 0000000..48f305e
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/JavaServletConfig.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.scripting.java;
+
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+
+import org.osgi.framework.Constants;
+
+/**
+ * The <code>JavaServletConfig</code>
+ * is passed to the compiled servlets.
+ */
+public class JavaServletConfig implements ServletConfig {
+
+    /** The servlet context. */
+    private final ServletContext servletContext;
+
+    /** The name of the servlet. */
+    private final String servletName;
+
+    private final Map<String, String> initParams;
+
+    public JavaServletConfig(ServletContext servletContext, Dictionary<?, ?> config) {
+        this.servletContext = servletContext;
+
+        // set the servlet name
+        if (config.get(Constants.SERVICE_DESCRIPTION) == null) {
+            servletName = "Java Script Handler";
+        } else{
+            servletName = config.get(Constants.SERVICE_DESCRIPTION).toString();
+        }
+
+        // copy the "java." properties
+        initParams = new HashMap<String, String>();
+        for (Enumeration<?> ke = config.keys(); ke.hasMoreElements();) {
+            String key = (String) ke.nextElement();
+            if (key.startsWith("java.")) {
+                initParams.put(key.substring("java.".length()),
+                    String.valueOf(config.get(key)));
+            }
+        }
+    }
+
+    /**
+     * @see javax.servlet.ServletConfig#getInitParameter(java.lang.String)
+     */
+    public String getInitParameter(String name) {
+        return initParams.get(name);
+    }
+
+    /**
+     * @see javax.servlet.ServletConfig#getInitParameterNames()
+     */
+    public Enumeration<String> getInitParameterNames() {
+        return Collections.enumeration(initParams.keySet());
+    }
+
+    /**
+     * @see javax.servlet.ServletConfig#getServletContext()
+     */
+    public ServletContext getServletContext() {
+        return servletContext;
+    }
+
+    /**
+     * @see javax.servlet.ServletConfig#getServletName()
+     */
+    public String getServletName() {
+        return servletName;
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/scripting/java/JavaServletContext.java b/src/main/java/org/apache/sling/scripting/java/JavaServletContext.java
new file mode 100644
index 0000000..8b1969a
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/JavaServletContext.java
@@ -0,0 +1,285 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java;
+
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Set;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The <code>JavaServletContext</code>
+ * is passed to the compiled servlets.
+ */
+public class JavaServletContext implements ServletContext {
+
+    /** default log */
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    private final SlingIOProvider ioProvider;
+    private final ServletContext delegatee;
+
+    JavaServletContext(SlingIOProvider ioProvider, ServletContext componentContext) {
+        this.ioProvider = ioProvider;
+        this.delegatee = componentContext;
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getResource(java.lang.String)
+     */
+    public URL getResource(String path) throws MalformedURLException {
+        if (path.startsWith("/")) {
+            URL url = ioProvider.getURL(path);
+            if (url != null) {
+                return url;
+            }
+        }
+
+        // fall back to trying a real URL
+        return getUrlForResource(path);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getResourceAsStream(java.lang.String)
+     */
+    public InputStream getResourceAsStream(String path) {
+        // path might be an URL, so only check resource provider in case of an
+        // absolute path - assuming URLs have no leading slash at all, we
+        // don't care for the scheme separating colon here
+        if (path.startsWith("/")) {
+            try {
+                return ioProvider.getInputStream(path);
+            } catch (Exception ex) {
+                // FileNotFoundException or IOException
+                log.debug("getResourceAsStream: Cannot get resource {}: {}",
+                    path, ex.getMessage());
+            }
+        }
+
+        // check whether we can resolve as an URL ...
+        try {
+            // create the URL and try to access
+            URL url = getUrlForResource(path);
+            if (url != null) {
+                return url.openStream();
+            }
+        } catch (Exception e) {
+            log.debug(
+                "getResourceAsStream: Cannot access resource {} through URL: {}",
+                path, e.getMessage());
+        }
+
+        return null;
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getResourcePaths(java.lang.String)
+     */
+    public Set<?> getResourcePaths(String path) {
+        return ioProvider.getResourcePaths(path);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#log(java.lang.String)
+     */
+    public void log(String msg) {
+        log.info(msg);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#log(java.lang.Exception, java.lang.String)
+     */
+    @Deprecated
+    public void log(Exception exception, String msg) {
+        log(msg, exception);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#log(java.lang.String, java.lang.Throwable)
+     */
+    public void log(String message, Throwable throwable) {
+        log.error(message, throwable);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getAttribute(java.lang.String)
+     */
+    public Object getAttribute(String name) {
+        return delegatee.getAttribute(name);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getAttributeNames()
+     */
+    public Enumeration<?> getAttributeNames() {
+        return delegatee.getAttributeNames();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#removeAttribute(java.lang.String)
+     */
+    public void removeAttribute(String name) {
+        delegatee.removeAttribute(name);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#setAttribute(java.lang.String, java.lang.Object)
+     */
+    public void setAttribute(String name, Object object) {
+        delegatee.setAttribute(name, object);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getContext(java.lang.String)
+     */
+    public ServletContext getContext(String uripath) {
+        return delegatee.getContext(uripath);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getInitParameter(java.lang.String)
+     */
+    public String getInitParameter(String name) {
+        return delegatee.getInitParameter(name);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getInitParameterNames()
+     */
+    public Enumeration<?> getInitParameterNames() {
+        return delegatee.getInitParameterNames();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getMajorVersion()
+     */
+    public int getMajorVersion() {
+        return delegatee.getMajorVersion();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getMimeType(java.lang.String)
+     */
+    public String getMimeType(String file) {
+        return delegatee.getMimeType(file);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getMinorVersion()
+     */
+    public int getMinorVersion() {
+        return delegatee.getMinorVersion();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getNamedDispatcher(java.lang.String)
+     */
+    public RequestDispatcher getNamedDispatcher(String name) {
+        return delegatee.getNamedDispatcher(name);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getRealPath(java.lang.String)
+     */
+    public String getRealPath(String path) {
+        return delegatee.getRealPath(path);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getRequestDispatcher(java.lang.String)
+     */
+    public RequestDispatcher getRequestDispatcher(String path) {
+        return delegatee.getRequestDispatcher(path);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getServerInfo()
+     */
+    public String getServerInfo() {
+        return delegatee.getServerInfo();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getServlet(java.lang.String)
+     */
+    @Deprecated
+    public Servlet getServlet(String name) throws ServletException {
+        return delegatee.getServlet(name);
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getServletContextName()
+     */
+    public String getServletContextName() {
+        return delegatee.getServletContextName();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getServletNames()
+     */
+    @Deprecated
+    public Enumeration<?> getServletNames() {
+        return delegatee.getServletNames();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getServlets()
+     */
+    @Deprecated
+    public Enumeration<?> getServlets() {
+        return delegatee.getServlets();
+    }
+
+    /**
+     * @see javax.servlet.ServletContext#getContextPath()
+     */
+    public String getContextPath() {
+        return delegatee.getContextPath();
+    }
+
+    //---------- internal -----------------------------------------------------
+
+    private URL getUrlForResource(String path) {
+        int cs = path.indexOf(":/");
+        if (cs > 0 && cs < path.length()-2) {
+            // insert second slash after scheme (was canonicalized away)
+            cs += 2;
+            if (cs < path.length() && path.charAt(cs) != '/') {
+                path = path.substring(0, cs) + "/" + path.substring(cs);
+            }
+
+            // create the URL and try to access
+            try {
+                return new URL(path);
+            } catch (MalformedURLException mue) {
+                log.debug("getUrlForResource: Cannot create URL for {}: {}",
+                    path, mue.getMessage());
+            }
+        }
+
+        return null;
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/Options.java b/src/main/java/org/apache/sling/scripting/java/Options.java
new file mode 100644
index 0000000..bc445ac
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/Options.java
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java;
+
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Properties;
+
+import org.osgi.service.component.ComponentContext;
+
+
+/**
+ * A class to hold all init parameters specific to the compiler
+ */
+public class Options {
+
+    private static final String PROPERTY_JAVA_ENCODING = "javaEncoding";
+
+    private static final String PROPERTY_COMPILER_SOURCE_V_M = "compilerSourceVM";
+
+    private static final String PROPERTY_COMPILER_TARGET_V_M = "compilerTargetVM";
+
+    private static final String PROPERTY_DEVELOPMENT = "development";
+
+    private static final String PROPERTY_OUTPUT_PATH = "outputPath";
+
+    private static final String PROPERTY_MODIFICATION_TEST_INTERVAL = "modificationTestInterval";
+
+    private static final String PROPERTY_CLASSDEBUGINFO = "classdebuginfo";
+
+    /** Default source and target VM version (value is "1.5"). */
+    private static final String DEFAULT_VM_VERSION = "1.5";
+
+    /**
+     * Is the engine being used in development mode?
+     */
+    private final boolean development;
+
+    /**
+     * Do we want to include debugging information in the class file?
+     */
+    private final boolean classDebugInfo;
+
+    /**
+     * Compiler target VM.
+     */
+    private final String compilerTargetVM;
+
+    /**
+     * The compiler source VM.
+     */
+    private final String compilerSourceVM;
+
+    /**
+     * Java platform encoding to generate the servlet.
+     */
+    private final String javaEncoding;
+
+    /**
+     * Modification test interval.
+     */
+    private final int modificationTestInterval;
+
+    /**
+     * Classloader
+     */
+    private final ClassLoader classLoader;
+
+    private final String destinationDir;
+
+    /**
+     * Create an compiler options object using data available from
+     * the component configuration.
+     */
+    public Options(final ComponentContext componentContext,
+                   final ClassLoader classLoader) {
+
+        this.classLoader = classLoader;
+
+        // generate properties
+        final Properties properties = new Properties();
+        // set default values first
+        properties.put(PROPERTY_CLASSDEBUGINFO, "true");
+        properties.put(PROPERTY_DEVELOPMENT, "true");
+        properties.put(PROPERTY_MODIFICATION_TEST_INTERVAL, "-1");
+        properties.put(PROPERTY_COMPILER_TARGET_V_M, DEFAULT_VM_VERSION);
+        properties.put(PROPERTY_COMPILER_SOURCE_V_M, DEFAULT_VM_VERSION);
+        properties.put(PROPERTY_JAVA_ENCODING, "UTF-8");
+        properties.put(PROPERTY_OUTPUT_PATH, "/var/classes");
+
+        // now check component properties
+        Dictionary<?, ?> config = componentContext.getProperties();
+        Enumeration<?> enumeration = config.keys();
+        while (enumeration.hasMoreElements()) {
+            String key = (String) enumeration.nextElement();
+            if (key.startsWith("java.")) {
+                Object value = config.get(key);
+                if (value != null) {
+                    properties.put(key.substring("java.".length()),
+                        value.toString());
+                }
+            }
+        }
+
+        this.destinationDir = properties.get(PROPERTY_OUTPUT_PATH).toString();
+        this.classDebugInfo = Boolean.valueOf(properties.get(PROPERTY_CLASSDEBUGINFO).toString());
+        this.modificationTestInterval = Integer.valueOf(properties.get(PROPERTY_MODIFICATION_TEST_INTERVAL).toString());
+        this.development = Boolean.valueOf(properties.get(PROPERTY_DEVELOPMENT).toString());
+        this.compilerTargetVM = properties.get(PROPERTY_COMPILER_TARGET_V_M).toString();
+        this.compilerSourceVM = properties.get(PROPERTY_COMPILER_SOURCE_V_M).toString();
+        this.javaEncoding = properties.get(PROPERTY_JAVA_ENCODING).toString();
+    }
+
+    /**
+     * Return the destination directory.
+     */
+    public String getDestinationPath() {
+        return this.destinationDir;
+    }
+
+    /**
+     * Should class files be compiled with debug information?
+     */
+    public boolean getClassDebugInfo() {
+        return this.classDebugInfo;
+    }
+
+    /**
+     * Modification test interval.
+     */
+    public int getModificationTestInterval() {
+        return this.modificationTestInterval;
+    }
+
+    /**
+     * Is the engine being used in development mode?
+     */
+    public boolean getDevelopment() {
+        return this.development;
+    }
+
+    public ClassLoader getClassLoader() {
+        return this.classLoader;
+    }
+
+    /**
+     * @see Options#getCompilerTargetVM
+     */
+    public String getCompilerTargetVM() {
+        return this.compilerTargetVM;
+    }
+
+    /**
+     * @see Options#getCompilerSourceVM
+     */
+    public String getCompilerSourceVM() {
+        return this.compilerSourceVM;
+    }
+
+    public String getJavaEncoding() {
+        return this.javaEncoding;
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/ServletCache.java b/src/main/java/org/apache/sling/scripting/java/ServletCache.java
new file mode 100644
index 0000000..9755621
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/ServletCache.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.scripting.java;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * This is a simple in memory cache for compiled servlets.
+ */
+public final class ServletCache {
+
+    /**
+     * Maps servlet source urls to servlet wrappers.
+     */
+    private Map<String, ServletWrapper> servlets = new ConcurrentHashMap<String, ServletWrapper>();
+
+    /**
+     * Add a new ServletWrapper.
+     *
+     * @param servletUri Servlet URI
+     * @param sw Servlet wrapper
+     */
+    public void addWrapper(String servletUri, ServletWrapper sw) {
+        servlets.put(servletUri, sw);
+    }
+
+    /**
+     * Get an already existing ServletWrapper.
+     *
+     * @param servletUri Servlet URI
+     * @return ServletWrapper
+     */
+    public ServletWrapper getWrapper(String servletUri) {
+        return servlets.get(servletUri);
+    }
+
+    /**
+     * Remove a  ServletWrapper.
+     *
+     * @param servletUri Servlet URI
+     */
+    public void removeWrapper(String servletUri) {
+        servlets.remove(servletUri);
+    }
+
+    /**
+     * Process a "destory" event for this web application context.
+     */
+    public void destroy() {
+        Iterator<ServletWrapper> i = this.servlets.values().iterator();
+        while (i.hasNext()) {
+            i.next().destroy();
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java b/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
new file mode 100644
index 0000000..a052c8b
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/ServletWrapper.java
@@ -0,0 +1,275 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.sling.scripting.java;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.SingleThreadModel;
+import javax.servlet.UnavailableException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.sling.api.SlingException;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingIOException;
+import org.apache.sling.api.SlingServletException;
+import org.apache.sling.api.scripting.SlingBindings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+
+ */
+
+public class ServletWrapper {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
+    private final String servletUri;
+
+    /** The servlet config. */
+    private ServletConfig config;
+
+    /** Reload flag. */
+    private boolean reload = true;
+
+    /** Compiler options. */
+    private final Options options;
+
+    private Servlet theServlet;
+    private long available = 0L;
+    private boolean firstTime = true;
+    private ServletException compileException;
+    private CompilationContext ctxt;
+
+    /**
+     * A wrapper for servlets.
+     */
+    public ServletWrapper(final ServletConfig config,
+                          final Options options,
+                          final SlingIOProvider ioProvider,
+                          final String servletPath,
+                          final ServletCache servletCache) {
+        this.config = config;
+        this.servletUri = servletPath;
+        this.options = options;
+        this.ctxt = new CompilationContext(servletUri, options,
+                ioProvider, servletCache, this);
+    }
+
+    /**
+     * Set the reload flag.
+     * @param reload
+     */
+    public void setReload(boolean reload) {
+        this.reload = reload;
+    }
+
+    /**
+     * Get the servlet.
+     * @return The servlet.
+     * @throws ServletException
+     * @throws IOException
+     * @throws FileNotFoundException
+     */
+    private Servlet getServlet()
+    throws ServletException, IOException, FileNotFoundException {
+        if (reload) {
+            synchronized (this) {
+                if (reload) {
+                    destroy();
+
+                    Servlet servlet = null;
+
+                    try {
+                        final Class servletClass = ctxt.load();
+                        servlet = (Servlet) servletClass.newInstance();
+                    } catch (IllegalAccessException e) {
+                        throw new ServletException(e);
+                    } catch (InstantiationException e) {
+                        throw new ServletException(e);
+                    } catch (Exception e) {
+                        throw new ServletException(e);
+                    }
+
+                    servlet.init(config);
+
+                    theServlet = servlet;
+                    reload = false;
+                }
+            }
+        }
+        return theServlet;
+    }
+
+    /**
+     * Sets the compilation exception for this ServletWrapper.
+     *
+     * @param je The compilation exception
+     */
+    public void setCompilationException(ServletException je) {
+        this.compileException = je;
+    }
+
+    /**
+     * @param bindings
+     * @throws SlingIOException
+     * @throws SlingServletException
+     * @throws IllegalArgumentException if the Jasper Precompile controller
+     *             request parameter has an illegal value.
+     */
+    public void service(SlingBindings bindings) {
+        final SlingHttpServletRequest request = bindings.getRequest();
+        final Object oldValue = request.getAttribute(SlingBindings.class.getName());
+        try {
+            request.setAttribute(SlingBindings.class.getName(), bindings);
+            service(request, bindings.getResponse());
+        } catch (SlingException se) {
+            // rethrow as is
+            throw se;
+        } catch (IOException ioe) {
+            throw new SlingIOException(ioe);
+        } catch (ServletException se) {
+            throw new SlingServletException(se);
+        } finally {
+            request.setAttribute(SlingBindings.class.getName(), oldValue);
+        }
+    }
+
+    /**
+     * Call the servlet.
+     * @param request The current request.
+     * @param response The current response.
+     * @throws ServletException
+     * @throws IOException
+     * @throws FileNotFoundException
+     */
+    public void service(HttpServletRequest request,
+                        HttpServletResponse response)
+    throws ServletException, IOException, FileNotFoundException {
+
+        try {
+
+            if (ctxt.isRemoved()) {
+                throw new FileNotFoundException(servletUri);
+            }
+
+            if ((available > 0L) && (available < Long.MAX_VALUE)) {
+                if (available > System.currentTimeMillis()) {
+                    response.setDateHeader("Retry-After", available);
+                    response.sendError
+                        (HttpServletResponse.SC_SERVICE_UNAVAILABLE,
+                         "Servlet unavailable.");
+                    return;
+                }
+                // Wait period has expired. Reset.
+                available = 0;
+            }
+
+            /*
+             * (1) Compile
+             */
+            if (options.getDevelopment() || firstTime ) {
+                synchronized (this) {
+                    firstTime = false;
+
+                    // The following sets reload to true, if necessary
+                    ctxt.compile();
+                }
+            } else {
+                if (compileException != null) {
+                    // Throw cached compilation exception
+                    throw compileException;
+                }
+            }
+
+            /*
+             * (2) (Re)load servlet class file
+             */
+            getServlet();
+
+        } catch (FileNotFoundException ex) {
+            ctxt.incrementRemoved();
+            try {
+                response.sendError(HttpServletResponse.SC_NOT_FOUND,
+                                  ex.getMessage());
+            } catch (IllegalStateException ise) {
+                logger.error("Java servlet source not found." +
+                       ex.getMessage(), ex);
+            }
+        } catch (ServletException ex) {
+            throw ex;
+        } catch (IOException ex) {
+            throw ex;
+        } catch (IllegalStateException ex) {
+            throw ex;
+        } catch (Exception ex) {
+            throw new ServletException(ex);
+        }
+
+        try {
+
+            /*
+             * (3) Service request
+             */
+            if (theServlet instanceof SingleThreadModel) {
+               // sync on the wrapper so that the freshness
+               // of the page is determined right before servicing
+               synchronized (this) {
+                   theServlet.service(request, response);
+                }
+            } else {
+                theServlet.service(request, response);
+            }
+
+        } catch (UnavailableException ex) {
+            int unavailableSeconds = ex.getUnavailableSeconds();
+            if (unavailableSeconds <= 0) {
+                unavailableSeconds = 60;        // Arbitrary default
+            }
+            available = System.currentTimeMillis() +
+                (unavailableSeconds * 1000L);
+            response.sendError
+                (HttpServletResponse.SC_SERVICE_UNAVAILABLE,
+                 ex.getMessage());
+        } catch (ServletException ex) {
+            throw ex;
+        } catch (IOException ex) {
+            throw ex;
+        } catch (IllegalStateException ex) {
+            throw ex;
+        } catch (Exception ex) {
+            throw new ServletException(ex);
+        }
+    }
+
+    /**
+     * Destroy the servlet.
+     */
+    public void destroy() {
+        if (theServlet != null) {
+            theServlet.destroy();
+            theServlet = null;
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java b/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
new file mode 100644
index 0000000..00e714a
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/SlingIOProvider.java
@@ -0,0 +1,369 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.api.SlingException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceMetadata;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The <code>SlingIOProvider</code> TODO
+ */
+public class SlingIOProvider  {
+
+    /** default log */
+    private static final Logger log = LoggerFactory.getLogger(SlingIOProvider.class);
+
+    private final SlingRepository repository;
+
+    private ThreadLocal<ResourceResolver> requestResourceResolver;
+
+    // private session for write access
+    private ThreadLocal<Session> privateSession;
+
+    SlingIOProvider(SlingRepository repository) {
+        this.repository = repository;
+        this.requestResourceResolver = new ThreadLocal<ResourceResolver>();
+        this.privateSession = new ThreadLocal<Session>();
+    }
+
+    void setRequestResourceResolver(ResourceResolver resolver) {
+        requestResourceResolver.set(resolver);
+    }
+
+    void resetRequestResourceResolver() {
+        requestResourceResolver.remove();
+
+        // at the same time logout this thread's session
+        Session session = privateSession.get();
+        if (session != null) {
+            if (session.isLive()) {
+                session.logout();
+            }
+            privateSession.remove();
+        }
+    }
+
+    // ---------- IOProvider interface -----------------------------------------
+
+    /**
+     * Returns an InputStream for the file name which is looked up with the
+     * ResourceProvider and retrieved from the Resource if the StreamProvider
+     * interface is implemented.
+     */
+    public InputStream getInputStream(String fileName)
+    throws FileNotFoundException, IOException {
+
+        try {
+
+            Resource resource = getResourceInternal(fileName);
+            if (resource == null) {
+                throw new FileNotFoundException("Cannot find " + fileName);
+            }
+
+            InputStream stream = resource.adaptTo(InputStream.class);
+            if (stream == null) {
+                throw new FileNotFoundException("Cannot find " + fileName);
+            }
+
+            return stream;
+
+        } catch (SlingException se) {
+            throw (IOException) new IOException(
+                "Failed to get InputStream for " + fileName).initCause(se);
+        }
+    }
+
+    /**
+     * Returns the value of the last modified meta data field of the resource
+     * found at file name or zero if the meta data field is not set. If the
+     * resource does not exist or an error occurrs finding the resource, -1 is
+     * returned.
+     */
+    public long lastModified(String fileName) {
+        try {
+            Resource resource = getResourceInternal(fileName);
+            if (resource != null) {
+                ResourceMetadata meta = resource.getResourceMetadata();
+                long modTime = meta.getModificationTime();
+                return (modTime > 0) ? modTime : 0;
+            }
+
+        } catch (SlingException se) {
+            log.error("Cannot get last modification time for " + fileName, se);
+        }
+
+        // fallback to "non-existant" in case of problems
+        return -1;
+    }
+
+    /**
+     * Removes the named item from the repository.
+     */
+    public boolean delete(String fileName) {
+        Node parentNode = null;
+        try {
+            fileName = cleanPath(fileName);
+            Session session = getPrivateSession();
+            if (session.itemExists(fileName)) {
+                Item fileItem = session.getItem(fileName);
+                parentNode = fileItem.getParent();
+                fileItem.remove();
+                parentNode.save();
+                return true;
+            }
+        } catch (RepositoryException re) {
+            log.error("Cannot remove " + fileName, re);
+        } finally {
+            checkNode(parentNode, fileName);
+        }
+
+        // fall back to false if item does not exist or in case of error
+        return false;
+    }
+
+    /**
+     * Returns an output stream to write to the repository.
+     */
+    public OutputStream getOutputStream(String fileName) {
+        fileName = cleanPath(fileName);
+        return new RepositoryOutputStream(this, fileName);
+    }
+
+    /* package */URL getURL(String path) throws MalformedURLException {
+        try {
+            Resource resource = getResourceInternal(path);
+            return (resource != null) ? resource.adaptTo(URL.class) : null;
+        } catch (SlingException se) {
+            throw (MalformedURLException) new MalformedURLException(
+                "Cannot get URL for " + path).initCause(se);
+        }
+    }
+
+    /* package */Set<String> getResourcePaths(String path) {
+        Set<String> paths = new HashSet<String>();
+
+        ResourceResolver resolver = requestResourceResolver.get();
+        if (resolver != null) {
+            try {
+                Resource resource = resolver.getResource(cleanPath(path));
+                if (resource != null) {
+                    Iterator<Resource> entries = resolver.listChildren(resource);
+                    while (entries.hasNext()) {
+                        paths.add(entries.next().getPath());
+                    }
+                }
+            } catch (SlingException se) {
+                log.warn("getResourcePaths: Cannot list children of " + path,
+                    se);
+            }
+        }
+
+        return paths.isEmpty() ? null : paths;
+    }
+
+    private Resource getResourceInternal(String path) throws SlingException {
+        ResourceResolver resolver = requestResourceResolver.get();
+        if (resolver != null) {
+            return resolver.getResource(cleanPath(path));
+        }
+
+        return null;
+    }
+
+    // ---------- internal -----------------------------------------------------
+
+    private Session getPrivateSession() throws RepositoryException {
+        Session session = privateSession.get();
+        if (session == null) {
+            session = repository.loginAdministrative(null);
+            privateSession.set(session);
+        }
+
+        return session;
+    }
+
+    private static void checkNode(Node node, String path) {
+        if (node != null && node.isModified()) {
+            try {
+                node.refresh(false);
+            } catch (RepositoryException re) {
+                log.error("Cannot refresh node for " + path
+                    + " after failed save", re);
+            }
+        }
+    }
+
+    private String cleanPath(String path) {
+        // replace backslash by slash
+        path = path.replace('\\', '/');
+
+        // cut off trailing slash
+        while (path.endsWith("/")) {
+            path = path.substring(0, path.length() - 1);
+        }
+
+        return path;
+    }
+
+    private static class RepositoryOutputStream extends ByteArrayOutputStream {
+
+        private final SlingIOProvider repositoryOutputProvider;
+
+        private final String fileName;
+
+        RepositoryOutputStream(SlingIOProvider repositoryOutputProvider,
+                String fileName) {
+            this.repositoryOutputProvider = repositoryOutputProvider;
+            this.fileName = fileName;
+        }
+
+        public void close() throws IOException {
+            super.close();
+
+            Node parentNode = null;
+            try {
+                Session session = repositoryOutputProvider.getPrivateSession();
+                Node fileNode = null;
+                Node contentNode = null;
+                if (session.itemExists(fileName)) {
+                    Item item = session.getItem(fileName);
+                    if (item.isNode()) {
+                        Node node = item.isNode()
+                                ? (Node) item
+                                : item.getParent();
+                        if ("jcr:content".equals(node.getName())) {
+                            // replace the content properties of the jcr:content
+                            // node
+                            parentNode = node;
+                            contentNode = node;
+                        } else if (node.isNodeType("nt:file")) {
+                            // try to set the content properties of jcr:content
+                            // node
+                            parentNode = node;
+                            contentNode = node.getNode("jcr:content");
+                        } else { // fileName is a node
+                            // try to set the content properties of the node
+                            parentNode = node;
+                            contentNode = node;
+                        }
+                    } else {
+                        // replace property with an nt:file node (if possible)
+                        parentNode = item.getParent();
+                        String name = item.getName();
+                        fileNode = parentNode.addNode(name, "nt:file");
+                        item.remove();
+                    }
+                } else {
+                    fileNode = createPath(fileName, "nt:folder", "nt:file", session);
+                    parentNode = session.getRootNode();
+                }
+
+                // if we have a file node, create the contentNode
+                if (fileNode != null) {
+                    contentNode = fileNode.addNode("jcr:content", "nt:resource");
+                }
+
+                contentNode.setProperty("jcr:lastModified",
+                    System.currentTimeMillis());
+                contentNode.setProperty("jcr:data", new ByteArrayInputStream(
+                    buf, 0, size()));
+                contentNode.setProperty("jcr:mimeType",
+                    "application/octet-stream");
+
+                parentNode.save();
+            } catch (RepositoryException re) {
+                log.error("Cannot write file " + fileName, re);
+                throw new IOException("Cannot write file " + fileName
+                    + ", reason: " + re.toString());
+            } finally {
+                checkNode(parentNode, fileName);
+            }
+        }
+    }
+
+    /**
+     * Creates or gets the {@link javax.jcr.Node Node} at the given Path.
+     * In case it has to create the Node all non-existent intermediate path-elements
+     * will be create with the given intermediate node type and the returned node
+     * will be created with the given nodeType
+     *
+     * @param path to create
+     * @param intermediateNodeType to use for creation of intermediate nodes
+     * @param nodeType to use for creation of the final node
+     * @param session to use
+     * @return the Node at path
+     * @throws RepositoryException in case of exception accessing the Repository
+     */
+    private static Node createPath(String path,
+                                  String intermediateNodeType,
+                                  String nodeType,
+                                  Session session)
+            throws RepositoryException {
+        if (path == null || path.length() == 0 || "/".equals(path)) {
+            return session.getRootNode();
+        } else if (!session.itemExists(path)) {
+            Node node = session.getRootNode();
+            path = path.substring(1);
+            int pos = path.lastIndexOf('/');
+            if ( pos != -1 ) {
+                final StringTokenizer st = new StringTokenizer(path.substring(0, pos), "/");
+                while ( st.hasMoreTokens() ) {
+                    final String token = st.nextToken();
+                    if ( !node.hasNode(token) ) {
+                        try {
+                            node.addNode(token, intermediateNodeType);
+                        } catch (RepositoryException re) {
+                            // we ignore this as this folder might be created from a different task
+                            node.refresh(false);
+                        }
+                    }
+                    node = node.getNode(token);
+                }
+                path = path.substring(pos + 1);
+            }
+            if ( !node.hasNode(path) ) {
+                node.addNode(path, nodeType);
+            }
+            return node.getNode(path);
+        } else {
+            return (Node) session.getItem(path);
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
new file mode 100644
index 0000000..80459f4
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java.jdt;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.sling.scripting.java.CompilerError;
+import org.apache.sling.scripting.java.Options;
+import org.apache.sling.scripting.java.SlingIOProvider;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.internal.compiler.ClassFile;
+import org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
+import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
+import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
+import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
+
+
+public class CompilationUnit
+    implements ICompilationUnit, INameEnvironment, ICompilerRequestor {
+
+    private final Options options;
+    private final SlingIOProvider ioProvider;
+    private final String className;
+    private final String sourceFile;
+
+    /** The list of compile errors. */
+    private final List<CompilerError> errors = new LinkedList<CompilerError>();
+
+    public CompilationUnit(String sourceFile,
+                           String className,
+                           Options options,
+                           SlingIOProvider ioProvider) {
+        this.className = className;
+        this.sourceFile = sourceFile;
+        this.ioProvider = ioProvider;
+        this.options = options;
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.IDependent#getFileName()
+     */
+    public char[] getFileName() {
+        return className.concat(".java").toCharArray();
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getContents()
+     */
+    public char[] getContents() {
+        char[] result = null;
+        InputStream fr = null;
+        try {
+            fr = ioProvider.getInputStream(this.sourceFile);
+            final Reader reader = new BufferedReader(new InputStreamReader(fr, this.options.getJavaEncoding()));
+            try {
+                char[] chars = new char[8192];
+                StringBuffer buf = new StringBuffer();
+                int count;
+                while ((count = reader.read(chars, 0, chars.length)) > 0) {
+                    buf.append(chars, 0, count);
+                }
+                result = new char[buf.length()];
+                buf.getChars(0, result.length, result, 0);
+            } finally {
+                reader.close();
+            }
+        } catch (IOException e) {
+            handleError(-1, -1, e.getMessage());
+        }
+        return result;
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
+     */
+    public char[] getMainTypeName() {
+        int dot = className.lastIndexOf('.');
+        if (dot > 0) {
+            return className.substring(dot + 1).toCharArray();
+        }
+        return className.toCharArray();
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getPackageName()
+     */
+    public char[][] getPackageName() {
+        StringTokenizer izer = new StringTokenizer(className.replace('/', '.'), ".");
+        char[][] result = new char[izer.countTokens()-1][];
+        for (int i = 0; i < result.length; i++) {
+            String tok = izer.nextToken();
+            result[i] = tok.toCharArray();
+        }
+        return result;
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[][])
+     */
+    public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
+        StringBuffer result = new StringBuffer();
+        for (int i = 0; i < compoundTypeName.length; i++) {
+            if (i > 0) {
+                result.append(".");
+            }
+            result.append(compoundTypeName[i]);
+        }
+        return findType(result.toString());
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#findType(char[], char[][])
+     */
+    public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
+        StringBuffer result = new StringBuffer();
+        for (int i = 0; i < packageName.length; i++) {
+            if (i > 0) {
+                result.append(".");
+            }
+            result.append(packageName[i]);
+        }
+        result.append(".");
+        result.append(typeName);
+        return findType(result.toString());
+    }
+
+    /**
+     * @param className
+     * @return
+     */
+    private NameEnvironmentAnswer findType(String className) {
+        try {
+            if (className.equals(this.className)) {
+                ICompilationUnit compilationUnit = this;
+                return new NameEnvironmentAnswer(compilationUnit, null);
+            }
+            String resourceName = className.replace('.', '/') + ".class";
+            InputStream is = options.getClassLoader().getResourceAsStream(resourceName);
+            if (is != null) {
+                byte[] classBytes;
+                byte[] buf = new byte[8192];
+                ByteArrayOutputStream baos =
+                    new ByteArrayOutputStream(buf.length);
+                int count;
+                while ((count = is.read(buf, 0, buf.length)) > 0) {
+                    baos.write(buf, 0, count);
+                }
+                baos.flush();
+                classBytes = baos.toByteArray();
+                char[] fileName = className.toCharArray();
+                ClassFileReader classFileReader =
+                    new ClassFileReader(classBytes, fileName,
+                                        true);
+                return
+                    new NameEnvironmentAnswer(classFileReader, null);
+            }
+        } catch (IOException exc) {
+            handleError(-1, -1, exc.getMessage());
+        } catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException exc) {
+            handleError(-1, -1, exc.getMessage());
+        }
+        return null;
+    }
+
+    private boolean isPackage(String result) {
+        if (result.equals(this.className)) {
+            return false;
+        }
+        String resourceName = result.replace('.', '/') + ".class";
+        InputStream is = options.getClassLoader().getResourceAsStream(resourceName);
+        return is == null;
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#isPackage(char[][], char[])
+     */
+    public boolean isPackage(char[][] parentPackageName, char[] packageName) {
+        StringBuffer result = new StringBuffer();
+        if (parentPackageName != null) {
+            for (int i = 0; i < parentPackageName.length; i++) {
+                if (i > 0) {
+                    result.append(".");
+                }
+                result.append(parentPackageName[i]);
+            }
+        }
+        String str = new String(packageName);
+        if (Character.isUpperCase(str.charAt(0)) && !isPackage(result.toString())) {
+                return false;
+        }
+        result.append(".");
+        result.append(str);
+        return isPackage(result.toString());
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.env.INameEnvironment#cleanup()
+     */
+    public void cleanup() {
+        // EMPTY
+    }
+
+    /**
+     * @see org.eclipse.jdt.internal.compiler.ICompilerRequestor#acceptResult(org.eclipse.jdt.internal.compiler.CompilationResult)
+     */
+    public void acceptResult(CompilationResult result) {
+        try {
+            if (result.hasErrors()) {
+                IProblem[] errors = result.getErrors();
+                for (int i = 0; i < errors.length; i++) {
+                    IProblem error = errors[i];
+                    handleError(error.getSourceLineNumber(), -1, error.getMessage());
+                }
+            } else {
+                ClassFile[] classFiles = result.getClassFiles();
+                for (int i = 0; i < classFiles.length; i++) {
+                    ClassFile classFile = classFiles[i];
+                    char[][] compoundName = classFile.getCompoundName();
+                    StringBuffer className = new StringBuffer();
+                    for (int j = 0;  j < compoundName.length; j++) {
+                        if (j > 0) {
+                            className.append(".");
+                        }
+                        className.append(compoundName[j]);
+                    }
+                    byte[] bytes = classFile.getBytes();
+                    final StringBuffer b = new StringBuffer(this.options.getDestinationPath());
+                    b.append('/');
+                    b.append(className.toString().replace('.', '/'));
+                    b.append(".class");
+                    OutputStream fout = ioProvider.getOutputStream(b.toString());
+                    BufferedOutputStream bos = new BufferedOutputStream(fout);
+                    bos.write(bytes);
+                    bos.close();
+                }
+            }
+        } catch (IOException exc) {
+            exc.printStackTrace();
+        }
+    }
+
+    private void handleError(int line, int column, Object errorMessage) {
+        if (column < 0) column = 0;
+        errors.add(new CompilerError(this.sourceFile,
+                                     true,
+                                     line,
+                                     column,
+                                     line,
+                                     column,
+                                     errorMessage.toString()));
+    }
+
+    public List<CompilerError> getErrors() throws IOException {
+        return errors;
+    }
+}
diff --git a/src/main/java/org/apache/sling/scripting/java/jdt/EclipseJavaCompiler.java b/src/main/java/org/apache/sling/scripting/java/jdt/EclipseJavaCompiler.java
new file mode 100644
index 0000000..8ed73af
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/java/jdt/EclipseJavaCompiler.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.scripting.java.jdt;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.sling.scripting.java.CompilationContext;
+import org.apache.sling.scripting.java.CompilerError;
+import org.apache.sling.scripting.java.Options;
+import org.apache.sling.scripting.java.SlingIOProvider;
+import org.eclipse.jdt.internal.compiler.Compiler;
+import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
+import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
+import org.eclipse.jdt.internal.compiler.IProblemFactory;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
+
+/**
+ * Eclipse Java Compiler
+ *
+ * @version $Id$
+ */
+public class EclipseJavaCompiler {
+
+    /** The io provider. */
+    private final SlingIOProvider ioProvider;
+
+    /** The compiler options. */
+    private final Options compilerOptions;
+
+    /** The compilation context. */
+    private final CompilationContext context;
+
+    /**
+     * Construct a new java compiler.
+     * @param context
+     */
+    public EclipseJavaCompiler(final CompilationContext context) {
+        this.ioProvider = context.getIOProvider();
+        this.compilerOptions = context.getCompilerOptions();
+        this.context = context;
+    }
+
+    private CompilerOptions getCompilerOptions() {
+        CompilerOptions options = new CompilerOptions();
+        final Map<String, String> settings = new HashMap<String, String>();
+        settings.put(CompilerOptions.OPTION_LineNumberAttribute,
+                CompilerOptions.GENERATE);
+        settings.put(CompilerOptions.OPTION_SourceFileAttribute,
+                CompilerOptions.GENERATE);
+        settings.put(CompilerOptions.OPTION_ReportDeprecation,
+                CompilerOptions.IGNORE);
+        settings.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE);
+        settings.put(CompilerOptions.OPTION_Encoding, this.compilerOptions.getJavaEncoding());
+        if (this.compilerOptions.getClassDebugInfo()) {
+            settings.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
+        }
+        if ( this.compilerOptions.getCompilerSourceVM().equals("1.6") ) {
+            settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
+        } else {
+            settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
+        }
+        if ( this.compilerOptions.getCompilerTargetVM().equals("1.6") ) {
+            settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
+            settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
+        } else {
+            settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5);
+            settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
+        }
+
+        options.set(settings);
+        return options;
+    }
+
+    /**
+     * Compile the java class.
+     * @return null if no error occured, a list of errors otherwise.
+     * @throws IOException
+     */
+    public List<CompilerError> compile() throws IOException {
+        final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems();
+        final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());
+        final CompilationUnit unit = new CompilationUnit(this.context.getSourcePath(),
+                 this.context.getJavaClassName(),
+                 this.context.getCompilerOptions(),
+                 this.ioProvider);
+
+        final Compiler compiler = new Compiler(unit,
+                                         policy,
+                                         getCompilerOptions(),
+                                         unit,
+                                         problemFactory);
+        compiler.compile(new CompilationUnit[] {unit});
+        if ( unit.getErrors().size() == 0 ) {
+            return null;
+        }
+        return unit.getErrors();
+    }
+
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 40/41: [maven-release-plugin] prepare release org.apache.sling.scripting.java-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 45524e57454fb8a72f71b40698c5fcc16ae96c16
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Nov 26 15:55:34 2009 +0000

    [maven-release-plugin] prepare release org.apache.sling.scripting.java-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@884609 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 15fafff..e65a1e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.scripting.java</artifactId>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.0.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Scripting Java Support</name>
     <description>Support for scripting Java</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.java-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.scripting.java-1.0.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 14/41: Use release parent pom

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 202f6f37086c1944e1a3e75d52a2efc963c10baf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue May 5 15:06:21 2009 +0000

    Use release parent pom
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java@771764 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b2f75d7..bccda65 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>5-incubator-SNAPSHOT</version>
+        <version>5-incubator</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 20/41: SLING-1011 : Remove disclaimer from readme's, adjust links to webite, fix versions in poms.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 3a4b8e10eb2f52ea4d70aacc5d01ed4a49c7e0c6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jun 18 10:47:55 2009 +0000

    SLING-1011 : Remove disclaimer from readme's, adjust links to webite, fix versions in poms.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@786012 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index a46760e..04bb66b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.scripting.java</artifactId>
-    <version>2.0.0-incubator-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Scripting Java Support</name>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 31/41: SLING-1021 : Use own sling scope to store private attributes.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 04fbce0eee8356ee0a43e512ff916551092db078
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 23 10:17:52 2009 +0000

    SLING-1021 : Use own sling scope to store private attributes.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@797001 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
index 1363b5c..729702f 100644
--- a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
@@ -169,7 +169,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
                              final SlingScriptHelper scriptHelper,
                              final ScriptContext context) {
         ResourceResolver resolver = (ResourceResolver) context.getAttribute(SlingScriptConstants.ATTR_SCRIPT_RESOURCE_RESOLVER,
-                ScriptContext.GLOBAL_SCOPE);
+                SlingScriptConstants.SLING_SCOPE);
         if ( resolver == null ) {
             resolver = scriptHelper.getScript().getScriptResource().getResourceResolver();
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 11/41: SLING-865 : Move to contrib

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 1c32a95b083c636612bb5cbdf00964dbcce00bb3
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Feb 22 13:47:14 2009 +0000

    SLING-865 : Move to contrib
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java@746683 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 32/41: Use latest Sling API release.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 5445803e7740937f73f7a76a40e7ef744895dc4c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 17 13:12:00 2009 +0000

    Use latest Sling API release.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@804969 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9f61994..21e01c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.5-SNAPSHOT</version>
+            <version>2.0.6</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 25/41: Do not silently swallow exception

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 025f5466f1cb9765d59be1dcf12d12e9d35c21b7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 7 09:51:38 2009 +0000

    Do not silently swallow exception
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@791771 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/scripting/java/jdt/CompilationUnit.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
index c6a9de8..6313495 100644
--- a/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
+++ b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
@@ -265,12 +265,14 @@ public class CompilationUnit
                 }
             }
         } catch (IOException exc) {
-            exc.printStackTrace();
+            handleError(-1, -1, exc.getLocalizedMessage());
         }
     }
 
     private void handleError(int line, int column, Object errorMessage) {
-        if (column < 0) column = 0;
+        if (column < 0) {
+            column = 0;
+        }
         errors.add(new CompilerError(this.sourceFile,
                                      true,
                                      line,

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 23/41: Correctly set version to 0.9.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 04c964c7b066742045d3da69c955ba26cf42fb45
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 7 07:50:38 2009 +0000

    Correctly set version to 0.9.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@791740 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 77200e0..2ef4995 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.scripting.java</artifactId>
-    <version>2.0.0-SNAPSHOT</version>
+    <version>0.9.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Scripting Java Support</name>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 24/41: Improve exception messages.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit e815996da4fb3329d20f744b6adccf6e5329ec2f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 7 09:13:36 2009 +0000

    Improve exception messages.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@791764 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/scripting/java/CompilationContext.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/CompilationContext.java b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
index 8c5e41b..2de7af7 100644
--- a/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
+++ b/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
@@ -196,12 +196,13 @@ public class CompilationContext {
      */
     public Class load()
     throws ServletException, FileNotFoundException {
+        final String name = this.getClassFilePath().substring(1).replace('/', '.');
         try {
-            servletClass = this.options.getClassLoader().loadClass(this.getClassFilePath().substring(1).replace('/', '.'));
+            servletClass = this.options.getClassLoader().loadClass(name);
         } catch (ClassNotFoundException cex) {
-            throw new ServletException("Unable to load servlet class.", cex);
+            throw new ServletException("Servlet class not found: " + name, cex);
         } catch (Exception ex) {
-            throw new ServletException("Unable to compile servlet.", ex);
+            throw new ServletException("Unable to compile servlet: " + name, ex);
         }
         removed = 0;
         return servletClass;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 02/41: Add descriptions for the configuration, fix type in config and add missing licence and notice files.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 72382c308717c5d9b604430c7d193ced274a5e91
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 15 13:59:16 2008 +0000

    Add descriptions for the configuration, fix type in config and add missing licence and notice files.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@704918 13f79535-47bb-0310-9956-ffa450edef68
---
 LICENSE                                            | 202 ++++++
 NOTICE                                             |   8 +
 .../scripting/java/JavaScriptEngineFactory.java    |   2 +-
 src/main/resources/META-INF/DISCLAIMER             |   7 +
 src/main/resources/META-INF/LICENSE                | 681 +++++++++++++++++++++
 src/main/resources/META-INF/NOTICE                 |   8 +
 .../OSGI-INF/metatype/metatype.properties          |  58 ++
 7 files changed, 965 insertions(+), 1 deletion(-)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..d625d4d
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,8 @@
+Apache Sling Java Scripting Support
+Copyright 2008 The Apache Software Foundation
+
+Apache Sling is based on source code originally developed 
+by Day Software (http://www.day.com/).
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
index 70190f2..e50a78d 100644
--- a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
@@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
  * @scr.property name="java.development" value="true"
  * @scr.property name="java.outputPath" value="/var/classes"
  * @scr.property name="java.modificationTestInterval" value="-1"
- * @scr.property name="java.classdebuginfo" value="truie"
+ * @scr.property name="java.classdebuginfo" value="true"
  */
 public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
 
diff --git a/src/main/resources/META-INF/DISCLAIMER b/src/main/resources/META-INF/DISCLAIMER
new file mode 100644
index 0000000..90850c2
--- /dev/null
+++ b/src/main/resources/META-INF/DISCLAIMER
@@ -0,0 +1,7 @@
+Apache Sling is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Jackrabbit PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other
+successful ASF projects. While incubation status is not necessarily a reflection of
+the completeness or stability of the code, it does indicate that the project has yet
+to be fully endorsed by the ASF.
\ No newline at end of file
diff --git a/src/main/resources/META-INF/LICENSE b/src/main/resources/META-INF/LICENSE
new file mode 100644
index 0000000..884d3e7
--- /dev/null
+++ b/src/main/resources/META-INF/LICENSE
@@ -0,0 +1,681 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+APACHE SLING SUBCOMPONENTS:
+
+Apache Sling includes subcomponents with separate copyright notices and
+license terms. Your use of these subcomponents is subject to the terms
+and conditions of the following licenses.
+
+Rhino
+
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+   1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+   2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+   3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+   4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+   5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+   6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+   7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+   8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+   9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+   10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+   11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+   12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+   13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+   EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
diff --git a/src/main/resources/META-INF/NOTICE b/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000..d625d4d
--- /dev/null
+++ b/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,8 @@
+Apache Sling Java Scripting Support
+Copyright 2008 The Apache Software Foundation
+
+Apache Sling is based on source code originally developed 
+by Day Software (http://www.day.com/).
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties b/src/main/resources/OSGI-INF/metatype/metatype.properties
new file mode 100644
index 0000000..a7aa4b5
--- /dev/null
+++ b/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -0,0 +1,58 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+
+#
+# This file contains localization strings for configuration labels and
+# descriptions as used in the metatype.xml descriptor generated by the
+# the Sling SCR plugin
+
+javahandler.name = Java Script Handler
+javahandler.description The Java Script Handler supports development of Java Servlets \
+ to render response content.  
+
+java.classdebuginfo.name = Generate Debug Info
+java.classdebuginfo.description = Should the class file be compiled with \
+ debugging information? true or false, default true.
+ 
+java.modificationTestInterval.name = Modification Check Interval
+java.modificationTestInterval.description = Checks for modification for a \
+ given Java file will be performed only once every \
+ specified amount of seconds. Setting this to -1 will cause the source to be checked \
+ on every access. Default is -1.
+
+java.development.name = Development Mode
+java.development.description = Is scripting used in development mode (will check \
+ for modification on every access)? true or false, default true.
+ 
+java.javaEncoding.name = Source Encoding
+java.javaEncoding.description = Encoding to be used to read the source files. \
+ This defaults to UTF-8 and should only be changed in very specific circumstances.
+
+java.compilerSourceVM.name = Source VM
+java.compilerSourceVM.description = Java Specification to be used to read \
+ the source files.
+
+java.compilerTargetVM.name = Target VM
+java.compilerTargetVM.description = Java Specification to be used to generate \
+ the compiled output.
+
+java.outputPath.name = Compilation Location
+java.outputPath.description = What directory should we use when \
+ compiling Java files? Default is /var/classes.
+ 
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 06/41: Update notice files to include 2009 in copyright statement.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 3536bde1f075c72f5016d2b336a81412b36ce27e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Jan 7 09:07:02 2009 +0000

    Update notice files to include 2009 in copyright statement.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@732280 13f79535-47bb-0310-9956-ffa450edef68
---
 NOTICE                             | 2 +-
 src/main/resources/META-INF/NOTICE | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/NOTICE b/NOTICE
index d625d4d..4b1c970 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
 Apache Sling Java Scripting Support
-Copyright 2008 The Apache Software Foundation
+Copyright 2008-2009 The Apache Software Foundation
 
 Apache Sling is based on source code originally developed 
 by Day Software (http://www.day.com/).
diff --git a/src/main/resources/META-INF/NOTICE b/src/main/resources/META-INF/NOTICE
index d625d4d..4b1c970 100644
--- a/src/main/resources/META-INF/NOTICE
+++ b/src/main/resources/META-INF/NOTICE
@@ -1,5 +1,5 @@
 Apache Sling Java Scripting Support
-Copyright 2008 The Apache Software Foundation
+Copyright 2008-2009 The Apache Software Foundation
 
 Apache Sling is based on source code originally developed 
 by Day Software (http://www.day.com/).

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 34/41: Update to latest Sling releases.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 07ac4e7d3210086548dcb84e81a2dce8cb9c0b5d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Oct 6 06:19:55 2009 +0000

    Update to latest Sling releases.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@822144 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index bfbaed1..846561f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.0.6</version>
+            <version>2.0.8</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -101,7 +101,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.classloader</artifactId>
-            <version>0.9.1-SNAPSHOT</version>
+            <version>0.9.0</version>
         </dependency>
 
      <!-- We use the same eclipse jdt as the jsp bundle -->

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 03/41: SLING-619 - add README.txt with info on how to test this bundle

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit bc49398f1d7d29c8097145a7cb8c37f95586f7f6
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Nov 18 13:54:41 2008 +0000

    SLING-619 - add README.txt with info on how to test this bundle
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@718587 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..985f318
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,39 @@
+Sling scripting.java module
+---------------------------
+
+This module implements a script engine for java servlets, that are compiled
+on the fly by Sling.
+
+To test it:
+
+1. Install this bundle in Sling, for example with
+
+  mvn -P autoInstallBundle clean install -Dsling.url=http://localhost:8888/system/console
+  
+If Sling is running with the launchpad/testing setup.
+
+2. Create /apps/foo/foo.java in your repository (via WebDAV for example), with this code:
+
+package apps.foo;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
+
+public class foo extends SlingSafeMethodsServlet {
+    
+    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) 
+    throws ServletException, IOException {
+        response.setContentType("text/plain");
+        response.getWriter().write("Response from " + getClass().getName() + " at " + new java.util.Date());
+    }
+}   
+
+3. Request http://localhost:8888/content/foo/*.html which should display something like
+
+  Response from apps.foo.foo at Tue Nov 18 14:49:14 CET 2008
+  
+4. The servlet code should be automatically recompiled after any changes.
+  
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 04/41: svn:ignore Eclipse files

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit cbbc933ee83fd2d44d976e396ac577a46caf728c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Dec 1 08:25:47 2008 +0000

    svn:ignore Eclipse files
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@721994 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 35/41: Update to latest release.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit d4de31fd38f3dc2819bc274ee97989c4d0465e4d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 14 06:39:29 2009 +0000

    Update to latest release.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@825023 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 846561f..1da6835 100644
--- a/pom.xml
+++ b/pom.xml
@@ -101,7 +101,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.classloader</artifactId>
-            <version>0.9.0</version>
+            <version>1.0.0</version>
         </dependency>
 
      <!-- We use the same eclipse jdt as the jsp bundle -->

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 09/41: SLING-825 : Return the resource name as source file name.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit b12c7b4902e1e00228d95a699f73541662d437db
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jan 19 07:24:08 2009 +0000

    SLING-825 : Return the resource name as source file name.
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@735622 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/scripting/java/jdt/CompilationUnit.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
index 80459f4..c6a9de8 100644
--- a/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
+++ b/src/main/java/org/apache/sling/scripting/java/jdt/CompilationUnit.java
@@ -66,7 +66,11 @@ public class CompilationUnit
      * @see org.eclipse.jdt.internal.compiler.env.IDependent#getFileName()
      */
     public char[] getFileName() {
-        return className.concat(".java").toCharArray();
+        int slash = sourceFile.lastIndexOf('/');
+        if (slash > 0) {
+            return sourceFile.substring(slash + 1).toCharArray();
+        }
+        return sourceFile.toCharArray();
     }
 
     /**

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 08/41: SLING-829 Ensure Apache Sling prefix on all configuration names

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit f6e4fabd7c77ab91d8df2c220bd61e3c184cee82
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Jan 15 13:46:24 2009 +0000

    SLING-829 Ensure Apache Sling prefix on all configuration names
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@734704 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/resources/OSGI-INF/metatype/metatype.properties | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties b/src/main/resources/OSGI-INF/metatype/metatype.properties
index a7aa4b5..666d78f 100644
--- a/src/main/resources/OSGI-INF/metatype/metatype.properties
+++ b/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -22,7 +22,7 @@
 # descriptions as used in the metatype.xml descriptor generated by the
 # the Sling SCR plugin
 
-javahandler.name = Java Script Handler
+javahandler.name = Apache Sling Java Script Handler
 javahandler.description The Java Script Handler supports development of Java Servlets \
  to render response content.  
 
@@ -55,4 +55,4 @@ java.compilerTargetVM.description = Java Specification to be used to generate \
 java.outputPath.name = Compilation Location
 java.outputPath.description = What directory should we use when \
  compiling Java files? Default is /var/classes.
- 
\ No newline at end of file
+ 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 36/41: Use latest parent pom.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 7a1a68b00e9e2a2e5a8b7d21d3bdc4e198385046
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Nov 26 15:27:07 2009 +0000

    Use latest parent pom.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@884578 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1da6835..4ff986a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>6</version>
+        <version>7</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
@@ -112,11 +112,11 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.felix</groupId>
+            <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
+            <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 07/41: SLING-829 Cosmetics to the bundle/project names

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 3574a997b033a66fa80f2ed84d1eb1a9a4749cbc
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Jan 15 10:25:41 2009 +0000

    SLING-829 Cosmetics to the bundle/project names
    
    git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/scripting/java@734658 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 98a3969..4ed4b7c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
     <version>2.0.0-incubator-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
-    <name>Sling - Scripting - Java Support</name>
+    <name>Apache Sling Scripting Java Support</name>
     <description>Support for scripting Java</description>
 
     <scm>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 30/41: SLING-1021 - Use the global scope for the script resource resolver to avoid having this in the bindings for the script.

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 76f52ae892cf5fae1f613ec36a0df72157acfa4d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 23 09:14:15 2009 +0000

    SLING-1021 - Use the global scope for the script resource resolver to avoid having this in the bindings for the script.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@796984 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
index 698937c..1363b5c 100644
--- a/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
+++ b/src/main/java/org/apache/sling/scripting/java/JavaScriptEngineFactory.java
@@ -169,7 +169,7 @@ public class JavaScriptEngineFactory extends AbstractScriptEngineFactory {
                              final SlingScriptHelper scriptHelper,
                              final ScriptContext context) {
         ResourceResolver resolver = (ResourceResolver) context.getAttribute(SlingScriptConstants.ATTR_SCRIPT_RESOURCE_RESOLVER,
-                ScriptContext.ENGINE_SCOPE);
+                ScriptContext.GLOBAL_SCOPE);
         if ( resolver == null ) {
             resolver = scriptHelper.getScript().getScriptResource().getResourceResolver();
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 19/41: SLING-1011 : Adjust svn location

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 73f8ccd776d01764ffbae265b346ffe07a913065
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jun 18 10:26:35 2009 +0000

    SLING-1011 : Adjust svn location
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@786008 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index bccda65..a46760e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,9 +35,9 @@
     <description>Support for scripting Java</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/java</developerConnection>
-        <url>http://svn.apache.org/viewvc/incubator/sling/trunk/contrib/scripting/java</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-java] 17/41: Move Sling to new TLP location

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.java-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-java.git

commit 2cf48b52dbcb1ccd60d206b6eec1913da411033e
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Jun 18 09:21:02 2009 +0000

    Move Sling to new TLP location
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/scripting/java@785979 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.