Re: Dynamic extensions in 3.2 with custom class loader [message #91931] |
Wed, 11 July 2007 13:03 |
|
JP Moresmau wrote:
> Hello all, I'm trying to programmatically add extensions to a running
> Eclipse. I've used addContribution on the extensionRegistry, but it loads
> all the classes it needs from the plugin used as a contributor. What I want
> to do is to load classes from outside Eclipse, using a custom class loader
> that is not the plugin class loader. How do I do that in 3.2? I could do it
> in 3.0 by using the internal API (ok, so it's not an API if it's internal,
> I've been bold): creating Extension objects and their ConfigurationElements,
> and overloading ConfigurationElement.createExecutableExtension() to provide
> the actual instance of the object from my own class loader. But that code
> doesn't work anymore and I'm not sure there's a replacement (I don't mind
> using internal classes if there is no other way to do it).
>
> Thanks for any pointer!
If you have to dynamically inject classes into your bundle, I would
think that you could so it using OSGi/equinox hooks. Check out
org.eclipse.osgi.baseadaptor.hooks.ClassLoadingHook and its
implementers. That might enable you to farm out the loading of your
class without overriding any internal API.
Also, the kindly people in eclipse.technology.equinox might be able to
help/give you some direction.
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: Dynamic extensions in 3.2 with custom class loader [message #92083 is a reply to message #91931] |
Fri, 13 July 2007 14:23 |
Eclipse User |
|
|
|
Originally posted by: jp.moresmau.fr
Thanks, is there any code sample anywhere that shows how to add
programmatically a jar to my plugin class loader anywhere? The documentation
on ClassLoadingHook is quite sparse. I was hoping it would be a simple
enough operation...
JP
"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:f72k6h$3nv$1@build.eclipse.org...
> JP Moresmau wrote:
>> Hello all, I'm trying to programmatically add extensions to a running
>> Eclipse. I've used addContribution on the extensionRegistry, but it loads
>> all the classes it needs from the plugin used as a contributor. What I
>> want to do is to load classes from outside Eclipse, using a custom class
>> loader that is not the plugin class loader. How do I do that in 3.2? I
>> could do it in 3.0 by using the internal API (ok, so it's not an API if
>> it's internal, I've been bold): creating Extension objects and their
>> ConfigurationElements, and overloading
>> ConfigurationElement.createExecutableExtension() to provide the actual
>> instance of the object from my own class loader. But that code doesn't
>> work anymore and I'm not sure there's a replacement (I don't mind using
>> internal classes if there is no other way to do it).
>>
>> Thanks for any pointer!
>
> If you have to dynamically inject classes into your bundle, I would think
> that you could so it using OSGi/equinox hooks. Check out
> org.eclipse.osgi.baseadaptor.hooks.ClassLoadingHook and its implementers.
> That might enable you to farm out the loading of your class without
> overriding any internal API.
>
> Also, the kindly people in eclipse.technology.equinox might be able to
> help/give you some direction.
>
> Later,
> PW
|
|
|
|
Powered by
FUDForum. Page generated in 0.03831 seconds