質問

I have to pass parameters between parent application and embeded OSGi. I use equinox and run OSGi by FrameworkFactory in my Launcher class, then I install and start bundles. It is possible to pass object reference or even some primitive type to bundle or service?

役に立ちましたか?

解決

After launching the framework, you can get the system bundle context and access and call services registered by bundles in the framework. Care must be taken about the service types since the are likely loaded from bundles and thus the types are not directly visible to your launching code. But you can use reflection. Or you can put those types in the framework classloader and export them from the system bundle via org.osgi.framework.system.packages.extra framework property your launcher sets.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top