org.osgi.framework.Bundle类解读
来源:互联网 发布:浙江剑龙网络 编辑:程序博客网 时间:2024/06/07 19:59
Bundle提供了获取插件的信息。获取插件信息可使用如下方法。
Platform.getBundle(symbolicName);
如
Bundle bundle = Platform.getBundle("org.eclipse.ui.views");
1.bundle.getEntry("/"); ————获得插件安装目录的URL
2.bundle.getSymbolicName() ————返回唯一的插件标志符(String类型),与MANIFEST.MF文件中的Bundle-SymbolicName声明一致
3.bundle.getHeaders()————返回插件的MENIFEST.MF文件定义的头和值的字典(键值对)
这个键值对是可以枚举打印的。
如:
Bundle-Name: bundle.getHeaders().get("Bundle-Name");//返回插件名
version :bundle.getHeaders().get("Bundle-Version")//返回插件版本号
4.bundle.getState()————返回插件当前的状态,状态值所对应的常量在Bundle类中可以找到,如Bundle.ACTIVE,Bundle.STARTING等。
5.bundle.getBundleId()————返回插件的唯一标识符(long类型),由Eclipse在安装包时分配。
6.Platform.getResourceBundle(bundle):返回当前区域对应的插件资源包对象(java.util.ResourceBundle)。
这个包对象中的信息将会在插件发布后,作为插件安装目录中的plugin.properties文件而存储。
//未完待续
- org.osgi.framework.Bundle类解读
- 运行Bundle时org.osgi.framework.BundleException
- org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console错误解决办法
- EclipseRCP 启动遇到org.osgi.framework.BundleException: The activator for bundle s invalid
- RCP启动遇到org.osgi.framework.BundleException: The activator for bundle s invalid
- osgi中org.osgi.service.cm bundle组件的使用
- OSGI的bundle监听类
- OSGI BUNDLE
- 【OSGi】Could not find bundle: org.eclipse.equinox.console
- 【OSGi】Could not find bundle: org.eclipse.equinox.console问题
- OSGi Bundle Hello World 出现 Could not find bundle: org.eclipse.equinox.console的解决方案
- 启动eclipse 报错org.osgi.framework.BundleException
- 关于confluence出现org.osgi.framework.BundleException的解决办法
- 解读OSGI中描述Bundle元数据信息的MANIFEST.MF文件
- OSGi之Bundle
- OSGI Bundle安装
- OSGI 中的bundle
- osgi:安装bundle
- Visual C++线程同步技术剖析:临界区,时间,信号量,互斥量
- SQL注入-LITTLE BUBBY TABLES
- drawable(hdpi,ldpi,mdpi) 的区别
- Android开发之ListView 适配器(Adapter)优化
- 【Android软件】ES文件浏览器:Android资源管理器
- org.osgi.framework.Bundle类解读
- 使用WinINet和WinHTTP实现Http访问
- 我这里有一段程序,用来在一个对话框里显示出一次http request的原始信息,不过使用Inet API做的
- 开始启用博客
- GridView行绑定时取得某个数据列的几种方法比较
- class文件版本问题
- 元宵节前门
- 数据绑定以及Container.DataItem几种方式与用法分析
- 解决Office Outlook 主页部分标题中文乱码