users@glassfish.java.net

Re: Glassfish OSGi Deployer

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Wed, 04 May 2011 22:38:38 +0530

GlassFish already has necessary extenders which take care of detecting
existing web or ejb type bundles and deploying them in to EE runtime.
autodeploy/bundles/ is just one way to deploy OSGi bundles. You can
install and start using OSGi API directly and when the bundle is ready,
osgi-web-container or osgi-ejb-container will take care of deploying
them as web or ejb application. We don't support ear as OSGi bundle(s).
We are waiting for subsystem API to be implemented in OSGi framework to
implement that.

Take a look at some of our presentations on OSGi capabilities at [1],
especially [2] and main OSGi feature page [3]

Sahoo

[1] http://wikis.sun.com/display/GlassFish/PresoGfOsgi
[2]
http://www.slideshare.net/openblend/open-blend-2010-osgijavaee40sanjeeb-sahoo
[3] http://wikis.sun.com/display/GlassFish/Osgi

On Wednesday 04 May 2011 08:54 PM, Azubuko Obele wrote:
> Hey Sahoo,
>
> I'm focused on making things work in Eclipse. Essentially, what I
> would like to do is have OSGi bundles that are started in the same
> OSGi container as Glassfish to be auto-deployed as web applications or
> ear applications. I'd like to avoid doing any kind of copying to the
> glassfish filesystem or the like. This is the OSGi extender pattern. I
> have an extender that can (1) grab a reference to the GlassFishRuntime
> service when Glassfish is started in the OSGi container (2) monitor
> bundles starting that have the correct structure. The last piece I
> need is deploying these to the Glassfish runtime.
>
> I was looking at the Deployer API and was kind of confused. For one,
> (1) I couldn't find the OSGi bundle where the ScatteredWar and other
> classes are exported after looking high and low and (2) The Scattered
> APIs seem to assume that everything is stored somewhere on the
> filesystem. But in my case the resources and classes are stored in the
> OSGi Bundle itself.
>
> That's why I figured the best way to do this would be to write a
> custom Deployer...
>
> On Tue, May 3, 2011 at 8:49 PM, Sahoo <sanjeeb.sahoo_at_oracle.com
> <mailto:sanjeeb.sahoo_at_oracle.com>> wrote:
>
> It is a bit more complicated than what you have mentioned. Support
> for wars and EJB jars as OSGi bundles already exist; see
> osgi-web-container, osgi-ejb-container, etc. We have an RFE filed
> for deploying ear as osgi bundle or a set of osgi bundles. Why do
> you want to write them on their own?
>
> Thanks,
> Sahoo
>
> On Wednesday 04 May 2011 12:47 AM, Azubuko Obele wrote:
>
>
> Now that I've got GF running inside Eclipse I'd like to
> explore the possibility of deeper osgi integration.
> Specifically I'd like to be able to deploy wars and ears that
> are also osgi bundles. As far as I understand this would
> primarily be a matter of implementing the Deployer and Archive
> interfaces. This doesn't look to difficult but I wonder (1)
> what should I do once I have my Deployer interface done? Where
> can I register it? and (2) would it be possible to subclass
> the existing War Deployer and Ear Deployer and simply change
> how they load classes and resources?
>
> Thanks
>
>
>