Prioritizing OSGi service selection within a container when more than one implementation exist -


I am playing with OSGI and I have some bundles. Both bundle A and B are registered services which Enables an interface. The third bundle includes the code to see the service implementing the previously mentioned interface. There are different version numbers in the bands of A and B but it appears that C first chooses the service from the bundle. I have changed the level of starting at the right level, but the version is used only to accept the order rather than the order that the service returns.

  One version 1.0 Starter level 1b version 1.1 Start level 2 is required Both bundles, start level 3  

In the above example, always in C Service, even if B has a high bundle version. However, if I switch the start level then B. starts the ABC service before starting

I have searched for the OSGI website and there is no clear explanation as to whether any version of a bundle Is used to give priority to the other. I understand that the initial level is considered to be used for bundle startup so that the dependency can be correctly understood. However it appears to be overloaded, giving priority to this service priority. Considering all of the above given above, I think that it is understandable that do not use the bundle version in the selection as the version number is only the relative number of nothing.

service property Best way to prioritize OSGI services is to use

according to the method documents:

If there are many such services in existence, service with the highest ranking (As specified in its Constants. SRCRRRINIKING property) is returned.

If there is a tie in the ranking, then the service with the lowest service ID (as specified in its constant value, the SERVICE_ID property); That is, the service that was previously entered has been returned


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -