I have defined a bundle A which contains all the common classes defining the model used by other bundles. This bundle contains an interface IDeviceHandler.
This interface is implemented by services contained in other bundles. Each service registers as a IDeviceHandler.
The bundle that represents "my application" has the following code
The main purpose is to find all the registered IDeviceHandler to register as a listener.
But a ClassCastException has been triggered.
I suspect a problem of ClassLoader. I also tried to embedd all the classes of my model (bundle A) into the other bundles. Unfortunately, it does not work (anyway it was not an "OSGi" minded solution).
Any help would be appreciated,
Thanks a lot,