Solved
How to communicate with different OSGI bundles
Hi there,
I define a osgi bundle A, and the second osgi bundle B, now a method in the A need to call another mothod defined in the B.
private BService getBService() { BundleContext ctx = FrameworkUtil.getBundle(this.getClass()) .getBundleContext(); ServiceReference serviceReference = ctx .getServiceReference(BService.class.getName()); return BService.class.cast(ctx.getService(serviceReference)); }In general, if bundle A want to get B instance, developer could use above code. But the question is how to make compile A bundle class successfully? because A can't reference class BService.
Thanks a lot.
Br,
Brian