Hi Saminda,

Am Freitag, den 15.02.2008, 13:25 +0530 schrieb Saminda Abeyruwan:
> Dear Devs,
> 
> I'm Saminda Abeyruwan, Apache Committer/PMC member, working for WSO2 Inc.
> 
> I'm in the process of integrating Embedded Tomcat as OSGi bundle on top of
> Felix. Unfortunately, as I'm quite a newbie to OSGi world, I wouldn't know
> where to start from. I would really appreciate if you could aid me.

So you would create a bundle which contains tomcate exposing the
functionality of tomcat to other bundles. The first and foremost
requirement I would suggest is, that your tomcate bundle implements the
OSGi HttpService Specification (see the OSGi compendium specifications).

If you would want to expose functionality of Tomcat, which is not
covered by the HttpService specification (e.g. JSP compilation), I
suggest you create your own specification of how this would be
seemlessly possible. For example you enable the registration of JSP
scripts as OSGi services (whiteboard pattern-style).

If you are not really forced to use tomcat and might as well use Jetty
as the servlet container, I suggest you rather look for the OPS4J Pax
Web [1] and Web Extender [2] bundles. These use Jetty and provide basic
and extended support for web applications.

[1] http://wiki.ops4j.org/confluence/display/ops4j/Pax+Web
[2] http://wiki.ops4j.org/confluence/display/ops4j/Pax+Web+Extender

> 
> Say I've my_webapp.jar, bundle, with the following structure,
> my_webapp.jar
>    META-INF
>                  ...
>    jsp
>         ...
>    css
>        ...
>   org
>       apache
>                 ....
> 
> How could I be able to register my_webapp.jar bundle as a web app to Tomcat
> via OSGi.

Your web app would most probably contain a BundleActivator which gets
the HttpService (provided by the Tomcate bundle) from the service
registry and registers any resources and servlets with the HttpService.

Hope this helps.

Regards
Felix

> 
> As this is my first mail to Felix dev list, if I make any absurd
> assumptions, I humbly apologize.
> 
> Thank you
> 
> Saminda
> 
> 

Reply via email to