org.apache.felix.ipojo.dependency.interceptors

## Interface ServiceRankingInterceptor

All Superinterfaces:
  DependencyInterceptor

All Known Implementing Classes:
  ComparatorBasedServiceRankingInterceptor, DefaultServiceRankingInterceptor, EmptyBasedServiceRankingInterceptor

    public interface ServiceRankingInterceptor
    extends DependencyInterceptor

A service to influence the sorting of services on a service dependency. Only one ranking interceptor can be plugged on a dependency, but an interceptor can handle several dependencies. This interceptors is called to compute the selected set of services from the matching set, i.e. the set of services that matching the filter (actually accepted by the tracking interceptors).

Since:
  1.10.1

### Field Summary

### Fields inherited from interface org.apache.felix.ipojo.dependency.interceptors.DependencyInterceptor

`TARGET_PROPERTY`

### Method Summary

All Methods Instance Methods Abstract Methods
`java.util.List<org.osgi.framework.ServiceReference>` `getServiceReferences(DependencyModel dependency, java.util.List<org.osgi.framework.ServiceReference> matching)` Gets the sorted set of selected reference.
`java.util.List<org.osgi.framework.ServiceReference>` `onServiceArrival(DependencyModel dependency, java.util.List<org.osgi.framework.ServiceReference> matching, org.osgi.framework.ServiceReference<?> reference)` A new service arrives in the matching set.
`java.util.List<org.osgi.framework.ServiceReference>` `onServiceDeparture(DependencyModel dependency, java.util.List<org.osgi.framework.ServiceReference> matching, org.osgi.framework.ServiceReference<?> reference)` A service leaves the matching set.
`java.util.List<org.osgi.framework.ServiceReference>` `onServiceModified(DependencyModel dependency, java.util.List<org.osgi.framework.ServiceReference> matching, org.osgi.framework.ServiceReference<?> reference)` A service from the matching set was modified.

### Methods inherited from interface org.apache.felix.ipojo.dependency.interceptors.DependencyInterceptor

`close, open`

### Method Detail

#### getServiceReferences

    java.util.List<org.osgi.framework.ServiceReference> getServiceReferences(DependencyModel dependency,
                                                                             java.util.List<org.osgi.framework.ServiceReference> matching)

Gets the sorted set of selected reference.

Parameters:
  `dependency` - the dependency
  `matching` - the set of service to sort
Returns:
  the sorted set of selected reference. This set is a sub-set potentially empty of the given list of references.

#### onServiceArrival

    java.util.List<org.osgi.framework.ServiceReference> onServiceArrival(DependencyModel dependency,
                                                                         java.util.List<org.osgi.framework.ServiceReference> matching,
                                                                         org.osgi.framework.ServiceReference<?> reference)

A new service arrives in the matching set. This method is called to retrieve the new sorted set of selected services.

Parameters:
  `dependency` - the dependency
  `matching` - the set of matching service
  `reference` - the arriving reference
Returns:
  the new sorted set of service

#### onServiceDeparture

    java.util.List<org.osgi.framework.ServiceReference> onServiceDeparture(DependencyModel dependency,
                                                                           java.util.List<org.osgi.framework.ServiceReference> matching,
                                                                           org.osgi.framework.ServiceReference<?> reference)

A service leaves the matching set. This method is called to retrieve the new sorted set of selected services.

Parameters:
  `dependency` - the dependency
  `matching` - the set of matching service
  `reference` - the leaving reference
Returns:
  the new sorted set of service

#### onServiceModified

    java.util.List<org.osgi.framework.ServiceReference> onServiceModified(DependencyModel dependency,
                                                                          java.util.List<org.osgi.framework.ServiceReference> matching,
                                                                          org.osgi.framework.ServiceReference<?> reference)

A service from the matching set was modified. This method is called to retrieve the new sorted set of selected services.

Parameters:
  `dependency` - the dependency
  `matching` - the set of matching service
  `reference` - the modified service
Returns:
  the new sorted set of service