Class RankedServices<T>

  • Type Parameters:
    T - Service type
    All Implemented Interfaces:
    Iterable<T>

    @Deprecated
    @ProviderType
    public final class RankedServices<T>
    extends Object
    implements Iterable<T>
    Deprecated.
    Please use org.apache.sling.commons.osgi.RankedServices instead.
    Helper class that collects all services registered via OSGi bind/unbind methods. The services are ordered by service ranking and can be iterated directly using this object instance. Implementation is thread-safe.
    • Constructor Detail

      • RankedServices

        public RankedServices()
        Deprecated.
        Instantiate without change listener.
      • RankedServices

        public RankedServices​(RankedServices.ChangeListener changeListener)
        Deprecated.
        Instantiate without change listener.
        Parameters:
        changeListener - Change listener
    • Method Detail

      • bind

        public void bind​(T service,
                         Map<String,​Object> props)
        Deprecated.
        Handle bind service event.
        Parameters:
        service - Service instance
        props - Service reference properties
      • unbind

        public void unbind​(T service,
                           Map<String,​Object> props)
        Deprecated.
        Handle unbind service event.
        Parameters:
        service - Service instance
        props - Service reference properties
      • get

        public Collection<T> get()
        Deprecated.
        Lists all services registered in OSGi, sorted by service ranking.
        Returns:
        Collection of service instances
      • iterator

        public Iterator<T> iterator()
        Deprecated.
        Iterates all services registered in OSGi, sorted by service ranking.
        Specified by:
        iterator in interface Iterable<T>
        Returns:
        Iterator with service instances.