[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Directive for ExtensionClasspath

Tom Schindl is probably the best person to ask since he did the work to get javafx working.  I remember we went through a number of options before he landed on an acceptable solution.  I'm pretty sure the solution involved some equinox specific hook to grant access to the stuff on the extension class loader.

If I was implementing this today I probably would start with a 2 part solution.

1) Provide a 'shell' of a bundle that only contains a bundle manifest that exports the nashorn API a packages.  This bundle does not actually contain nashorn implementation, it is just used to virtualize the exported packages so that other bundles can use Import-Package to access them.  This bundle would also use a Require-Capability requirement that would require the functionality provided in part 2

2) Provide an equinox specific system.bundle fragment (using Fragment-Host against the Equinox BSN org.eclipse.osgi) and this extension would provide an implementation of the hook method org.eclipse.osgi.internal.hookregistry.ClassLoaderHook.createClassLoader(ClassLoader, EquinoxConfiguration, BundleLoader, Generation), but it would only return a non-null class loader for the 'shell' bundle from part 1.  I would probably also mark the 'shell' bundles from part 1 with a capability so you can easily identify them without hard coding the BSN of the 'shell' bundle here.  The class loader you return would use the extension class loader where nashorn is located as its parent classloader so it can load classes from it.  This fragment would also use Provide-Capability using some namespace you invent such that it can be required by the bundle in part 1.

This way when other bundles import-package for nashorn packages they will get wired to the 'shell' bundle but the ultimate class load would get delegated to the class loader you return from part 2.

Tom





From:        "Gorkem Ercan" <gorkem.ercan@xxxxxxxxx>
To:        equinox-dev@xxxxxxxxxxx
Date:        03/10/2016 09:50 AM
Subject:        [equinox-dev] Directive for ExtensionClasspath
Sent by:        equinox-dev-bounces@xxxxxxxxxxx




Hi,
While looking for a solution for using Nashorn which lives on the
extension classpath from Eclipse IDE, I was pointed to an old thread[1].
The thread discusses about Equinox-specific manifest directives that
would allow a Fragment to use extension classpath. However, I have
been researching and also looked through the equinox code and could not
find any reference that this discussion has materialized.
Can someone confirm my conclusion? I also welcome any ideas on how to
solve the extension classpath problem if that is the case.

[1]
https://dev.eclipse.org/mhonarc/lists/equinox-dev/msg07323.html

Thanks,
Gorkem
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev