On Mon, Mar 10, 2008 at 11:34 PM, Alan Cabrera <[EMAIL PROTECTED]> wrote:
> Is it possible for two different versions of a Fragment to be attached
>  to two different hosts?
If you define your version ranges accordingly, they act as the
attachment rules. So, yes it is possible.

>
>  Is it possible to attach a Fragment to a host that's already resolved?
sure.
>
>  IIUC, Fragments become resolved as a byproduct of the host, to which
>  it has been attached to, becoming resolved.  If this is true then
>  resolving Fragments should be essentially a do nothing operation?
Well, fragments don't have their own class loader and they are seen as
part of the host. I think the spec is not 100% precise here (unless I
overlooked something), but I suspect it to be the same behavior as
with updating of already attached fragments. Here the spec states that
the host has to be refreshed. The spec also states that attaching is
part of the resolving process of the host, so I guess the host has to
be resolved again, but I am not sure on that one. Maybe someone else
can answer that one better.

One thing I was always curious about is the resolving process together
with fragments. The spec states that the class path of the host has to
be searched first, so far so good, but how does this relate to the
whole lookup process? When we are using a fragment will first the
lookup process of the host finish from beginning to the end
(Import-Package --> Require-Bundle -->...) before the fragment is
asked or will it be like a ping pong affect (look for Import-Package
in the host before the fragment, then look for Require-Bundle in the
host before the fragment and so on). If the later is true, a fragment
can be used to replace an internal class by defining an Import-Package
(or Require-Bundle) statement and providing that one with a third
bundle. If so, this might be useful as a pattern in order to replace
corrupted implementations without violating licenses, because you do
not have to touch the 3rd party bundle. If it is the first behavior,
it is fine as well, because with that a bundle is more robust and
resistant against other potentially malicious bundles. It  would just
be good to know. Sorry for bringing up my question in your thread, but
I though it kinda fits in here.

cheers,
Mirko

>
>
>  Regards,
>  Alan
>
>  _______________________________________________
>  OSGi Developer Mail List
>  [email protected]
>  https://mail.osgi.org/mailman/listinfo/osgi-dev
>
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to