users@glassfish.java.net

Re: Question about webapps connecting to OSGI Services

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Sat, 11 Jun 2011 08:37:51 +0530

Embedded GlassFish does support OSGi; what's mentioned in [1] is that
the all-in-one-jar version of embedded glassfish distribution is not
capable of being activated in an OSGi runtime. The process of embedding
GF in OSGi runtime is much much simpler and is documented in [3] as well.

Edgar,

Please look at [3] and you shall find plenty of materials that talks
about use of OSGi services from your web apps.

Sahoo

On Friday 10 June 2011 11:37 PM, forums_at_java.net wrote:
> I haven't tried this myself, but at least I can give you some pointers:
>
> AFAIK, *Embedded* Glassfish does not (fully) support OSGi, see this
> thread
> [1] for a discussion.
>
> Is your web app deployed as a plain old WAR or as an OSGi bundle? If
> it's a
> WAR, it won't be treated as a bundle, so the activator won't help, I
> assume.
> In this case, CDI injection with the @OSGiService extension [2] should do
> the trick. If it's a bundle, then of course you can use a bundle
> activator or
> Declarative Services as usual.
>
> The latest and most complete documentation of OSGi features in
> Glassfish has
> just been published [3] in a document by Sanjeeb Sahoo.
>
> Hope that helps,
>
> Harald
>
>
>
>
>
>
>
>
> [1]
> http://www.java.net/forum/topic/glassfish/glassfish/glassfish-31-embedded-osgi
> [2]
> http://blogs.oracle.com/arungupta/entry/totd_154_dynamic_osgi_services
> [3]
> http://blogs.oracle.com/theaquarium/entry/osgi_glassfish_the_definitive_guide
>
> --
>
> [Message sent by forum member 'hwellmann']
>
> View Post: http://forums.java.net/node/811646
>
>