sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Seifert (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SLING-7194) AdapterManager sorts AdapterFactory implementations lowest ranking first
Date Thu, 07 Dec 2017 16:52:00 GMT

    [ https://issues.apache.org/jira/browse/SLING-7194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282129#comment-16282129
] 

Stefan Seifert edited comment on SLING-7194 at 12/7/17 4:51 PM:
----------------------------------------------------------------

the current behavior was introduced in SLING-2630. the intent of this ticket was to support
multiple adapter factories at all - which is still fulfilled if we change the service ranking
ordering.

of course we have a change in backward compatibility when this behavior is fixed as described
- existing code may rely on the current behavior.


was (Author: sseifert@pro-vision.de):
the current behavior was introduced in SLING-2630. the indent of this ticket was to support
multiple adapter factories at all - which is still fulfilled if we change the service ranking
ordering.

of course we have a change in backward compatibility when this behavior is fixed as described.

> AdapterManager sorts AdapterFactory implementations lowest ranking first
> ------------------------------------------------------------------------
>
>                 Key: SLING-7194
>                 URL: https://issues.apache.org/jira/browse/SLING-7194
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Adapter 2.1.10
>            Reporter: Stefan Seifert
>
> 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)

Mime
View raw message