java - bundle.getLocation() 的可能前缀

标签 java eclipse eclipse-plugin osgi

我正在使用 Equinox OSGi 实现。当我检索一个包并询问它的位置(getLocation() 方法)时,返回的字符串以“initial@reference”为前缀。 OSGi 4.3 规范没有提到这个前缀。是否有另一个文件指定了这个前缀和其他可能的前缀?

最佳答案

地点几乎可以是任何地方。如果我按如下方式安装一个包......

InputStream data = ...; // open a stream from wherever
context.installBundle("crazy location huh?", data);

...然后此包的 getLocation() 方法将返回“疯狂的位置,嗯?”。

如果我尝试调用 Bundle.update() 的无参数变体,这只会给我带来问题,因为框架无法解释位置字符串以进行更新来自该位置的 bundle 。但我总是可以调用 Bundle.update(InputStream) 方法从我直接指定的数据更新包。

关于java - bundle.getLocation() 的可能前缀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10108011/

相关文章:

java - 如何获取 Random.nextLong 可返回的所有可能值?

java - Boxfuse 中的根证书问题

android - 在 Eclipse 中将现有项目转换为 Android 项目?

java - 如何为 Eclipse Kepler 安装 SWT

java - 如何更改 eclipse RCP 应用程序中首选项页面的标题?

java - 在自定义 Eclipse 文本编辑器插件中打开文件之前处理文件

java - Axis 2 错误 : Unable to add the following facets

java - 如何在 Java 中将 ArrayList<subClass> 转换为 ArrayList<super>

eclipse - Rest 应用程序(Jersey/JAX-RS)通过 Eclipse 在 glassfish 中运行,但在部署在 tomcat 中时却没有

c++ - 使用 fgets() 时出错