org.apache.felix.ipojo.util
Class ServiceReferenceRankingComparator

java.lang.Object
  extended by org.apache.felix.ipojo.util.ServiceReferenceRankingComparator
All Implemented Interfaces:
Serializable, Comparator

public class ServiceReferenceRankingComparator
extends Object
implements Comparator, Serializable

Service Reference Comparator. This comparator follows OSGi Ranking policy.

Author:
Felix Project Team
See Also:
Serialized Form

Constructor Summary
ServiceReferenceRankingComparator()
           
 
Method Summary
 int compare(Object ref1, Object ref2)
          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
 

Constructor Detail

ServiceReferenceRankingComparator

public ServiceReferenceRankingComparator()
Method Detail

compare

public int compare(Object ref1,
                   Object ref2)
Compares two service reference.

Specified by:
compare in interface Comparator
Parameters:
ref1 - the reference 1
ref2 - the reference 2
Returns:
-1 if the reference 1 is 'higher' than the reference 2, 1 otherwise. (higher is term of ranking means a lower index)
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)


Copyright © 2011 Apache Software Foundation. All Rights Reserved.