Package org.adempiere.base.ds
Class ServiceRankingComparator
- java.lang.Object
-
- org.adempiere.base.ds.ServiceRankingComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<org.osgi.framework.ServiceReference<?>>
public final class ServiceRankingComparator extends Object implements Comparator<org.osgi.framework.ServiceReference<?>>, Serializable
Service Reference Comparator. This comparator follows OSGi Ranking policy.- Author:
- hengsin
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ServiceRankingComparator
INSTANCE
share service ranking comparator instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(org.osgi.framework.ServiceReference<?> serviceReference1, org.osgi.framework.ServiceReference<?> serviceReference2)
Compares two service reference.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
INSTANCE
public static final ServiceRankingComparator INSTANCE
share service ranking comparator instance
-
-
Method Detail
-
compare
public int compare(org.osgi.framework.ServiceReference<?> serviceReference1, org.osgi.framework.ServiceReference<?> serviceReference2)
Compares two service reference.- Specified by:
compare
in interfaceComparator<org.osgi.framework.ServiceReference<?>>
- Parameters:
serviceReference1
- service reference 1serviceReference2
- service reference 2- Returns:
-1
if service reference 1 service.ranking value is higher than service reference 2,1
otherwise. (i.e for sorting in descending order of service.ranking value)- See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
-
-