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 (JIRA)" <ji...@apache.org> on 2009/07/06 21:55:14 UTC

[jira] Commented: (SLING-1007) Implement helper classloader

    [ https://issues.apache.org/jira/browse/SLING-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727733#action_12727733 ] 

Carsten Ziegeler commented on SLING-1007:
-----------------------------------------

Initial work of a dynamic class loader loading classes through package admin. In addition dynamic class loader providers can be registered. Revision: 791586

> Implement helper classloader
> ----------------------------
>
>                 Key: SLING-1007
>                 URL: https://issues.apache.org/jira/browse/SLING-1007
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons OSGi
>    Affects Versions: Commons OSGi 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Carsten Ziegeler
>
> Currently we require the ScriptEngine[Factory] implementation bundles to create bundle header
>    DynamicImport-Package: *
> to be able to access anything from the scripts since scripts are executed in the class loader of the script engine bundle.
> The downside of running the scripts in the class loader of the script engine bundle and using this global dynamic import are:
>   * scripts see internal classes of the script engine bundle
>   * scripts engine bundles must provide for classes for the scripts
>   * whenever a wire has been created for a script and the providing bundle is updated or uninstalled, the script engine bundle is also cycled.
> A better approach might be to provide a ClassLoader implementation which behind the scenes manages access to packages exported by the bundles installed in the system. I would imagine such an implementation along the following lines:
>   * Uses PackageAdmin to find a bundle providing the required class
>   * Copes with bundles being updated or uninstalled
> Maybe coping with bundles being updated or uninstalled requires a two level approach: a fronend class loader which answers the class and resource accesses by relaying to a backend class loader. The back end classloader does the hardwork of loading classes and resources by querying bundles. Whenever a bundle is updated or uninstalled the backend classloader gets replaced. A similar approach has been chosen for the Repository ClassLoader in the jcr/classloader bundle.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.