2 Replies Latest reply: Jan 9, 2012 5:10 AM by Thomas Diesler RSS

JBoss AS5 and OSGi ?

kensvebary Newbie

Hi!

 

I have a question.

And I was wondering if you could shed some light on it.

 

I have this application :

It runs on JBoss AS 5.1

It's a 4 layer architecture.

It uses JSF on presentational layer.

Other layers use EJB3 for Session Beans and Entity Beans(ORM mapping).

 

Application runs fine but the problem is in layers.

On each layer classes are not logically divided in any way.

They are all in the same two packages (one for interface and one for implementation on every layer).

You don't know who is calling who.

It's just so messy and very hard to debug and add new code.

 

So I wanted to introduce some order into this mess.

I heard about OSGi modularity, and so recently I started exploring OSGi framework for use in my application.

First I've read about 1/3 of the book : OSGi in Action (Manning Publications) to get the feel for the OSGi.

And now, I want to pass some of that newly found knowledge on my application.

But first, I need to set up my work environment.

 

I've read about JBoss OSGI 1.0.0 for JBoss AS7.

From my understanding this is more of an architectural approach on building JBoss AS7, rather than just implementation

of OSGi R4.2 specification.

So I don't think that I can make this work on my AS5.

 

But nevertheless, it doesn't hurt to ask :

 

Can I use JBoss OSGi 1.0.0 on JBoss AS5 ?

And if that is not possible, how can I use some other framework (Felix, Equinox, ...) on AS5 ?

Also, if anyone has some advice on how to implement just modular model in my application without other layers of OSGi (Lifecycle, Services, that would be nice to have, but what I trully need is just modularity) I would appreciate that very much.

 

Thans in advance!

 

Best regards,

Hrvoje Crnjak

  • 1. Re: JBoss AS5 and OSGi ?
    David Bosschaert Expert

    Hi Hrvoje,

    Hrvoje Crnjak wrote:

    From my understanding this is more of an architectural approach on building JBoss AS7, rather than just implementation

    of OSGi R4.2 specification.

     

    Actually, it's not 'more of an architectural approach'. JBoss OSGi in AS7 is a fully compliant implementation of the OSGi 4.2 specification. It's built on top of jboss-modules (which is the architectural approach you may be alluding to) to provide a tight integration with the rest of the application server. For more information see: http://www.jboss.org/jbossas/osgi

  • 2. Re: JBoss AS5 and OSGi ?
    Thomas Diesler Master

    Can I use JBoss OSGi 1.0.0 on JBoss AS5 ?

    No

     

    how can I use some other framework

    You can of course deploy a 3rd party OSGi framework on AS5 - I know of webapps that use OSGi internally. There will however be no integration at class loading level with any other parts of AS5

     

    how to implement just modular model in my application

     

    Have a look at jboss-modules, which is that modular approach for all deployments on AS7. There are plenty examples in the testsuite.

    OSGi is the standard approach to modularity - so I would still recommend that on AS7