卸载软件包并强制刷新 [英] Uninstall bundles and force a refresh

查看:234
本文介绍了卸载软件包并强制刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Eclipse插件,希望停止,从Eclipse实例中卸载捆绑包,然后刷新。停止和卸载是没有问题的,但代码的刷新部分现在已被弃用,我想找到一个替代方案。目前,我通过 org.osgi.service.packageadmin 这样做。



文档指向 org.osgi.framework.wiring 包。并从 JavaDoc org.osgi.framework.wiring.FrameworkWiring.refreshBundles(..)似乎正是我想要的。但实现此接口的唯一类是 org.eclipse.osgi.framework.internal.core.PackageAdminImpl ,即内部类。



很可能这意味着我的做法是错误的。动态卸载软件包的典型方法是什么?

解决方案

如果您阅读了 FrameworkWiring 类型,您将看到:


框架的框架接线对象可以通过
调用 bundle.adapt(FrameworkWiring.class)。只有
系统包可以适应FrameworkWiring对象。



I have an Eclipse plugin and want to stop, uninstall bundles from the Eclipse instance and then refresh. Stop and uninstall is no problem, but the refresh part of the code is now deprecated and I want to find an alternative. Currently I'm doing this through org.osgi.service.packageadmin.

Documentation points to org.osgi.framework.wiring package. And from the JavaDoc org.osgi.framework.wiring.FrameworkWiring.refreshBundles(..) seems to be exactly what I want. But the only class that implements this interface is org.eclipse.osgi.framework.internal.core.PackageAdminImpl, i.e an internal class.

Quite possibly this means my approach is wrong. What is the typical way to dynamically uninstall bundles?

解决方案

If you read the javadoc description for the FrameworkWiring type, you will see:

The framework wiring object for the framework can be obtained by calling bundle.adapt(FrameworkWiring.class) on the system bundle. Only the system bundle can be adapted to a FrameworkWiring object.

这篇关于卸载软件包并强制刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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