You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Jean-Baptiste Onofré <jb...@nanthrax.net> on 2010/12/16 14:24:20 UTC

Best way to migrate EJB Session Stateful to an OSGi bundle

Hi all,

I'm migrating a JEE application suite (using EJB Entity, Session, MDB, 
JSP, Servlet, etc) to OSGi running on Apache Karaf/Apache Aries/Apache 
ServiceMix.

Currently, I have the following architecture

WebContainer
    JSP Views -> Servlet Controller
The controller makes a JNDI EJB lookup and RMI-IIOP call to
EJB Container
    Facade EJB Session Stateful -> EJB Entities (CMP/BMP)

The Facade is a EJB Session Stateful which is responsible to start the 
transaction (Required or RequiresNew) and store some informations.

In the HTTP session, I only store navigation informations, whereas in 
the Facade EJB, I store some business information (such as the user 
connected, etc).

The HTTP Session contains a handler to the Facade.

I wonder how to refactor the Facade EJB Session Stateful to an OSGi bundle.

Any help is welcome.

Thanks
Regards
JB

Re: Best way to migrate EJB Session Stateful to an OSGi bundle

Posted by Charles Moulliard <cm...@gmail.com>.
Hi JB,

I think that Blueprint already support Stateful service. Here is a 
presentation of the mechanism to be used

http://fusesource.com/docs/esb/4.3/esb_deploy_osgi/DeploySimple-Blueprint-Importing.html

A /reference list manager/ instance is created by the blueprint 
|reference-list| element. This element returns a list of service 
references and is the preferred approach for accessing /stateful/ 
services. Figure 9.2 
<http://fusesource.com/docs/esb/4.3/esb_deploy_osgi/DeploySimple-Blueprint-Importing.html#DeploySimple-Blueprint-Importing-FigLRSS> 
shows an overview of the model for accessing a stateful service using 
the reference list manager.

Regards,

Charles

On 17/12/10 10:36, Jean-Baptiste Onofré wrote:
> Hi David,
>
> thanks for your first feedback.
>
> My purpose is to avoid the usage of JEE, especially the EJBs. I would 
> like to replace my EJB by pure OSGi bundles, using Aries for JPA and 
> transactions.
>
> So my question is:
> - do we have an equivalent of EJB Session Stateful in OSGi (a kind of 
> stateful service) ?
> - I haven't seen that in the specification (core or compendium) but 
> maybe it's in the roadmap. If not, don't you think it can be part of 
> compendium spec ?
> - Maybe Apache Aries could provide this kind of module: stateful 
> service. I guess that the JEE application servers which use OSGi in 
> background (such as WebSphere 6, WebLogic 10 or Glassfish 3) have 
> implemented this feature to support EJB Session Stateful. I'm quite 
> sure that it's a plus value for Apache Aries to provide this kind of 
> module (we can name it "stateful OSGi services").
>
> WDYT ?
>
> Regards
> JB
>
> On 12/17/2010 04:17 AM, David Jencks wrote:
>> One possibility is to use geronimo 3.  It's by no means done or 
>> completely stable but except for web services most javaee 6 stuff is 
>> supported.  When you deploy a ee 6 artifact such as an ear it is 
>> transformed into an osgi bundle.
>>
>> How fine grained are the bundles you want to end up with?  Do you 
>> have ideas about how you want the ejbs to be accessed such as through 
>> javaee jndi or as osgi services?
>>
>> thanks
>> david jencks
>>
>> On Dec 16, 2010, at 5:24 AM, Jean-Baptiste Onofré wrote:
>>
>>> Hi all,
>>>
>>> I'm migrating a JEE application suite (using EJB Entity, Session, 
>>> MDB, JSP, Servlet, etc) to OSGi running on Apache Karaf/Apache 
>>> Aries/Apache ServiceMix.
>>>
>>> Currently, I have the following architecture
>>>
>>> WebContainer
>>>    JSP Views ->  Servlet Controller
>>> The controller makes a JNDI EJB lookup and RMI-IIOP call to
>>> EJB Container
>>>    Facade EJB Session Stateful ->  EJB Entities (CMP/BMP)
>>>
>>> The Facade is a EJB Session Stateful which is responsible to start 
>>> the transaction (Required or RequiresNew) and store some informations.
>>>
>>> In the HTTP session, I only store navigation informations, whereas 
>>> in the Facade EJB, I store some business information (such as the 
>>> user connected, etc).
>>>
>>> The HTTP Session contains a handler to the Facade.
>>>
>>> I wonder how to refactor the Facade EJB Session Stateful to an OSGi 
>>> bundle.
>>>
>>> Any help is welcome.
>>>
>>> Thanks
>>> Regards
>>> JB
>>

Re: Best way to migrate EJB Session Stateful to an OSGi bundle

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi David,

thanks for your first feedback.

My purpose is to avoid the usage of JEE, especially the EJBs. I would 
like to replace my EJB by pure OSGi bundles, using Aries for JPA and 
transactions.

So my question is:
- do we have an equivalent of EJB Session Stateful in OSGi (a kind of 
stateful service) ?
- I haven't seen that in the specification (core or compendium) but 
maybe it's in the roadmap. If not, don't you think it can be part of 
compendium spec ?
- Maybe Apache Aries could provide this kind of module: stateful 
service. I guess that the JEE application servers which use OSGi in 
background (such as WebSphere 6, WebLogic 10 or Glassfish 3) have 
implemented this feature to support EJB Session Stateful. I'm quite sure 
that it's a plus value for Apache Aries to provide this kind of module 
(we can name it "stateful OSGi services").

WDYT ?

Regards
JB

On 12/17/2010 04:17 AM, David Jencks wrote:
> One possibility is to use geronimo 3.  It's by no means done or completely stable but except for web services most javaee 6 stuff is supported.  When you deploy a ee 6 artifact such as an ear it is transformed into an osgi bundle.
>
> How fine grained are the bundles you want to end up with?  Do you have ideas about how you want the ejbs to be accessed such as through javaee jndi or as osgi services?
>
> thanks
> david jencks
>
> On Dec 16, 2010, at 5:24 AM, Jean-Baptiste Onofré wrote:
>
>> Hi all,
>>
>> I'm migrating a JEE application suite (using EJB Entity, Session, MDB, JSP, Servlet, etc) to OSGi running on Apache Karaf/Apache Aries/Apache ServiceMix.
>>
>> Currently, I have the following architecture
>>
>> WebContainer
>>    JSP Views ->  Servlet Controller
>> The controller makes a JNDI EJB lookup and RMI-IIOP call to
>> EJB Container
>>    Facade EJB Session Stateful ->  EJB Entities (CMP/BMP)
>>
>> The Facade is a EJB Session Stateful which is responsible to start the transaction (Required or RequiresNew) and store some informations.
>>
>> In the HTTP session, I only store navigation informations, whereas in the Facade EJB, I store some business information (such as the user connected, etc).
>>
>> The HTTP Session contains a handler to the Facade.
>>
>> I wonder how to refactor the Facade EJB Session Stateful to an OSGi bundle.
>>
>> Any help is welcome.
>>
>> Thanks
>> Regards
>> JB
>

Re: Best way to migrate EJB Session Stateful to an OSGi bundle

Posted by David Jencks <da...@yahoo.com>.
One possibility is to use geronimo 3.  It's by no means done or completely stable but except for web services most javaee 6 stuff is supported.  When you deploy a ee 6 artifact such as an ear it is transformed into an osgi bundle.

How fine grained are the bundles you want to end up with?  Do you have ideas about how you want the ejbs to be accessed such as through javaee jndi or as osgi services?

thanks
david jencks

On Dec 16, 2010, at 5:24 AM, Jean-Baptiste Onofré wrote:

> Hi all,
> 
> I'm migrating a JEE application suite (using EJB Entity, Session, MDB, JSP, Servlet, etc) to OSGi running on Apache Karaf/Apache Aries/Apache ServiceMix.
> 
> Currently, I have the following architecture
> 
> WebContainer
>   JSP Views -> Servlet Controller
> The controller makes a JNDI EJB lookup and RMI-IIOP call to
> EJB Container
>   Facade EJB Session Stateful -> EJB Entities (CMP/BMP)
> 
> The Facade is a EJB Session Stateful which is responsible to start the transaction (Required or RequiresNew) and store some informations.
> 
> In the HTTP session, I only store navigation informations, whereas in the Facade EJB, I store some business information (such as the user connected, etc).
> 
> The HTTP Session contains a handler to the Facade.
> 
> I wonder how to refactor the Facade EJB Session Stateful to an OSGi bundle.
> 
> Any help is welcome.
> 
> Thanks
> Regards
> JB