使用 Web Start/JNLP 动态加载其他 jar 文件 [英] Dynamically load additional jar files using Web Start / JNLP

查看:28
本文介绍了使用 Web Start/JNLP 动态加载其他 jar 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Web Start 开发人员指南 状态

必须从指定的 JAR 文件中检索所有应用程序资源在 JNLP 文件的资源部分,或显式检索使用对 Web 服务器的 HTTP 请求.

All application resources must be retrieved from the JAR files specified in the resources section of the JNLP file, or retrieved explicitly using an HTTP request to the Web server.

建议将资源存储在 JAR 文件中,因为它们会被缓存在本地机器上通过 Java Web Start.

Storing resources in JAR files is recommended, since they will be cached on the local machine by Java Web Start.

现在,我想在应用程序启动后动态加载一些资源(例如 OSGi 包).我可以使用普通的 HTTP 来做到这一点,但我想利用 Web Start 对本地缓存和版本/架构特定资源的支持.

Now, I have some resources I want to dynamically load after my application has been started (for example OSGi bundles). I can do this using plain HTTP, but I would like to make use of Web Start's support for local caching and versioned/architecture-specific resources.

有没有办法使用 Web Start 基础结构从原始代码库(如应用程序的 jnlp 文件中指定)下载其他 jar 文件?

Is there a way to download additional jar files from the original code base (as specified in the application's jnlp file) using the Web Start infrastructure?

或者:是否已经有一种既定的方法来集成 OSGi 和 Web Start,可以减轻我从 Web Start 服务器安装包的任务?

Or alternatively: is there already an established way to integrate OSGi and Web Start that would relieve me of the task to install bundles from the Web Start server?

推荐答案

如果您使应用程序本身成为基于 Equinox 的 OSGI 应用程序,您可以使用您需要的所有附加包通过网络启动它.

If you make your application in itself an Equinox-based OSGI application, you can web-start it with all the addition bundles you need.

这篇文章WebStarting Equinox OSGi Apps"可以给你对所需设置的很好的介绍.

This article "WebStarting Equinox OSGi Apps" can give you a good introduction on the required settings.

  • 所有包都必须部署为签名的 JAR 文件
  • 您需要一个包含所有必需包的功能
  • 导出功能时,请确保 PDE 为此功能创建 JNLP(Java 网络启动协议)文件(导出向导中的复选框)
  • 为您的应用程序提供根 JNLP 文件
  • 将您的应用程序部署到 Web 服务器并确保 Web 服务器知道 application/x-java-jnlp-file mime 类型

他还有一个 OSGI 演示.

这篇关于使用 Web Start/JNLP 动态加载其他 jar 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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