简体   繁体   English

更新OSGi捆绑包

[英]Update OSGi bundles

I'm building an OSGi application using Equinox. 我正在使用Equinox构建OSGi应用程序。 It is essential for this application, that the individual bundles can be updated. 对于此应用程序至关重要,可以更新各个捆绑包。

The application checks a folder on a HTTP server for new versions of the bundles and if any new bundles are available. 该应用程序检查HTTP服务器上的文件夹中是否有新版本的捆绑软件,以及是否有新的捆绑软件可用。 If any new bundle is available, the application loads the *.jar file and updates this bundle. 如果有任何新的捆绑包,应用程序将加载* .jar文件并更新该捆绑包。 The update is performed by stopping the bundle, updating it with the input stream of the loaded file and starting the bundle again. 通过停止捆绑软件,使用已加载文件的输入流对其进行更新并再次启动捆绑软件来执行更新。

The problem is, that after updating a file and restarting the application, the old version of the file is used and not the new one. 问题是,在更新文件并重新启动应用程序之后,将使用文件的旧版本,而不是新版本。

Michael 麦可

Consider using the Apache Felix fileinstall bundle for this. 考虑为此使用Apache Felix fileinstall捆绑软件。 It is very useful for watching for new jars and/or .cfg files. 这对于监视新的jar和/或.cfg文件非常有用。 Apache Karaf (and its derivatives) have this functionality built in. JBoss AS 7 does too, although with a rather different implementation. Apache Karaf(及其衍生产品)具有内置的此功能。JBoss AS 7也具有此功能,尽管实现方式大不相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM