You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (JIRA)" <ji...@apache.org> on 2017/12/12 10:41:00 UTC
[jira] [Assigned] (SLING-7194) Document that AdapterManager sorts
AdapterFactory implementations lowest ranking first
[ https://issues.apache.org/jira/browse/SLING-7194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Seifert reassigned SLING-7194:
-------------------------------------
Assignee: Stefan Seifert
Affects Version/s: (was: Adapter 2.1.10)
API 2.16.6
Priority: Minor (was: Major)
Issue Type: Task (was: Bug)
Summary: Document that AdapterManager sorts AdapterFactory implementations lowest ranking first (was: AdapterManager sorts AdapterFactory implementations lowest ranking first)
agreed - we will only update the documentation.
changing ticket title accordingly.
> Document that AdapterManager sorts AdapterFactory implementations lowest ranking first
> --------------------------------------------------------------------------------------
>
> Key: SLING-7194
> URL: https://issues.apache.org/jira/browse/SLING-7194
> Project: Sling
> Issue Type: Task
> Components: Extensions
> Affects Versions: API 2.16.6
> Reporter: Stefan Seifert
> Assignee: Stefan Seifert
> Priority: Minor
>
> the current implementation of AdapterManager uses a AdapterFactoryDescriptorMap to sort the AdapterFactory implementations found.
> this is done using a TreeMap with the ServiceReference as key. ServiceReference implements a compareTo.
> according to its documentation the default implementation sorts with service-ranking lowest-first/service id highest-first:
> https://osgi.org/javadoc/r6/core/org/osgi/framework/ServiceReference.html#compareTo(java.lang.Object)
> when picking a service from multiple ones using BundleContext.getService, the service with hightest service ranking/lowest service id is returned.
> i would expect the same from the AdapterManager implementation - if multiple implementations match pick that one with highest ranking/lowest service id.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)