Embed Eclipse Virgo inside another application server [message #834884] |
Mon, 02 April 2012 14:19 |
Paul Duffin Messages: 9 Registered: July 2009 |
Junior Member |
|
|
This may seem like a weird thing to want to do but I do have a good reason for it, honest.
The product for which I am responsible can be installed on a number of different application servers, e.g. JBoss, Tomcat, WebLogic, WebSphere. The choice is usually made by our customers. However, I want to make use of OSGi within the product to avoid us having to create our own inferior solution to the problems that OSGi already addresses. e.g. We have a need for dynamically loading various types of 'bundle' just like VTS supports.
For internal use we should be able to use Eclipse Virgo (i.e. VTS) out of the box but we cannot force our customers to change their preferred application server. However, we can define the structure inside the application.
One of our products already embeds OSGi using a proprietary 'bridge' that we created long before Enterprise OSGi came along and that works reasonably well, e.g. it routes all requests to the application through to our own implementation of the HttpService. However, we want to stop maintaining that ourselves and move towards something more 'standard'. But we are quite happy to write any bridging code between the application and the embedded Eclipse Virgo but do not know where to start.
I have a suspicion that this question is probably more related to Embedded Tomcat/Jetty than Eclipse Virgo but given that Eclipse Virgo can support both Tomcat and Jetty I thought that I would ask here first. I have had a look at both Embedded Tomcat and Jetty but there does not seem anyway to stop them from creating the incoming socket. Whereas what I want them to do is behave more like a Servlet, e.g. be given the HttpServletRequest/Response pair.
Just in case there is another way I can get what I need here is a brief summary of what the product does and what we are trying to achieve.
Our product essentially provides a Servlet Filter that processes incoming requests and outgoing responses. All requests to our application that satisfy the filter mapping, including those handled by the embedded Eclipse Virgo need to pass through the filter.
Within the application we need to support:
* Hot deployment, and removal of WAR files within the application, i.e. 'sub-context'. Would behave just like deploying WAR file in stand alone tomcat, i.e. create filters, servlets, contain custom JAR files.
* Hot deployment and removal of various types of OSGi bundles to be shared and used by the deployed WAR files.
Any help or advice would be greatly appreciated.
|
|
|
Re: Embed Eclipse Virgo inside another application server [message #834903 is a reply to message #834884] |
Mon, 02 April 2012 14:38 |
Glyn Normington Messages: 1222 Registered: July 2009 |
Senior Member |
|
|
Apparently some people use embedded Jetty for this kind of use case. I gather it is possible to deploy OSGi standard Web Application Bundles into the embedded Jetty and drive them via a servlet request in the containing app server. Unfortunately, I don't know the technical details, so I recommend posting in Jetty land.
However, if you can figure out an approach which builds on Equinox, then it should be fairly straightforward to substituted Virgo nano, or possibly even the Virgo kernel, for Equinox and get Virgo's hot deployment support and other goodies such as nice diagnostics, medic/logback, Gogo shell, etc. (We are drawing up a feature comparison of the various Virgo deliverables, so keep an eye on the Virgo home page later this week. Or check out the Virgo white paper, available from the Virgo home page, which has a section entitled "Virgo Runtime Deliverables".)
|
|
|
Re: Embed Eclipse Virgo inside another application server [message #834917 is a reply to message #834884] |
Mon, 02 April 2012 14:51 |
Frieder Heugel Messages: 61 Registered: October 2010 Location: Basel, CH |
Member |
|
|
Hi
I may be wrong but I think it is not possible to integrate Virgo with any existing app server (at least not without some serious effort). The same should be valid for Apache Karaf. Please correct me if I'm wrong.
What you are probably looking for is called a servlet bridge. That is the only standard way I know of how to integrate an OSGi container in app servers/servlet containers. Most apps I know (which aren't many to be honest) are using Apache Felix for this even though Equinox works well too. You could start by taking a look on the Felix example sources. There you can find an (slightly outdated) example of such a bridge implementation. I'm not quite sure if it is possible to deploy war files to ExtHTTPService but I would definitely be interested to learn more about that if someone can provide more information.
Frieder
[Updated on: Mon, 02 April 2012 14:55] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04501 seconds