1

我正在尝试为每个捆绑包获取依赖项。在这篇SO 帖子中,我被建议使用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

如何获得部门?:) 可能有其他方式吗?

4

1 回答 1

1

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

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.

于 2012-08-20T14:44:43.613 回答