users@glassfish.java.net

Re: documentation for osgi extensions?

From: Sahoo <Sahoo_at_sun.com>
Date: Wed, 07 Apr 2010 06:44:55 +0530

Erik Brakkee wrote:
>
>
> On Tue, Apr 6, 2010 at 11:01 PM, Alexis Moussine-Pouchkine <alexis.mp
> <http://alexis.mp>@sun.com <http://sun.com>> wrote:
>
> I haven't checked the docs but...
> - for EJB's as OSGi bundles, Sahoo's blog is the closest thing to
> "documentation" -
> http://weblogs.java.net/blog/ss141213/archive/2010/03/30/ejb-osgi-service-demo-eclipsecon
> (and others posts). This is work in progress and will require a
> recent build of GlassFish.
> - for injecting OSGi declarative services into Java EE managed
> objects, try
> http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4
> (works with GlassFish v3 final).
>
>
> Am I correct in assuming that the API jar is also not packaged with
> the war in the second example?
>
> Also, what happens if I only know the interface type of the OSGI
> service without knowing its name. Is it possible to do resource
> injection then as well?
I don't think so. We have to enhance our implementation of support for
@Resource of OSGi service. Currently, it has some limitations like it
does not work when the underlying service gets updated. We are currently
gathering feedback to see what needs to be done. In the mean while, can
I suggest you to use OSGi ServiceTracker to get hold of the service?
That way you are completely in OSGi land and I guess you already know
what to do.

Thanks,
Sahoo