Interface ServiceLocator

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> java.util.List<T> findServices​(java.lang.Class<T> clazz, java.lang.String query)
      Find services of class clazz registered in the OSGI Service Registry.
      <T> T findSingleService​(java.lang.Class<T> clazz, java.util.function.Predicate<T> postFilter, java.lang.String bundleContextFilter)
      Finds a service registered with the OSGI Service Registry of type clazz.
    • Method Detail

      • findSingleService

        <T> T findSingleService​(java.lang.Class<T> clazz,
                                java.util.function.Predicate<T> postFilter,
                                java.lang.String bundleContextFilter)
        Finds a service registered with the OSGI Service Registry of type clazz. If a bundleContextFilter is provided, it is used to query for the service, e.g. "(operation.label=My Label*)". In addition each clazz of type T found in the OSGI Service Registry must afterwards pass the provided postFilter. If multiple services are found, only the first one is returned.
        Returns:
        A object of type clazz or null.
      • findServices

        <T> java.util.List<T> findServices​(java.lang.Class<T> clazz,
                                           java.lang.String query)
        Find services of class clazz registered in the OSGI Service Registry. The optional filter criteria query is used.
        Returns:
        All found services registered in the OSGI Service Registry of type clazz.