users@glassfish.java.net

Re: hybrid OSGI+Web+EJB+JPA application

From: Sahoo <Sahoo_at_Sun.COM>
Date: Mon, 12 Oct 2009 09:16:50 +0530

Hi Maxim,

Sorry for the late reply. Pl. see reply in line...

glassfish_at_javadesktop.org wrote:
> First of all, I would like to appreciate Sahoo for his efforts in EJB, WEB and OSGI hybridization. I have a strong intention to use the benefits of the new approach, but some questions arose:
>
> 1. Currently (GF v3 b65), the WEB based administrative console has no information about deployed hybrid applications. Are you planning to extend the current abilities of the console to allow the user to see the installed hybrid applications?
>
This is largely because our admin console does not have any features for
administration of OSGi runtime. We wanted to do this in v3 release
(scheduled to release very soon), but because of lack of resource, we
could not achieve this. However, given that admin console in v3 is
extensible, this feature can be added even after the release.
> 2. Currently, the “asadmin” utility doesn’t allow to use a valid URL (only file system objects are allowed) to specify a module for deploy. Are you planning to extend the current abilities of the utility to allow this feature?
>
This will be a good feature to have in asadmin. Can you file an RFE? It
should be possible to easily extend asadmin to accept a URL which is
then interpreted only at the server side where appropriate URL handlers
can be installed for custom URL protocols.
> 3. Once hybrid OSGI bundle deployed, an ApplicationInfo instance created for it. That means there is no possibility to add an additional module to the existing application. Are you planning to extend the functionality of WEB-OSGI and deployment utility to allow changing the set of modules the running application consists of?
>
If you look at the code for OSGi Web Container, you shall see that upon
update of an OSGi bundle, we redeploy the underlying Java EE artifact,
so everything that a redeploy allows is theoritically possible via a
bundle update. Given that it requires stopping of currently deployed
app, I guess this is not what you are looking for.
> 4. The problem is that currently, the hybrid OSGI+WEB+EJB bundle must be packet into one single bundle, an analog of EAR. Are you planning to extend the functionality of the deployment module to allow the installation of OSGI modules from Maven repositories with resolving (and installing) of referenced\dependent modules? There is an external OSGI module called PAX URL(http://wiki.ops4j.org/display/paxurl/Pax+URL) that allows installing OSGI bundles from Maven repository with using of osgi console but it doesn’t process the referenced modules.
>
I am not sure why you raised the issue of WAR/EAR packaging in the above
paragraph. I don't see the connection between them and your subsequent
question of installing a bundle and its dependencies from maven. We
currently only support WAR packaging as that's getting standardised in
the OSGi enterprise spec. We are thinking of EAR case as well.

Installing bundles and its dependencies from maven can probably be
addressed via OBR.
> 5. Are you planning to implement JPA support as a part of GF v3 for hybrid modules by the following way: the newly installed (redeployed) bundle would extend the existing Persistent Unit(s) with the new classes, or it would cause the new PU creation. “Dynamic JPA” project (http://www.dynamicjava.org/projects/dynamic-jpa) is a good sample of this approach implementation;
>
>
Currently I am investigating use of JPA in hybrid applications. Since
class file transformation is still an open issue in OSGi environment, I
have not made a lot of progress here.

DynamicJPA project sounds very interesting, but I don't understand what
a container has to do here. You should be able to use it even now in
GFv3, right?
> 6. Are you planning to implement the possibility of EJB container and services launching in “pure” OSGI environment?
>
What exactly you mean by pure OSGi environment? GlassFish does not use
any custom OSGi runtime. It is possible to launch GF bundles in an
existing OSGi runtime. What is currently lacking is launching of
individual containers like ejb-container or web-container. I guess
that's a question for individual container owners. I don't know what
their plans are.

Once again, thanks for your comments. Keep them coming.

Thanks,
Sahoo