[
https://issues.apache.org/jira/browse/ARIES-17?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763539#action_12763539
]
Alasdair Nottingham commented on ARIES-17:
------------------------------------------
While I would agree that the javadoc is not brilliant in this regard the
Javadoc for BundleContext.getServiceReference(String) says the following:
This method is the same as calling getServiceReferences(String, String) with a
null filter expression. It is provided as a convenience for when the caller is
interested in any service that implements the specified class.
This does indicate that getServiceReferences does order the result correctly,
but it doesn't indicate whether the highest ranking is at the beginning or the
end. Having spoken to one of the equinox leads he says that equinox sorts with
the first entry being the highest ranking, which means that what we are doing
in JNDI is correct.
I haven't looked into the getAllServiceReferences bit yet, but I know we use
getAllServiceReferences in one place deliberately, and I haven't had a chance
to check for all the instances we may do.
> ServiceHelper registry lookup problems
> --------------------------------------
>
> Key: ARIES-17
> URL: https://issues.apache.org/jira/browse/ARIES-17
> Project: Aries
> Issue Type: Bug
> Components: JNDI
> Reporter: Jarek Gawor
>
> 1) ServiceHelper is using getAllServiceReferences() to get a list of services
> on the client's bundle context. That can return services which might be
> incompatible with the bundle classloader. I think the getServiceReferences()
> should be used instead.
> 2) The context.lookup("osgi:services/<interface>") should return a best
> ranking service registered with that interface. However, the
> ServiceHelper.getService() function seems to return a first service that it
> finds.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.