Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Custom OSGi Container vs Virgo(What are the advantages of Virgo over custom OSGi container)
Custom OSGi Container vs Virgo [message #1102888] Fri, 06 September 2013 06:58 Go to next message
Soham Ghosh is currently offline Soham GhoshFriend
Messages: 4
Registered: September 2013
Junior Member
We have implemented OSGi container as follows. If we move to Virgo what are the advantages we could get? What are the downside of using Virgo?

OSGi Implementation in our project

• Felix framework is initialized and started by a web application (webapp), which is deployed in Tomcat. Note: Tomcat is not an OSGi bundle.

• Once the Felix framework is initialized, the wepapp (programatically) starts all bundles present in a particular location, say, /etc/bundles. (The deployment process copies all project bundles and the dependent bundles to that location.)

• The above step resolves and activates the bundles present in /etc/bundles but not the Spring contexts of those bundles. The Spring context is created by the Spring DM (Eclipse Blueprint) bundle (present in /etc/bundles).

• To bridge the non-OSGi Tomcat server (that provides HTTP service) and OSGi container (webapp along with the bundles) Apache Felix HTTP Bridge is installed (as a bundle). However, just installing the HTTP bridge doesn't let the bundles use the HTTP service; we had to write a custom bundle, say C, for that. We created another bundle that contains (Spring) application context service tracker and HTTP service tracker. When the (Spring) application context of a bundle, say X, is created, the application context service tracker gets a callback. In the callback, the bundle X is added to the HTTP service tracker. In short, the bundle X (whose application context has been created) will now get a callback if the HTTP service is available (or if not, when it will be available). When the HTTP service tracker for X gets a callback, a web context is created for X and the web context's parent is set as the application context of X.

• We also had to write custom code for the following:
o To support JSP (in the Spring web controllers) in a bundle. Because Tomcat cannot look into the bundle for the path to JSP.
o To support Velocity templates.
Re: Custom OSGi Container vs Virgo [message #1105761 is a reply to message #1102888] Tue, 10 September 2013 08:44 Go to previous messageGo to next message
Florian Waibel is currently offline Florian WaibelFriend
Messages: 100
Registered: June 2010
Senior Member
Hi,

maybe you want to have a look at the white paper "Eclipse Virgo - A Technical Overview" available here.

Regards,
florian
Re: Custom OSGi Container vs Virgo [message #1107990 is a reply to message #1105761] Fri, 13 September 2013 07:14 Go to previous messageGo to next message
Soham Ghosh is currently offline Soham GhoshFriend
Messages: 4
Registered: September 2013
Junior Member
Hi Florian,

Thanks for the reply and sharing the whitepaper. Virgo looks great but my question is slightly different. (I didn't phrase it properly.) Now, that we have implemented OSGi in our project in the way I had described earlier, does it make sense to move to Virgo? If so, what will be the major reasons?
Re: Custom OSGi Container vs Virgo [message #1108119 is a reply to message #1107990] Fri, 13 September 2013 11:19 Go to previous messageGo to next message
Florian Waibel is currently offline Florian WaibelFriend
Messages: 100
Registered: June 2010
Senior Member
Hi,

I should have pointed you directly to the chapter "Gemini Web" and Web Application Bundles (WAB - introduced in OSGi Enterprise 4.2 Specification).

If I understand you correctly you are running an OSGi container packaged as a war file within a standard Tomcat.

I have very limited knowledge about the Felix framework and the Apache Felix HTTP Bridge, but in general this sounds like war deployment with Equinox and the Servlet Bridge.

If you upend your deployment and run the servlet container within an OSGi container (Virgo Server for Apache Tomcat, Apache Karaf with PAX Web or Virgo Jetty Server, ...) you:

* Don't need to start all bundles manually,
* get Blueprint for free (Gemini Blueprint or Apache Aries Blueprint),
* don't need to use a servlet bridge,
* don't need to write an OSGi integration from scratch,
* get JSP support out of the box (Gemini Web),
* don't restart/reset the whole OSGi container during each deployment, because you update your application bundles only and not a war file.

Can't say anything about Velocity (never tried that myself within an OSGi container), but with very little effort I was able to use Thymeleaf templates with Virgo.

Please also take into account that the future of Virgo is currently a bit uncertain[1].

Hope this helps,
florian

[1] http://www.eclipse.org/forums/index.php/mv/msg/490217/1067928/#msg_1067928

[Updated on: Fri, 13 September 2013 11:20]

Report message to a moderator

Re: Custom OSGi Container vs Virgo [message #1108125 is a reply to message #1108119] Fri, 13 September 2013 11:25 Go to previous messageGo to next message
Soham Ghosh is currently offline Soham GhoshFriend
Messages: 4
Registered: September 2013
Junior Member
Thanks Florian for the detailed reply. It was really helpful.
Re: Custom OSGi Container vs Virgo [message #1109906 is a reply to message #1108119] Mon, 16 September 2013 05:21 Go to previous message
Tin N/A is currently offline Tin N/AFriend
Messages: 46
Registered: December 2010
Member
Florian Waibel wrote on Fri, 13 September 2013 13:19

Can't say anything about Velocity (never tried that myself within an OSGi container), but with very little effort I was able to use Thymeleaf templates with Virgo.


Velocity works like a charm in OSGi (and in Virgo specifically), we have it in production for almost 5 years now in Virgo (and its predecessors) without a single problem.
Previous Topic:Spring Security
Next Topic:Creating logback logger, programatically.
Goto Forum:
  


Current Time: Fri Dec 19 03:25:46 GMT 2014

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

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