Trouble understanding the whole OSGi web eco system

后端 未结 2 824
猫巷女王i
猫巷女王i 2020-12-13 02:48

I am pretty new to the whole Java and OSGi world and I have trouble understanding the eco system of a OSGi web application.

To be more precise I am at the moment try

2条回答
  •  遥遥无期
    2020-12-13 02:56

    OSGi is a standard in terms of API and packaging for interacting software modules. This is similar to other API standards like JPA or Java EE.

    An OSGi runtime is a server which follows the OSGi standard, it is an implementation of the standard. You mention some common ones: Knopflerfish, Eqinox. These let you run OSGi bundles.

    A web container usually refers to an implementation of the web-specific parts of Java EE (servlets). The servlet standard also defines an API and packaging, just like OSGi, only different.

    You need a server to run your Java EE web apps. You package your app as a Java Web Archive (WAR), and ask your application server to start it. There are several servers, as you mention, like Tomcat, Jetty, but also bigger servers which cover larger parts of the Java EE standard, like Glassfish and JBoss.

    A web extender tries to unify the servlet standard with OSGi. By adding some OSGi-specific data to your already packaged WAR, the WAR will be automatically parsed and started by your OSGi runtime. Your WAR servlets will be published to the OSGi http service by the web extender. With a web extender, you can run both standard OSGi applications as well as WARs using only a OSGi runtime, without the need for a Java EE-compliant server like Tomcat.

提交回复
热议问题