org.apache.stanbol.enhancer.servicesapi.helper
Class ServiceReferenceRankingComparator

java.lang.Object
  extended by org.apache.stanbol.enhancer.servicesapi.helper.ServiceReferenceRankingComparator
All Implemented Interfaces:
java.util.Comparator<org.osgi.framework.ServiceReference>

public class ServiceReferenceRankingComparator
extends java.lang.Object
implements java.util.Comparator<org.osgi.framework.ServiceReference>

Compares ServiceReferences based on the Constants.SERVICE_RANKING property value. Highest Rank will be listed first.

TODO: This is a copy of the same Comparator within the "stanbol/commons/solr/core module" (org.apache.stanbol.commons.solr.utils.ServiceReferenceRankingComparator). However creating an own dependency because of that seemed also not the right thing to do.


Field Summary
static ServiceReferenceRankingComparator INSTANCE
          Singelton instance
 
Constructor Summary
ServiceReferenceRankingComparator()
           
 
Method Summary
 int compare(org.osgi.framework.ServiceReference ref1, org.osgi.framework.ServiceReference ref2)
           
 
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
 

Field Detail

INSTANCE

public static ServiceReferenceRankingComparator INSTANCE
Singelton instance

Constructor Detail

ServiceReferenceRankingComparator

public ServiceReferenceRankingComparator()
Method Detail

compare

public int compare(org.osgi.framework.ServiceReference ref1,
                   org.osgi.framework.ServiceReference ref2)
Specified by:
compare in interface java.util.Comparator<org.osgi.framework.ServiceReference>


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.