[ https://issues.apache.org/jira/browse/SLING-4521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Seifert resolved SLING-4521. ----------------------------------- Resolution: Fixed Completed: At revision: 1667709 documentation see javadoc. this is a port of the [implementation from wcm.io|https://github.com/wcm-io/wcm-io/blob/master/sling/commons/src/main/java/io/wcm/sling/commons/osgi/RankedServices.java], which can be deprecated as soon the new sling commons.osgi bundle is released. > Commons OSGi: Add helper class for thread-safe access list of ranked service > dependencies > ----------------------------------------------------------------------------------------- > > Key: SLING-4521 > URL: https://issues.apache.org/jira/browse/SLING-4521 > Project: Sling > Issue Type: New Feature > Components: Commons > Reporter: Stefan Seifert > Assignee: Stefan Seifert > Priority: Minor > Fix For: Commons OSGi 2.2.4 > > > the ServiceUtil.getComparableForServiceRanking method provides a great way to > create a sorted list of service references ordered by their ranking. > but using it still requires too much boilerplate code which has to be copied > for each usecase, typos may be undetected and lead to subtile threading > issue. such typos happened e.g. in the sling models implementation where > accessing ranked list of services is used much. > this ticket adds a new RankedServices class which implements the threading > details and - for additional convenience - the Iterable interface to allow > direct iteration about the references list of services in a thread-safe > manner. -- This message was sent by Atlassian JIRA (v6.3.4#6332)