users@glassfish.java.net

Re: Glassfish OSGi Deployer

From: Azubuko Obele <buko.obele_at_gmail.com>
Date: Wed, 4 May 2011 11:24:57 -0400

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> 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
>>
>>
>