문제

After seeing Robert Dunne's OSGi Dependencies: Heaven and Hell, I am specially interested in the following :

If you were using a resolver that wasn’t aware of ACTIVE bundle dependencies then you’d have to manage all of this yourself. With Nimble you just ask for what you need and let the resolver take care of the rest. This speeds up the development life-cycle and keeps redundant clutter out of your scripts.

Just as Richard said, using obr can resolve resolving-time dependencies. However, I think that if not scanning the bundle's source , it is difficult to resolve active-time dependencies (active bundle's dependencies automatically) .

For example, if a bundle A used a service which was registered on bundle B using BundleContext.register method, then, when activating the bundle A, how can we know the fact that we must activate the bundle B too?

도움이 되었습니까?

해결책

The assumption behind the whole approach is that bundles will provide metadata indicating their requirements and capabilities. Some extra information can be inferred from other artifacts in the bundle, such as a web.xml file or a declarative services component file.

Even with code level dependencies, there’s no way to detect arbitrary dynamic classloading - metadata is essential.

Writing a program that could determine all possible capabilities and requirements of a bundle would be a hard static analysis problem, and these tend to be equivalent to the Halting Problem, i.e. impossible.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top