java - Felix 如何使用 FrameworkWiring.getDependencyClosure

标签 java osgi bundle apache-felix

我正在尝试获取每个 bundle 的依赖项。 在此SO post建议我使用FrameworkWiring.getDependencyClosure, 但我无法理解如何初始化类,FrameworkWiring.getDependencyClosure - 它的接口(interface)。 felix中有这个接口(interface)的实现吗?

第二个问题: 我发现了

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 类型?

框架的框架连接对象可以通过调用系统bundle上的bundle.adapt(FrameworkWiring.class)来获取。只有系统包才能适配 FrameworkWiring 对象。

关于java - Felix 如何使用 FrameworkWiring.getDependencyClosure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12034070/

相关文章:

java - 如何使用selenium,java下载文件

java - 我一直尝试运行我的程序,但我的一个类(class)不断向我发送此错误 "d.r cannot be resolved or is not a field"

java - 从 OSGi 包访问命令行参数

ruby-on-rails - 该 bundle 目前的 rails 锁定在 3.2.12。怎么办?

macos - bundle dylibs、headerpad_max_install_names 不起作用

java - 如何确定接口(interface)是否在 Java 中起作用?

java - 将 OSGI 事件标记为已处理

java - 将 maven-bundle-plugin 包含的资源声明为可选

iphone - 删除应用后,我可以使用相同的 bundle 软件ID吗?

java - Yajsw Stop INFO Log message while start stop daemon 在linux下