我试图得到每个捆绑的依赖。
建议在此SO post中使用FrameworkWiring.getDependencyClosure
但我不明白如何初始化类FrameworkWiring.getDependencyClosure-它是接口。
felix中是否有此接口的任何实现?

第二个问题:
我找到

BundleWiringImpl getRequirements(null);


但我无法初始化

BundleWiringImpl testObject = new BundleWiringImpl();


NetBeans显示错误:

constructor BundleWiringImpl in class BundleWiringImpl cannot be applied to given types;
  required: Logger,Map,StatefulResolver,BundleRevisionImpl,List<BundleRevision>,List<BundleWire>,Map<String,BundleRevision>,Map<String,List<BundleRevision>>
  found: no arguments
  reason: actual and formal argument lists differ in length


如何获得部门代表? :)
可能还有其他方法吗?

最佳答案

叹。您是否阅读了javadoc的FrameworkWiring类型?

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.

09-26 03:01