Felix如何使用FrameworkWiring.getDependencyClosure [英] Felix how to use FrameworkWiring.getDependencyClosure

查看:85
本文介绍了Felix如何使用FrameworkWiring.getDependencyClosure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to get depends for each bundle. In this SO post I was advised to use FrameworkWiring.getDependencyClosure, but I can't understand how to initialize class, FrameworkWiring.getDependencyClosure - it's interface. Is there any implementations of this interface in felix?

第二个问题: 我已经找到

And second question: I have found

BundleWiringImpl getRequirements(null);

但我无法初始化

BundleWiringImpl testObject = new BundleWiringImpl();

NetBeans显示错误:

NetBeans show error:

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

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

How to get deps? :) May be any other way?

推荐答案

感叹.您是否阅读了 javadoc FrameworkWiring类型?

Sigh. Did you read the javadoc for the FrameworkWiring type?

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.

这篇关于Felix如何使用FrameworkWiring.getDependencyClosure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆