Class ServiceReferenceUtils


  • public class ServiceReferenceUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Long getId​(org.osgi.framework.ServiceReference<?> ref)  
      static java.lang.Integer getRanking​(org.osgi.framework.ServiceReference<?> ref)  
      static void sortByRankingOrder​(org.osgi.framework.ServiceReference<?>[] refs)
      Sorts an array of service references in reverse order (highest service ranking first).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServiceReferenceUtils

        public ServiceReferenceUtils()
    • Method Detail

      • getId

        public static java.lang.Long getId​(org.osgi.framework.ServiceReference<?> ref)
        Parameters:
        ref - the service reference
        Returns:
        the service id
        See Also:
        Constants.SERVICE_ID
      • getRanking

        public static java.lang.Integer getRanking​(org.osgi.framework.ServiceReference<?> ref)
        Parameters:
        ref - the service reference
        Returns:
        the service ranking, or 0 if unspecified
        See Also:
        Constants.SERVICE_RANKING
      • sortByRankingOrder

        public static void sortByRankingOrder​(org.osgi.framework.ServiceReference<?>[] refs)
        Sorts an array of service references in reverse order (highest service ranking first). This method properly handles asynchronous updates to the service ranking.
        Parameters:
        refs - input and output array of service references