osgi中manifest中属性介绍
来源:互联网 发布:软件开发项目管理流程 编辑:程序博客网 时间:2024/05/29 18:42
1) 描述性的属性
- Bundle-Name: Simple Paint API #1
- Bundle-Description: Public API for a simple paint program. #2
- Bundle-DocURL: http://www.manning.com/osgi-in-action/ #3
- Bundle-Category: example, library #4
- Bundle-Vendor: OSGi in Action #5
- Bundle-ContactAddress: 1234 Main Street, USA #6
- Bundle-Copyright: OSGi in Action #7
2)唯一性标签属性
- Bundle-ManifestVersion: 2
- Bundle-SymbolicName: org.foo.shape
- Bundle-Version: 2.0.0
Bundle-ManifestVersion这个属性在OSGI R4中是必须的,在R4中的值必须是2.
3)可见性属性
- Bundle-ClassPath: .,other-classes/,embedded.jar
同一个bundle中的参照类路径,classpath的顺序是有关系的.如果manifest文件没有这个属性,则默认classpath为"."
- Export-Package: org.test.hello,org.test.other
用逗号分隔的共享给外部的包名. 还可以在每个包名后面加上vendor信息,
例如: Export-Package: org.test.hello; vendor="vendor1",org.test.other; vendor="vendor1"
或者 Export-Package: org.foo.shape; org.foo.other; vendor="vendor1"
上面两个例子是等价的
package还可以制定版本号: Export-Package: org.foo.shape; org.foo.other; version="2.0.0"
- Import-Package: org.foo.shape,org.foo.shape.other
逗号分隔的包名,这些包名为此bundle需要参照其他bundle的包
Import-Package也有可以加Export-Package一样的参数: vendor,version
这些参数限制了引入包的范围
例如Import-Package: org.osgi.framework; version="1.3.0" 表示因为包的名字为org.osgi.framework,版本为从1.3.0(包括)到无限大.
Import-Package: org.osgi.framework; version="[1.3.0,2.0.0)" 表示引入包的版本在1.3.0(包括)到2.0.0(不包括)之间
默认情况下没有version指定,意味着version="0.0.0"也就是任何版本
以java开头的package不需要指定,但是javax开头的需要.
uses 指令的使用
uses指令用在Export-Package属性中,但是要配合Import-Package属性一起来使用才有意义.例如bundleA 的manifest文件包含如下片段:
Export-Package: org.osgi.service.http;uses:="javax.servlet"; version="1.0.0"
Import-Package: javax.servlet; version="2.3.0"
上面的例子说明bundleA共享了org.osgi.service.http这个包给其他包来使用,版本从1.0.0到无限大,使用bundleA(也就是引入bundleA)的其他包如果要引入javax.servlet这个包,那么要引入的javax.servlet包就是bundleA中引入的这个包. 这种引入具有传递性.
4)lifecycle相关
- Bundle-Activator: org.helloworld.Activator
bundle的钩子类,此类必须实现org.osgi.framework.BundleActivator接口(start 和stop 方法).
- Bundle-UpdateLocation: url
bundle.update()时默认的url
- osgi中manifest中属性介绍
- osgi中manifest中属性介绍
- OSGI MANIFEST中export-package中的uses属性
- 【Android】Affinity以及Manifest中Activity的属性值介绍
- OSGI中MANIFEST.MF的bundle元数据信息描述
- Manifest.xml 中uses-feature属性 详解
- Manifest.xml 中uses-feature属性 详解
- Android中manifest中的属性们
- Manifest.xml 中android:windowSoftInputMode属性详解
- 解读OSGI中描述Bundle元数据信息的MANIFEST.MF文件
- 在Manifest文件中设置全屏相关属性
- android--Manifest文件中allowTaskReparenting属性的含义
- maven打包在MANIFEST.MF文件中增加属性
- Manifest文件中Activity的screenOrientation属性详解
- Android的manifest中Application属性supportsRtl的作用
- android的广播介绍,在manifest .xml中注册广播
- 第2.3节 android目录中manifest的介绍
- OSGi中使用log4j
- 【STL】关联容器 — hash_set
- <Coursera Practice On Programming> Learning Note 5/11/2014
- oracle 11g 导入导出
- 正则应用之——逆序环视探索
- js截取中英文字符串无乱码
- osgi中manifest中属性介绍
- Sql Server 数据分页
- linux编程C/C++如何自动打开一个终端并且运行新程序
- js数组的操作
- 一键设置JDK环境变量
- ASP.NET对路径"xxxxx"的访问被拒绝的解决方法小结
- 正则基础之——环视
- c:\\fakepath\\.doc不存在什么意思?
- 6. break、continue、goto