OSGi片段可以将其他片段作为主机吗?

Ale*_*nov 3 osgi osgi-fragment

这合法吗?

MANIFEST.MF for org.fragment1(org.host是一个普通的bundle,而不是一个片段):

Bundle-SymbolicName: org.fragment1
Fragment-Host: org.host
Run Code Online (Sandbox Code Playgroud)

MANIFEST.MF org.fragment2:

Bundle-SymbolicName: org.fragment2
Fragment-Host: org.fragment1
Run Code Online (Sandbox Code Playgroud)

或者应该org.fragment2

Fragment-Host: org.host
Run Code Online (Sandbox Code Playgroud)

Tim*_*Tim 6

片段包不能将其他片段包作为主机.只有普通的bundle才能充当片段主机.所以你的第三个例子是正确的:

或者应该org.fragment2

Fragment-Host: org.host

您可以在OSGi服务平台第4版第4.3版核心规范(第70页)中找到此限制.它说:

具有Require-Bundle标头的另一个包不能要求Fragment包.