Uninstall bundles and force a refresh

拜拜、爱过 提交于 2019-12-25 05:21:13

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/22247513/uninstall-bundles-and-force-a-refresh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!