Hi, Am 16.01.2013 um 15:58 schrieb Martin Ždila:
> Hello > > How can I distinguish whether some bundle is API consumer or provider? > > I need it to specify correct Import-Package version range. > > Is the bundle automatically provider if it implements any interface > from imported package, even interfaces like listeners and others that > seems to be more consumer-like? I think this is really the problem. Whether a bundle is a consumer or provider and what it means to an Import-Package version range is not always easy to answer. If the bundle is not implementing any interfaces or extending abstract classes, it is certainly a consumer and should use the wider range. Then there are interface which can be considered "consumer type" and interfaces to be considered "provider type". In your concrete example, I understand ManagedService and ManagedService factory to be "consumer type" interfaces and thus the wider range applies. I think if an interface is intended to be implemented by the general public (as opposed to specific service providers), such interfaces should really only be changed on major package updates. Such I understand the class annotations provided by the BND library: ConsumerType and ProviderType. Regards Felix > > I am asking because we are using Configuration Admin implementation of > version 1.5 but we have many bundles that implements > ManagedServiceFactory from 1.4. ManagedServiceFactory interface of 1.5 > is compatible with 1.4 and 1.3, but if we use provider version range > for our bundles then it forbids us to use them for both 1.4 and 1.5 > implementation even they are interface-compatible. > > Thanks in advance > Best regards > > -- > Ing. Martin Ždila > tel:+421-908-363-848 > mailto:[email protected] > http://www.zdila.sk/ > > _______________________________________________ > OSGi Developer Mail List > [email protected] > https://mail.osgi.org/mailman/listinfo/osgi-dev _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
