Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » Using RemoteServices & EJB Container?
Using RemoteServices & EJB Container? [message #533930] Mon, 17 May 2010 14:02 Go to next message
Hannes Mintz is currently offline Hannes MintzFriend
Messages: 4
Registered: May 2010
Junior Member
Hi!

At first congrats to a good framework idea.

I am especially interested in the RemoteService architecture. Maybe you can give me some best practices facing RemoteServices in conjunction with access to EJB's. My idea is to combine the Riena RemoteServices as client-server interface in oder to access a classic JEE5 or JEE6 server environment (with JBoss if possible). Are there any best practices how to realize such a solution? Or maybe you can give me some hints how you implement your RemoteServices to handle your business processes?

Thanks in advance!

Kind regards
Hannes Mintz

[Updated on: Mon, 17 May 2010 16:26]

Report message to a moderator

Re: Using RemoteServices & EJB Container [message #534492 is a reply to message #533930] Wed, 19 May 2010 10:57 Go to previous messageGo to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Hi Hannes,

I am glad you like it :-). We use Remote Services with the Hessian protocol from www.caucho.com.

You can of course run Riena (the server parts of it) with equinox and its server parts. That runs in the embedded Jetty
or Tomcat or JBoss or any J2EE compliant Webcontainer or application server.

A good recommendation from me would be to avoid all J2EE stuff on the client but use Riena's remote service to the
server and from there you can use EJBs, SOA or whatever fits you best.

There are number of pages and wikis under the name server-side eclipse or server-side equinox where you can find a
description how to setup a .WAR for equinox (I just googled this one
http://www.javaworld.com/javaworld/jw-06-2008/jw-06-osgi3.ht ml but I am sure there are many others)

Remote Services are really just OSGi Services that happen to be on the server and are therefore remote (from the
client). There is a Riena bundle org.eclipse.riena.server that contains all bundles that need for riena on the server.

I highly recommend that you minimize the number of remote service calls per mouse click. So dont necessarily reuse
existing OSGi Services (that were created for other purposes) but write a remote service interface that fits best to
supply the data that you need for the action that the user required in this moment. So searching in a customer database
is a good example. If the search result contains 20 entries, dont load the complete customer record and return an array
of 20 customer records in the Remote Service but rather create Transport Value Object (PoJo's basically) that contain
the fields that are displayed for the result on the table and only when the user decide to load a specific record then
you load that customer record (using another remote service call). So taylor the remote service to your needs in the UI.

That minimizes the database access and also minimizes the usage of bandwidth.

Any more questions that I can answer ? Let me know

christian



Am 17.05.10 16:02, schrieb hannes.mintz@gmail.com:
> Hi!
>
> At first congrats to a good framework idea.
> I am especially interested in the RemoteService architecture. Maybe you
> can give me some best practices facing RemoteServices in conjunction
> with access to EJB's. My idea is to combine the Riena RemoteServices as
> client-server interface in oder to access a classic JEE5 or JEE6 server
> environment (with JBoss if possible). Are there any best practices how
> to realize such a solution? Or maybe you can give me some hints how you
> implement your RemoteServices to process your business processes?
> Thanks in advance!
>
> Kind regards
> Hannes Mintz
Re: Using RemoteServices & EJB Container [message #534514 is a reply to message #534492] Wed, 19 May 2010 12:07 Go to previous messageGo to next message
Hannes Mintz is currently offline Hannes MintzFriend
Messages: 4
Registered: May 2010
Junior Member
Hi Christian!

Just to be sure:

So I would have to take the Riena server parts and pack them in a WAR-File and deploy it to JBoss with specific configurations. From there (RemoteServices) I call my SessionBeans. Therefore the RemoteServices are in a way my Session Facade. Am I right?

Are the Riena server parts just based on OSGI or do they use eclipse specific extension points? I ask this question because I found the JBoss OSGI project (http://community.jboss.org/wiki/jbossosgi) which sounds interesting in deploying OSGI Services to JBoss. Maybe that's also a possibility to deploy the Riena RemoteServices.

Kind regards
Hannes
Re: Using RemoteServices & EJB Container [message #534800 is a reply to message #534514] Thu, 20 May 2010 10:50 Go to previous message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Am 19.05.10 14:07, schrieb Hannes Mintz:
> Hi Christian!
>
> Just to be sure:
>
> So I would have to take the Riena server parts and pack them in a
> WAR-File and deploy it to JBoss with specific configurations. From there
> (RemoteServices) I call my SessionBeans. Therefore the RemoteServices
> are in a way my Session Facade. Am I right?
Right, the remote service (OSGi service on the server) calls the EJB Session Bean. Its a facade to the session bean and
of course it could also call multiple methods or multiple Session Beans during one remote service call. But thats
something you decided. Either the methods in the Remote Service are just 1:1 facades of the EJB Session methods or they
are tailored to the requirments in your Riena client which means the Remote Service possibly collects the data from
multiple calls to different EJB session beans.
>
> Are the Riena server parts just based on OSGI or do they use eclipse
> specific extension points? I ask this question because I found the JBoss
> OSGI project (http://community.jboss.org/wiki/jbossosgi) which sounds
> interesting in deploying OSGI Services to JBoss. Maybe that's also a
> possibility to deploy the Riena RemoteServices.
The Riena Server Parts are OSGi based components. So they need Equinox or something (we only tested Equinox so far). As
you may know all major Application Services (JBoss, BEA, Webshere etc.) are using an OSGi Kernel for themselves. So in
the past for an Riena Server in an Appserver environment you had the OSGi system that the Appserver uses and the one
that you uses. And while that is possible it is not always painless because i.e. there is only one set of System
properties for both OSGi kernels. So know I believe (and I didnt check that page) that the Appservers are starting to
make their OSGi Kernel usable by OSGi based components without adding a second OSGi Kernel.

For the Riena server parts to work you need the BridgeServlet in the .war file which basically picks up all servlet
requests (for this .war) and dispatches them to the ProxyServlet. On the way it switches the Classloader in the
ThreadContext from the one that the Appserver uses to the one that Equinox (in your war) uses. The ProxyServlet
dispatches it to a Http Adapter which then checks for an extension where you can specify different Servlets for
different aliases (pretty much what you do in web.xml in a normal .war). Riena has such an extension for /hessian where
it finds RienaHessionDispatcherServlet which then does the unmarshelling, calls the OSGi service, marshall reply. And
then all the way back through the chain where the Thread context classloader is set back to the one from the appserver....

And to answer the other question. I think it would be a good way to do the alternative and use jbossosgi. Its just that
we havnt tried that yet. If find anything out that works (or doesnt) let us know.

hope that helps
christian




>
> Kind regards
> Hannes
Re: Using RemoteServices & EJB Container [message #585563 is a reply to message #534492] Wed, 19 May 2010 12:07 Go to previous message
Hannes Mintz is currently offline Hannes MintzFriend
Messages: 4
Registered: May 2010
Junior Member
Hi Christian!

Just to be sure:

So I would have to take the Riena server parts and pack them in a WAR-File and deploy it to JBoss with specific configurations. From there (RemoteServices) I call my SessionBeans. Therefore the RemoteServices are in a way my Session Facade. Am I right?

Are the Riena server parts just based on OSGI or do they use eclipse specific extension points? I ask this question because I found the JBoss OSGI project (http://community.jboss.org/wiki/jbossosgi) which sounds interesting in deploying OSGI Services to JBoss. Maybe that's also a possibility to deploy the Riena RemoteServices.

Kind regards
Hannes
Re: Using RemoteServices & EJB Container [message #585600 is a reply to message #585563] Thu, 20 May 2010 10:50 Go to previous message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Am 19.05.10 14:07, schrieb Hannes Mintz:
> Hi Christian!
>
> Just to be sure:
>
> So I would have to take the Riena server parts and pack them in a
> WAR-File and deploy it to JBoss with specific configurations. From there
> (RemoteServices) I call my SessionBeans. Therefore the RemoteServices
> are in a way my Session Facade. Am I right?
Right, the remote service (OSGi service on the server) calls the EJB Session Bean. Its a facade to the session bean and
of course it could also call multiple methods or multiple Session Beans during one remote service call. But thats
something you decided. Either the methods in the Remote Service are just 1:1 facades of the EJB Session methods or they
are tailored to the requirments in your Riena client which means the Remote Service possibly collects the data from
multiple calls to different EJB session beans.
>
> Are the Riena server parts just based on OSGI or do they use eclipse
> specific extension points? I ask this question because I found the JBoss
> OSGI project (http://community.jboss.org/wiki/jbossosgi) which sounds
> interesting in deploying OSGI Services to JBoss. Maybe that's also a
> possibility to deploy the Riena RemoteServices.
The Riena Server Parts are OSGi based components. So they need Equinox or something (we only tested Equinox so far). As
you may know all major Application Services (JBoss, BEA, Webshere etc.) are using an OSGi Kernel for themselves. So in
the past for an Riena Server in an Appserver environment you had the OSGi system that the Appserver uses and the one
that you uses. And while that is possible it is not always painless because i.e. there is only one set of System
properties for both OSGi kernels. So know I believe (and I didnt check that page) that the Appservers are starting to
make their OSGi Kernel usable by OSGi based components without adding a second OSGi Kernel.

For the Riena server parts to work you need the BridgeServlet in the .war file which basically picks up all servlet
requests (for this .war) and dispatches them to the ProxyServlet. On the way it switches the Classloader in the
ThreadContext from the one that the Appserver uses to the one that Equinox (in your war) uses. The ProxyServlet
dispatches it to a Http Adapter which then checks for an extension where you can specify different Servlets for
different aliases (pretty much what you do in web.xml in a normal .war). Riena has such an extension for /hessian where
it finds RienaHessionDispatcherServlet which then does the unmarshelling, calls the OSGi service, marshall reply. And
then all the way back through the chain where the Thread context classloader is set back to the one from the appserver....

And to answer the other question. I think it would be a good way to do the alternative and use jbossosgi. Its just that
we havnt tried that yet. If find anything out that works (or doesnt) let us know.

hope that helps
christian




>
> Kind regards
> Hannes
Previous Topic:Modify default perspective
Next Topic:Lnf-Refactoring
Goto Forum:
  


Current Time: Thu Apr 25 10:07:53 GMT 2024

Powered by FUDForum. Page generated in 0.03384 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top