Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » How to load class with its bundle's classloader ?
How to load class with its bundle's classloader ? [message #100073] Fri, 19 October 2007 10:38 Go to next message
Eclipse UserFriend
Originally posted by: sf.tragwerk-dresden.de

Hi,

please imagine the following situation:


Plugin A
^
Plugin C |
^ |
| |
| |
| |
Plugin B


1. Plugin B depends on A and C where A knows nothing about C.
2. Plugin B contributes a Classname via an extension point to A.
3. This class is located inside Plugin C.

How can I load this class from Plugin A with its own BundleClassLoader (
C ) ?
I only know that Bundle B must know about the class.

Sebastian
Re: How to load class with its bundle's classloader ? [message #100088 is a reply to message #100073] Fri, 19 October 2007 11:15 Go to previous messageGo to next message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
Hi,

It should be enough to just import the package where the class resides
from Plugin C.

Sebastian Fuchs wrote:
> Hi,
>
> please imagine the following situation:
>
>
> Plugin A
> ^
> Plugin C |
> ^ |
> | |
> | |
> | |
> Plugin B
>
>
> 1. Plugin B depends on A and C where A knows nothing about C.
> 2. Plugin B contributes a Classname via an extension point to A.
> 3. This class is located inside Plugin C.
>
> How can I load this class from Plugin A with its own BundleClassLoader (
> C ) ?
> I only know that Bundle B must know about the class.
>
> Sebastian
Re: How to load class with its bundle's classloader ? [message #100102 is a reply to message #100088] Fri, 19 October 2007 13:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sf.tragwerk-dresden.de

Hi Danial,

you are right.

Calling
bundleB.loadClass(hidden.in.bundle_c.ClassName);
from A works.

Don't know what went wrong the last time.
Thank you.

Sebastian


Danail Nachev schrieb:
> Hi,
>
> It should be enough to just import the package where the class resides
> from Plugin C.
>
> Sebastian Fuchs wrote:
>> Hi,
>>
>> please imagine the following situation:
>>
>>
>> Plugin A
>> ^
>> Plugin C |
>> ^ |
>> | |
>> | |
>> | |
>> Plugin B
>>
>>
>> 1. Plugin B depends on A and C where A knows nothing about C.
>> 2. Plugin B contributes a Classname via an extension point to A.
>> 3. This class is located inside Plugin C.
>>
>> How can I load this class from Plugin A with its own BundleClassLoader (
>> C ) ?
>> I only know that Bundle B must know about the class.
>>
>> Sebastian
Re: How to load class with its bundle's classloader ? [message #100147 is a reply to message #100073] Mon, 22 October 2007 06:48 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Sebastian Fuchs wrote:
> 1. Plugin B depends on A and C where A knows nothing about C.
> 2. Plugin B contributes a Classname via an extension point to A.
> 3. This class is located inside Plugin C.

Did you try #createExecutableExtension?
http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/runtime/IConfigurationE lement.html#createExecutableExtension(java.lang.String)

-Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: How to load class with its bundle's classloader ? [message #100162 is a reply to message #100147] Mon, 22 October 2007 07:52 Go to previous message
Eclipse UserFriend
Originally posted by: sf.tragwerk-dresden.de

Thank you Gunnar,

I know about creatExecutableExtension, but this is not exactly what I
need. I need more control over time and circumstances when a class is
loaded.

Sebastian


Gunnar Wagenknecht schrieb:
> Sebastian Fuchs wrote:
>> 1. Plugin B depends on A and C where A knows nothing about C.
>> 2. Plugin B contributes a Classname via an extension point to A.
>> 3. This class is located inside Plugin C.
>
> Did you try #createExecutableExtension?
> http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/runtime/IConfigurationE lement.html#createExecutableExtension(java.lang.String)
>
> -Gunnar
>
Previous Topic:AdapterHooks: BundleFileWrapperFactoryHook is ignored
Next Topic:Commons logging / log4j : ClassNotFound in JSP when using embedded Jetty/Jasper
Goto Forum:
  


Current Time: Sat Nov 09 04:08:31 GMT 2024

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

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

Back to the top