OSGi如何管理在单独的JVM中运行的组件的交互? [英] How does OSGi manage interaction of components running in separate JVMs?

查看:67
本文介绍了OSGi如何管理在单独的JVM中运行的组件的交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图在不阅读整个规范的情况下,对OSGi的更广阔的背景有更多的了解.与很多事情一样,简介实际上是由OSGi编写的.已经研究了十年,也许不是最适合让自己对此一无所知的人的心态:-)

I have been trying to understand a bit more about the wider picture of OSGi without reading thru the entire specification. As with so many things, the introduction to what OSGi actually is was probably written by someone who had been working on it for a decade and perhaps wasn't best placed to put themselves in the mindset of someone who knows nothing about it :-)

看Felix的例子DictionaryService,我真的不明白发生了什么. OSGi是JVM的一个独特实例吗?您可以在其中加载可以相互找到的捆绑软件吗?

Looking at Felix's example DictionaryService, I don't really understand what is going on. Is OSGi a distinct instance of a JVM into which you load bundles which can then find each other?

显然,这不是 ,这是因为在StackOverflow上的其他答案很明确,即OSGi可以解决包含部署在不同JVM中的模块的分布式系统的依赖性问题(以及常见问题解答不断谈论网络).

Obviously it is not just this because other answers on StackOverflow are explicit that OSGi can solve the dependency problem of a distributed system containing modules deployed within distinct JVMs (plus the FAQ keeps talking about networks).

在后一种情况下,在一个JVM中运行的组件如何与在单独的JVM中的另一个组件交互?这两个组件是否可以像在同一JVM中运行那样相互使用"(即通过本地方法调用),以及OSGi如何管理网络中的数据编组(例如,您是否必须使用Serializable) ?

In this latter case, how does a component running in one JVM interact with another component in a separate JVM? Can the two components "use" each other as if they were running within the same JVM (i.e. via local method calls), and how does OSGi manage the marshalling of data across a network (do you have to use Serializable for example)?

还是组件作者必须使用其他独特的机制(由OSGi提供或由他们自己编写)在远程组件之间进行通信?

Or does the component author have to use some other distinct mechanism (either provided by OSGi or written themselves) for communication between remote components?

任何帮助,不胜感激!

推荐答案

是的,OSGi仅处理在同一VM上运行的捆绑软件和服务.但是,应该注意的是,OSGi的一项独特功能是,它完全可以促进在同一JVM上运行多个应用程序(以受控方式并共享公用模块).

Yes, OSGi only deals with bundles and services running on the same VM. However, one should note that it is a distinct feature of OSGi that it facilitates running multiple applications (in a controlled way and sharing common modules) on the same JVM at all.

在客户端JVM之外访问服务时,目前还没有标准化的解决方案. Paremus Infiniflow和派生的开源项目Newton使用SCA方法.即将发布的OSGi规范4.2版本将解决该问题的一个方面,即如何以一种可以将远程服务引入客户端JVM的方式使用通用分发软件.

When it comes to accessing services outside the clients JVM, there is currently no standardized solution. Paremus Infiniflow and the derived open-source project Newton use an SCA approach. The upcoming 4.2 release of the OSGi specs will address one side of the problem, namely how to use generic distribution software in such a way that it can bring remote services into the client's JVM.

正如有人提到R-OSGi一样,这种方法还解决了问题的另一面,即如何管理分布式OSGi框架之间的依赖关系.由于R-OSGi不是通用发行软件,而是显式地处理OSGi捆绑软件的生命周期问题和依赖性管理.

As somebody mentioned R-OSGi, this approach also deals with the other side of the problem, being how to manage dependencies between distributed OSGi frameworks. Since R-OSGi is not generic distribution software but explicitly deals with the lifecycle issues and dependency management of OSGi bundles.

这篇关于OSGi如何管理在单独的JVM中运行的组件的交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆