Class SortedServiceReferenceList

java.lang.Object
ddf.catalog.util.impl.SortedServiceReferenceList
All Implemented Interfaces:
Iterable<org.osgi.framework.ServiceReference>, Collection<org.osgi.framework.ServiceReference>, List<org.osgi.framework.ServiceReference>, SequencedCollection<org.osgi.framework.ServiceReference>

public class SortedServiceReferenceList extends Object implements List<org.osgi.framework.ServiceReference>
This utility object sorts ServiceReferences by their service rankings first and then breaks ties with service ids.

It is an implementation of List but is backed by a sorted TreeSet of where the ServiceReference objects are what is used to maintain the list order.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int arg0, org.osgi.framework.ServiceReference arg1)
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    boolean
    add(org.osgi.framework.ServiceReference arg0)
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    boolean
    addAll(int arg0, Collection<? extends org.osgi.framework.ServiceReference> arg1)
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    boolean
    addAll(Collection<? extends org.osgi.framework.ServiceReference> arg0)
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    void
    bindService(org.osgi.framework.ServiceReference ref)
    Adds the newly bound OSGi service and its service reference to the internally maintained and sorted serviceSet.
    void
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    boolean
     
    boolean
     
    org.osgi.framework.ServiceReference
    get(int arg0)
     
    int
     
    boolean
     
    Iterator<org.osgi.framework.ServiceReference>
     
    int
     
    ListIterator<org.osgi.framework.ServiceReference>
     
    ListIterator<org.osgi.framework.ServiceReference>
    listIterator(int arg0)
     
    org.osgi.framework.ServiceReference
    remove(int arg0)
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    boolean
    remove(Object arg0)
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    boolean
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    boolean
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    org.osgi.framework.ServiceReference
    set(int arg0, org.osgi.framework.ServiceReference arg1)
    Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
    int
     
    List<org.osgi.framework.ServiceReference>
    subList(int arg0, int arg1)
     
     
    <T> T[]
    toArray(T[] arg0)
     
    void
    unbindService(org.osgi.framework.ServiceReference ref)
    Removes the newly bound OSGi service and its service reference to the internally maintained and sorted serviceMap.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface java.lang.Iterable

    forEach

    Methods inherited from interface java.util.List

    addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
  • Constructor Details

    • SortedServiceReferenceList

      public SortedServiceReferenceList()
  • Method Details

    • bindService

      public void bindService(org.osgi.framework.ServiceReference ref)
      Adds the newly bound OSGi service and its service reference to the internally maintained and sorted serviceSet. This method is invoked when a service is bound (created/installed).
      Parameters:
      ref - the OSGi service reference
    • unbindService

      public void unbindService(org.osgi.framework.ServiceReference ref)
      Removes the newly bound OSGi service and its service reference to the internally maintained and sorted serviceMap. This method is invoked when a service is unbound (removed/uninstalled).
      Parameters:
      ref - the OSGi service reference
    • add

      public boolean add(org.osgi.framework.ServiceReference arg0)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      add in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      add in interface List<org.osgi.framework.ServiceReference>
    • add

      public void add(int arg0, org.osgi.framework.ServiceReference arg1)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      add in interface List<org.osgi.framework.ServiceReference>
    • addAll

      public boolean addAll(Collection<? extends org.osgi.framework.ServiceReference> arg0)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      addAll in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      addAll in interface List<org.osgi.framework.ServiceReference>
    • addAll

      public boolean addAll(int arg0, Collection<? extends org.osgi.framework.ServiceReference> arg1)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      addAll in interface List<org.osgi.framework.ServiceReference>
    • clear

      public void clear()
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      clear in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      clear in interface List<org.osgi.framework.ServiceReference>
    • contains

      public boolean contains(Object arg0)
      Specified by:
      contains in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      contains in interface List<org.osgi.framework.ServiceReference>
    • containsAll

      public boolean containsAll(Collection<?> arg0)
      Specified by:
      containsAll in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      containsAll in interface List<org.osgi.framework.ServiceReference>
    • get

      public org.osgi.framework.ServiceReference get(int arg0)
      Specified by:
      get in interface List<org.osgi.framework.ServiceReference>
    • indexOf

      public int indexOf(Object arg0)
      Specified by:
      indexOf in interface List<org.osgi.framework.ServiceReference>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      isEmpty in interface List<org.osgi.framework.ServiceReference>
    • iterator

      public Iterator<org.osgi.framework.ServiceReference> iterator()
      Specified by:
      iterator in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      iterator in interface Iterable<org.osgi.framework.ServiceReference>
      Specified by:
      iterator in interface List<org.osgi.framework.ServiceReference>
    • lastIndexOf

      public int lastIndexOf(Object arg0)
      Specified by:
      lastIndexOf in interface List<org.osgi.framework.ServiceReference>
    • listIterator

      public ListIterator<org.osgi.framework.ServiceReference> listIterator()
      Specified by:
      listIterator in interface List<org.osgi.framework.ServiceReference>
    • listIterator

      public ListIterator<org.osgi.framework.ServiceReference> listIterator(int arg0)
      Specified by:
      listIterator in interface List<org.osgi.framework.ServiceReference>
    • remove

      public boolean remove(Object arg0)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      remove in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      remove in interface List<org.osgi.framework.ServiceReference>
    • remove

      public org.osgi.framework.ServiceReference remove(int arg0)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      remove in interface List<org.osgi.framework.ServiceReference>
    • removeAll

      public boolean removeAll(Collection<?> arg0)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      removeAll in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      removeAll in interface List<org.osgi.framework.ServiceReference>
    • retainAll

      public boolean retainAll(Collection<?> arg0)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      retainAll in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      retainAll in interface List<org.osgi.framework.ServiceReference>
    • set

      public org.osgi.framework.ServiceReference set(int arg0, org.osgi.framework.ServiceReference arg1)
      Unsupported operation, throws an UnsupportedOperationException since this list is read-only.
      Specified by:
      set in interface List<org.osgi.framework.ServiceReference>
    • size

      public int size()
      Specified by:
      size in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      size in interface List<org.osgi.framework.ServiceReference>
    • subList

      public List<org.osgi.framework.ServiceReference> subList(int arg0, int arg1)
      Specified by:
      subList in interface List<org.osgi.framework.ServiceReference>
    • toArray

      public Object[] toArray()
      Specified by:
      toArray in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      toArray in interface List<org.osgi.framework.ServiceReference>
    • toArray

      public <T> T[] toArray(T[] arg0)
      Specified by:
      toArray in interface Collection<org.osgi.framework.ServiceReference>
      Specified by:
      toArray in interface List<org.osgi.framework.ServiceReference>