[EMAIL PROTECTED] wrote on 06/06/2008 08:04:22 AM:
>
> Please respond to OSGi Developer Mail List
>
> Hi,
>
> I’m attempting to implement a fragment exemplary application in
> which a fragment package class <<extends>> a host service method…
> yeah, I’m probably a bit out of my league ATT… Also, apparently (as
> I read on the spring-DM guide) Felix does not [yet, presume] support
> fragments? It seems that Felix is ignoring my “Fragment-Host:” manifest
entry…
>
> So, a couple questions as I decide to move to pax-run and either
> equinox (cringe) or knoplerfish…
equinox (cringe), thanks, that really motivates any of the equinox team
to help you!!
>
> Can I actually do inheritance/override of a base service method in a
> fragment? Keep in mind, too, that I’m using SCR/DeclarativeServices
I do not completely understand. Are you trying to change the
implementation/behavior of a method from a class in a host bundle
without extending that class?
The only way to currently do this is to have an entry in the host bundle
class path and have the content provided by a fragment instead of
the host bundle. This is described in section 3.8.1 of the core spec.
This will allow you to insert a jar from the fragment bundle in
front of the content supplied by the host. This will allow you
to replace the complete class in which you are trying to override
the method for.
But if you just need to do simple inheritance of a class from
a host bundle then it is no problem. Classes from fragment bundles
are allowed to extend classes from their hosts.
Another option would be to use the AspectJ adaptor from equinox to
loadtime weave your changes to the host bundle. But I imagine that
will make you cringe also :)
>
> I can provide source/dot.bnd’s etc… Note – I do keep client, base,
> and fragment code in separate packages (meaning, there is zero
> split-packaging going on);
Well, if you use a fragment to replace a class from the host then
you must use the same package as the host class you are replacing.
Also if you are extending a package private class or overriding
a package private method then you must provide your class in the
same package as the class you are extending.
>
> Thanks, Craig
Tom.
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev