You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (Created) (JIRA)" <ji...@apache.org> on 2012/03/23 15:51:27 UTC

[jira] [Created] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

ClassLoaderWriter should provide class loader for loading written classes/resources
-----------------------------------------------------------------------------------

                 Key: SLING-2447
                 URL: https://issues.apache.org/jira/browse/SLING-2447
             Project: Sling
          Issue Type: New Feature
          Components: Commons, JCR, Scripting
    Affects Versions: Commons ClassLoader 1.2.4, Commons Compiler 2.0.2, JCR Classloader 3.1.4, Scripting Java 2.0.2, Scripting JSP 2.0.20
            Reporter: Carsten Ziegeler
            Assignee: Carsten Ziegeler
             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6


As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.

The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.

The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238756#comment-13238756 ] 

Carsten Ziegeler commented on SLING-2447:
-----------------------------------------

Creating a new session is pretty fast and should add no real overhead - and even if, classes are loaded usually only once and therefore it wouldn't even matter if creating a new session would decrease the class loading a little bit. In addition, compared to class generation and compilation this can be neglected anyway.
                
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-2447.
-------------------------------------

    Resolution: Fixed

Setting this to fixed now after some further testing
                
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238737#comment-13238737 ] 

Carsten Ziegeler commented on SLING-2447:
-----------------------------------------

I rewrote the classloader to use a session on demand instead of keeping a session open for the whole time. This has mainly two reasons: it simplifies the implementation and is in anticipation of JR3 where potentially either a session refresh is required or a new session should be used .
                
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238468#comment-13238468 ] 

Carsten Ziegeler commented on SLING-2447:
-----------------------------------------

Fixed the test case problem (resource loading was wrongly implemented)
                
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-2447.
-----------------------------------

    
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.3.0
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271631#comment-13271631 ] 

Carsten Ziegeler commented on SLING-2447:
-----------------------------------------

Added another improvement: don't load bytes when url for a resource is requested and don't invalidate classloader for changed resources
                
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236675#comment-13236675 ] 

Carsten Ziegeler commented on SLING-2447:
-----------------------------------------

This seems to break one of our test cases, I'll have to investigate
                
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2447) ClassLoaderWriter should provide class loader for loading written classes/resources

Posted by "Carsten Ziegeler (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236651#comment-13236651 ] 

Carsten Ziegeler commented on SLING-2447:
-----------------------------------------

Committed a first version in revision 1304395

Apart from the mentioned changes, I rewrote the jcr classloader and removed all unused stuff as there seem to be some problems with marking the class loader as dirty in some cases.
The new version is clearer and should do the trick
                
> ClassLoaderWriter should provide class loader for loading written classes/resources
> -----------------------------------------------------------------------------------
>
>                 Key: SLING-2447
>                 URL: https://issues.apache.org/jira/browse/SLING-2447
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons, JCR, Scripting
>    Affects Versions: Scripting JSP 2.0.20, Scripting Java 2.0.2, JCR Classloader 3.1.4, Commons Compiler 2.0.2, Commons ClassLoader 1.2.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.22, Scripting Java 2.0.4, JCR Classloader 3.1.6, Commons Compiler 2.0.4, Commons ClassLoader 1.2.6
>
>
> As a follow up to SLING-2445 the ClassLoaderWriter should be enhanced to return a class loader which can be used to load the dynamically loaded classes written through this writer.
> This writer should use the dynamic class loader as a parent and implement the DynamicClassLoader interface which allows to check if the class loader is still current.
> The returned classloader should not be cached by clients, they should just get the class loader each time they require one. The writer ensures that always a fresh loader is returned.
> The java and jsp scripting should use this class loader instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira