本文介绍了难以理解整个OSGi Web生态系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于整个Java和OSGi领域,我还是一个新手,我对理解OSGi Web应用程序的生态系统有困难.

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 trying to understand how all the parts of the eco system are related to each other:

  • OSGi框架(例如Apache Felix,Equinox,Knoplerfish)
  • OSGi运行时(例如Spring DM Server,Pax Runner,Apache Karaf)
  • Web Extender(例如Pax Web Extender,Spring Web Extender)
  • Web容器(例如Apache Tomcat,Jetty)

要使您直观地了解我对他们之间关系的实际了解,请查看以下图片:

To give you a visual representation of my actual understanding of their relationship check out this image:

据我所知,OSGi框架是OSGi规范的实现.运行时是一个分发,它在OSGi规范的基础上增加了其他功能,例如日志记录.由于OSGi和Web容器(例如Tomcat)的类路径机制似乎存在一些差异,因此您需要某种翻译器.这部分由"Web Extender"处理.

As far as I know the OSGi Framework is a implementation of the OSGi specification. The runtime is a distribution which adds additional functionality on top of the OSGi specification like logging for instance. Since there seem to be some differences in the classpath mechanism of OSGi and web containers like Tomcat you need some kind of translator. This part is handled by the "Web Extender".

您能为我澄清一下整个事情吗?我了解所有正确的内容吗?

Would you please clarify this whole thing for me? Am I understanding everything correct?

推荐答案

OSGi是API和用于交互软件模块的打包方面的标准.这类似于其他API标准,例如JPA或Java EE.

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.

OSGi运行时是遵循OSGi标准的服务器,它是该标准的实现.您提到了一些常见的动物:Knopflerfish,Eqinox.这些使您可以运行OSGi捆绑软件.

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.

Web容器通常是指Java EE(Servlet)的Web特定部分的实现. Servlet标准还定义了API和封装,就像OSGi一样,只是有所不同.

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.

您需要一台服务器来运行Java EE Web应用程序.您将应用程序打包为Java Web存档(WAR),并要求您的应用程序服务器启动它.正如您所提到的,有几台服务器,例如Tomcat,Jetty,还有一些更大的服务器,它们覆盖了Java EE标准的较大部分,例如Glassfish和JBoss.

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.

Web扩展程序试图将Servlet标准与OSGi统一.通过将一些特定于OSGi的数据添加到已打包的WAR中,WAR将由OSGi运行时自动解析并启动. Web扩展程序将把您的WAR servlet发布到OSGi http服务.借助Web扩展程序,您可以仅使用OSGi运行时运行标准OSGi应用程序以及WAR,而无需像Tomcat这样的Java EE兼容服务器.

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.

这篇关于难以理解整个OSGi Web生态系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 03:21