Interface ServiceLocator
-
- All Known Implementing Classes:
BundleContextServiceLocator
,SimpleServiceLocator
public interface ServiceLocator
Helper interface to lookup all availableMetaTopologyProvider
s. This should make tests easier.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> List<T>
findServices(Class<T> clazz, String query)
Find services of classclazz
registered in the OSGI Service Registry.<T> T
findSingleService(Class<T> clazz, java.util.function.Predicate<T> postFilter, String bundleContextFilter)
Finds a service registered with the OSGI Service Registry of typeclazz
.
-
-
-
Method Detail
-
findSingleService
<T> T findSingleService(Class<T> clazz, java.util.function.Predicate<T> postFilter, String bundleContextFilter)
Finds a service registered with the OSGI Service Registry of typeclazz
. If abundleContextFilter
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 providedpostFilter
. If multiple services are found, only the first one is returned.- Returns:
- A object of type
clazz
or null.
-
-