Hi Marco
I'm a long term equinox (Eclipse RCP) user and I perfectly know this
proprietary equinox feautre. To be honest I'd argue that if you need
this feature you most probably organized your dependency in a
non-optimal manner or even have a design issue. I used buddy policies in
my first osgi app and could always replace it by services / extension
points in later projects. It's most probably just a matter or organizing
your dependencies right or use services / extension-points right.
Furthermore I'd argue that using buddy policies are generally thougth as
non-optimal practice and should be avoided. Equinox implemented it to
allow a slow migration from Eclipse <3.0 plugin architecture towards OSGI.
Cheers
André
On 05/06/2010 08:06 PM, Marco หงุ่ยตระกูล-Schulze wrote:
Hi Richard,
thanks a lot for this quick response! Is it planned to implement buddy
class loading, soon? After some more research, I stumbled over the issue
https://issues.apache.org/jira/browse/FELIX-42 which mentions it, but is
open for about 4 years already.
Best regards, Marco :-)
On 05/06/2010 07:46 PM, Richard S. Hall wrote:
No, sorry, Felix doesn't support such a mechanism.
-> richard
On 5/6/10 13:09, Marco หงุ่ยตระกูล-Schulze wrote:
Hello *,
I'm new to Felix but use Eclipse already for a few years. Equinox
supports so-called buddy-class-loading. Does Felix have such a feature,
too? If so, how is it named? I looked for "felix buddy class loading",
but didn't find anything. Is it maybe simply called differently?
If it is not clear to you, what I mean by "buddy class loading", imagine
you have two plugins: my.bundle.a and my.bundle.b. my.bundle.a contains
a framework and my.bundle.b some implementation for it. Thus,
my.bundle.b would define a dependency on my.bundle.a (to import the
interfaces that are provided by the framework), but my.bundle.a would
know nothing about my.bundle.b.
There are situations (especially when integrating non-OSGi-aware systems
into an OSGi context), when the framework in my.bundle.a wants to
instantiate a class from my.bundle.b, but this is not possible as
there's no dependency in this direction. Thus, my.bundle.a would get a
ClassNotFoundException when taking the class name (that was maybe
somehow added to a configuration by my.bundle.b) and trying a
Class.forName(...).
Here comes buddy-class-loading into play: my.bundle.a would say that it
supports it by the following entry in its MANIFEST.MF:
Eclipse-BuddyPolicy: registered
my.bundle.b would declare a dependency on my.bundle.b and say that its
own classes should be available to my.bundle.a by having these two
entries in its MANIFEST.MF:
Require-Bundle: my.bunde.a
Eclipse-RegisterBuddy: my.bunde.a
The important thing is that my.bundle.a still does not reference
my.bundle.b anywhere (the framework must of course not know any of its
implementations), but is still able to load the (exported) classes from
my.bundle.b.
Further information about buddy class loading can be found here:
https://www.jfire.org/modules/phpwiki/index.php/Buddy%20and%20remote%20classloading
http://www.eclipsezone.com/articles/eclipse-vms/
Best regards, Marco :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]