Hi Kirk, Am Mittwoch, den 13.02.2008, 21:45 -0600 schrieb Kirk Knoernschild: > I'm curious what the thoughts are regarding embedding OSGi in a > Servlet Container vs embedding a Servlet Container in OSGi. I'm not > finding any discussions surrounding the best approach, listing the > pros and cons. Anyone have compelling arguments, advantages, or > disadvantages on one vs. the other?
I think it all depends where you are looking from and what you intend to do. And whatever you do, try to implement a solution, which is as generic as possible. That is hide the fact to your bundles. For example, we at Apache Sling [1] provide to launchers for the framework: One is a standalone Java Application, which embedds a servlet container as a bundle. The container is made available to the bundles through the OSGi HttpService. The second launcher is a web application where the OSGi framework is started when the respective servlet is intialized. The servlet container is made available to the bundles through a HttpService proxy (we use the Equinox proxy). In the end, bundles registered in the framework (a) don't care whether the framework runs in a servlet container or embeds the servlet container and (b) they don't even know. Now, for my personal preference, I would generally use standalone Java application launcher, because its lifecycle is easier to manage, for example on *nix box you may create your init.d scripts. If OTOH you have you servlet container infrastructure or are required to run in an application server, e.g. to share EJB or resources, you use the web app based launcher. Hope this helps. Regards Felix [1] http://incubator.apache.org/sling _______________________________________________ OSGi Developer Mail List [email protected] https://www2.osgi.org/mailman/listinfo/osgi-dev
