Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Loading classes dynamically form other plugins
Loading classes dynamically form other plugins [message #444814] Tue, 21 February 2006 15:13 Go to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I've got the following structure:
---------------------------------
- CustomerPlugin (dep. on BasicLibsProject)
- BasicLibsPlugin

Inside BasicLibs I want to load classes from CustomerPlugin dynamically
but it's not working because BasicLibsProject does not find classes
located in plugins it doesn't depends on. Is this somehow possible?

Tom
Re: Loading classes dynamically form other plugins [message #444819 is a reply to message #444814] Tue, 21 February 2006 15:29 Go to previous messageGo to next message
Stefan Zugal is currently offline Stefan ZugalFriend
Messages: 59
Registered: July 2009
Member
The problem is that every plugin has its own classloader.
This classloader is especially designed to find classes quickly whithin
the own plugin and plugins it depends on.

So you could try to get the classloader from the CustomerPlugin by
CustomerPlugin.class.getClassLoader() and load the classes with this
class loader. :-)

I think it should work that way.

Regards,
Stefan

Tom Schindl schrieb:
> Hi,
>
> I've got the following structure:
> ---------------------------------
> - CustomerPlugin (dep. on BasicLibsProject)
> - BasicLibsPlugin
>
> Inside BasicLibs I want to load classes from CustomerPlugin dynamically
> but it's not working because BasicLibsProject does not find classes
> located in plugins it doesn't depends on. Is this somehow possible?
>
> Tom
Re: Loading classes dynamically form other plugins [message #444821 is a reply to message #444819] Tue, 21 February 2006 16:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
The moment you posted you're answer I found the answer myself. Nice to
see other people using RCP in Innsbruck.

http://www.martinlippert.com/publications/JS-Classloading-in -Eclipse-final-web.pdf

Greetings from the Rossau ;-)

Tom

Stefan Zugal wrote:
> The problem is that every plugin has its own classloader.
> This classloader is especially designed to find classes quickly whithin
> the own plugin and plugins it depends on.
>
> So you could try to get the classloader from the CustomerPlugin by
> CustomerPlugin.class.getClassLoader() and load the classes with this
> class loader. :-)
>
> I think it should work that way.
>
> Regards,
> Stefan
>
> Tom Schindl schrieb:
>
>> Hi,
>>
>> I've got the following structure:
>> ---------------------------------
>> - CustomerPlugin (dep. on BasicLibsProject)
>> - BasicLibsPlugin
>>
>> Inside BasicLibs I want to load classes from CustomerPlugin dynamically
>> but it's not working because BasicLibsProject does not find classes
>> located in plugins it doesn't depends on. Is this somehow possible?
>>
>> Tom
Re: Loading classes dynamically form other plugins [message #444822 is a reply to message #444819] Tue, 21 February 2006 16:04 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
The moment you posted you're answer I found the answer myself. Nice to
see other people using RCP in Innsbruck.

http://www.martinlippert.com/publications/JS-Classloading-in -Eclipse-final-web.pdf

Greetings from the Rossau ;-)

Tom

Stefan Zugal wrote:
> The problem is that every plugin has its own classloader.
> This classloader is especially designed to find classes quickly whithin
> the own plugin and plugins it depends on.
>
> So you could try to get the classloader from the CustomerPlugin by
> CustomerPlugin.class.getClassLoader() and load the classes with this
> class loader. :-)
>
> I think it should work that way.
>
> Regards,
> Stefan
>
> Tom Schindl schrieb:
>
>> Hi,
>>
>> I've got the following structure:
>> ---------------------------------
>> - CustomerPlugin (dep. on BasicLibsProject)
>> - BasicLibsPlugin
>>
>> Inside BasicLibs I want to load classes from CustomerPlugin dynamically
>> but it's not working because BasicLibsProject does not find classes
>> located in plugins it doesn't depends on. Is this somehow possible?
>>
>> Tom
Previous Topic:Running an RCP outside Eclipse
Next Topic:How do I add Console view.
Goto Forum:
  


Current Time: Sat Nov 02 12:03:46 GMT 2024

Powered by FUDForum. Page generated in 0.04268 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top