与 OSGi 类似的架构?
我将实现一个服务器应用程序,该应用程序应该远程更新客户端软件。客户端大多使用拉取机制来接收更新的软件。
作为初学者,我正在寻找实现此应用程序的架构。我知道 OSGi 的生命周期层会提供这样的服务。
我想知道是否还有其他架构可以为客户提供类似的服务?
I am going to implement a server application that should update client software remotely. Clients mostly use pull mechanism for receiving updated software.
As a beginner I am looking for architectures to implement this application. And I know that Life Cycle layer of OSGi would give such service.
I want to know is there any other architectures that give similar service to clients?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在编写基于 Eclipse 的应用程序,那么 p2 可能是最简单的方法。但是,如果您的应用程序是 Maven 构建的,或者您打算在其他 OSGi 容器(Karaf、Felix 等)上更通用地运行,那么您应该考虑使用 OSGi Bundle Repository(请参阅标准 规范),例如 Felix 实现。如果 OBR 不能完全满足您的要求,那么 API 会被公开,以便您可以操作它。
您提到的 OSGi 生命周期将为您提供真正的热部署(以及模块化的其他“福利”),但自动更新功能的级别要高得多,而不是框架核心的一部分(容器不必实现远程更新机制兼容)。
在我工作的地方,我们使用 Karaf XML 功能 (构成功能或整个应用程序的版本化捆绑包集),它们是作为 Maven 构建的一部分创建的。在 OSGi shell 中,我们可以使用命令来指示 OSGi 容器查找并安装这些功能。从受控部署的角度来看,这确实很巧妙,但如果您想要全自动更新,那么 OBR 就是您想要的。
如果您的问题涉及 OSGi 的替代方案作为更新机制的基础,那么您正在考虑 webstart (JNLP) 等 - 它只会在启动时为您提供更新。
IMO OSGi 值得研究,因为它非常适合编码和部署。作为一种更新/插件机制,它确实无法被击败,您可以嵌入框架或轻松自定义它。
If you're writing an Eclipse based application then p2 is the probably the simplest way to go. But if your application is either maven built or you're intending to run more generically on other OSGi containers (Karaf, Felix etc) then you should consider an OSGi Bundle Repository (see standard spec) such as the Felix implementation. If the OBR doesn't quite do what you want, then is API is exposed so you can manipulate it.
The OSGi lifecycle you refer to will give you true hot-deploy (as well as other "perks" of modularity) but the automatic update functionality is much more high level and not part of the framework core (container don't have to implement a remote update mechanism to be compliant).
Where I work we're using Karaf XML features (sets of versioned bundles constituting functionality or an entire application) which are created as part of maven build. From the OSGi shell we can use commands to instruct the OSGi container to find and install these features. This is really neat from a controlled deploy point of view, but if you want fully automatic updates then an OBR is what you want.
If your question refers to alternatives to OSGi as the basis for an update mechanism, then you're looking at things like webstart (JNLP) etc - which will only give you updates at start up time.
IMO OSGi is worth investigating as it's very pleasant to code with and deploy to. As an update/plugin mechanism it cannot really be beaten and you can embed the framework or customize it easily.