Buddy Policy Question [message #86199] |
Wed, 04 April 2007 20:05  |
Eclipse User |
|
|
|
Originally posted by: abhijit.sawant.ca.com
I've noticed that not only classes but also any other resources
available in a bundle become available to a bundle that has a "dependent"
buddy policy (Eclipse-BuddyPolicy: dependent).
So for instance, say I have a bundle named base.bundle that specifies it
uses dependent buddy policy, and I have a bundle named dependent.bundle
that depends on base.bundle, a resource such as META-INF/aop.xml from
dependent.bundle will be visible to base.bundle.
My first question is if this is by design or a bug? The reason it could
be a bug is that I see no way of making a resource that is not a class
available to a dependent bundle via the "Export-Package" mechanism (if
there is, please let me know), and therefore, by analogy I'd expect that
this would not work in the buddy model either.
For those familiar with AOSGI, what ends up happening because of this is
that the base.bundle gets weaved at runtime with its dependent bundle's
aspects, something that is not desirable (at least in my case).
Thnx.
|
|
|
Re: Buddy Policy Question [message #86292 is a reply to message #86199] |
Thu, 05 April 2007 01:37   |
Eclipse User |
|
|
|
Hi,
Reading the javadoc for Bundle.getResource() it seems that if the bundle
is resolved, the imported packages will be searched too, so I think it
is possible to make resources available to other bundles via Export-Package.
In the case for Eclipse-BuddyPolicy I don't think it is strange that
resource are shared too. I'm not familiar with AspectJ, but it is enough
to provide META-INF/aop.xml in your bundle, in order to load the correct
aop.xml. The buddy policy is asked for a resource if it is not found in
the bundle classpath (imported packages and local classes).
Danail
Abhijit Sawant wrote:
> I've noticed that not only classes but also any other resources
> available in a bundle become available to a bundle that has a
> "dependent" buddy policy (Eclipse-BuddyPolicy: dependent).
> So for instance, say I have a bundle named base.bundle that specifies
> it uses dependent buddy policy, and I have a bundle named
> dependent.bundle that depends on base.bundle, a resource such as
> META-INF/aop.xml from dependent.bundle will be visible to base.bundle.
> My first question is if this is by design or a bug? The reason it could
> be a bug is that I see no way of making a resource that is not a class
> available to a dependent bundle via the "Export-Package" mechanism (if
> there is, please let me know), and therefore, by analogy I'd expect that
> this would not work in the buddy model either.
> For those familiar with AOSGI, what ends up happening because of this
> is that the base.bundle gets weaved at runtime with its dependent
> bundle's aspects, something that is not desirable (at least in my case).
>
> Thnx.
>
|
|
|
|
|
Re: Buddy Policy Question [message #86512 is a reply to message #86472] |
Tue, 10 April 2007 21:11  |
Eclipse User |
|
|
|
Originally posted by: abhijit.sawant.ca.com
Danail,
You are absolutely right, that would work. The problem with this
approach is two fold though. First, this would be a hack (forcing a dummy
aop.xml to avoid using the dependent bundle's file). Secondly, I don't own
or control all of the base bundles (they are developed by other teams and
some might even be third party bundles), so I'd have to "post process" the
bundles and add content (not an elegant solution - so again, hacky).
Thanks,
Abhijit
|
|
|
Powered by
FUDForum. Page generated in 0.04317 seconds