Hi,
Am 28.06.2012 um 23:56 schrieb sam ”:
> It looks like ResourceDecorators are ordered by service.ranking property
> in ascending order.
>
> @Properties({
> @Property(name = Constants.SERVICE_RANKING, intValue = 10)
> })
> public class Apple implements ResourceDecorator {
> ...
> }
>
> @Properties({
> @Property(name = Constants.SERVICE_RANKING, intValue = 20)
> })
> public class Orange implements ResourceDecorator {
> ...
> }
>
>
> Given above, Apple is executed first, then Orange, according to:
> http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java
>
>
> This is sort of unintuitive to me because there is this:
> http://www.osgi.org/javadoc/r2/org/osgi/framework/Constants.html#SERVICE_RANKING
> The default ranking is 0. A service with a ranking of Integer.MAX_VALUE is
> very likely to be returned as the default service, whereas a service with a
> ranking of Integer.MIN_VALUE is very unlikely to be returned.
Don't know about how the resource decoarator services are sorted, but if
ServiceUtil orders differently than implemented by ServiceReference instances,
this would IMHO be a bug.
Can someone confirm this ?
Regards
Felix