felix控制台如何使用metatype.xml文件

How felix console uses metatype.xml file

我想了解组件元类型的使用。

我明白,如果我们保持真实,它将生成 OSGI-INF/metatype/metatype.xml 否则它不会。另外,我很清楚保持属性值 true 会在 Apache Felix 控制台中显示它,编辑它会在 /apps/system/config 中创建相应的配置保存并删除它会再次将 Felix 控制台中的配置状态恢复为默认值。

引用This问题的已接受答案,`

How Metatype data can be used by administrative systems or GUIs such as Felix Web Console to present a much more helpful way to configure your component?
and what is the concept of binding with bundle in terms of this configuration?

`

查看此服务:https://osgi.org/javadoc/r6/cmpn/org/osgi/service/metatype/MetaTypeService.html

使用 MetaTypeService,您可以动态地检查一个包并发现关于他的配置的元类型信息,包括类型、描述等。

Felix WebConsole 使用此元类型信息来显示 UI 更多 "userfriendly" 的组合配置。